[HNCTF 2022 WEEK2]e@sy_flower
简单花指令
Nop掉
然后整段u c p然后就反汇编
可能反编译的不太对,,看了别人的wp就是ida反编译的有问题
#include<stdio.h>
#include<string.h>
int main()
{
int i,j;
char ch[]="c~scvdzKCEoDEZ[^roDICUMC";
int len=strlen(ch);
char v5;
for(i=0;i<len;i++)
{
ch[i]=ch[i]^48;
}
for(int i=0;i<len/2;i++)
{
v5 = ch[2*i];
ch[2*i] = ch[2 * i+1];
ch[2*i+1] = v5;
}
puts(ch);
//NSSCTF{Just_junk_Bytess}
return 0;
}
[HNCTF 2022 Week1]X0r
打开
arr处的数据那个2dup,是数据重复两次的意思
#include<stdio.h>
#include<string.h>
int main()
{
int i,j;
char data[]={0x3FE,0x3EB,0x3EB,0x3FB, 0x3E4, 0x3F6, 0x3D3, 0x3D0, 0x388, 0x3CA, 0x3EF, 0x389, 0x3CB, 0x3EF, 0x3CB, 0x388, 0x3EF
,0x3D5, 0x3D9, 0x3CB, 0x3D1, 0x3CD, 0x0A};
char ch[28];
int len=strlen(data);
for(i=0;i<22;i++)
{
ch[i]=(data[i]-900)^0x34;
}
puts(ch);
//NSSCTF{x0r_1s_s0_easy}
return 0;
}
[HNCTF 2022 Week1]贝斯是什么乐器啊?
先base64解密,然后在用解密得到的字符 各自+i;
#include<stdio.h>
#include<string.h>
int main()
{
int i,j;
char ch[]="NRQ@PAu;8j[+(R:2806.i";
int len=strlen(ch);
for(i=0;i<len;i++)
{
ch[i]=ch[i]+i;
}
puts(ch);
//NSSCTF{B@se64_HAHAHA}
return 0;
}
[HNCTF 2022 Week1]你知道什么是Py嘛?
不懂python,转成C语言
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
char s[36];
int i;
int arr[] = {29, 0, 16, 23, 18, 61, 43, 41, 13, 28, 88, 94, 49, 110, 66, 44, 43, 28, 91, 108, 61, 7, 22, 7, 43, 51, 44, 46, 9, 18, 20, 6, 2, 24};
s[0]='N';
for(i=1;i<35;i++)
{
s[i]=s[i-1]^arr[i-1];
}
puts(s);
//NSSCTF{Pyth0n_1s_th3_best_l@nguage}
return 0;
}
[HNCTF 2022 WEEK2]Packet
脱壳
base64换表
import base64
import string
str1 = "tLntq1rgE1vqwf8XC19Zmf8Zyxn5Fq=="
string1 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/"
string2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
print (base64.b64decode(str1.translate(str.maketrans(string1,string2))))
#NSSCTF{UPX_1s_s0_3asy}
[HNCTF 2022 Week1]给阿姨倒一杯Jvav
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int i;
char s[] = {180, 136, 137, 147, 191, 137, 147, 191, 148, 136, 133, 191, 134, 140, 129, 135, 191, 65};
int n=strlen(s);
for(i=0;i<n;i++)
{
s[i]=(s[i]^32)-'@';
}
puts(s);
//This_is_the_flag_!
return 0;
}
[HNCTF 2022 Week1]CrackMe
learn learn
od动调--wait me 速速学习
[HNCTF 2022 WEEK2]TTTTTTTTTea
xtea加密,日后研究一下原理和脚本
今天先溜了
#include<stdio.h>
int main()
{
unsigned int enc[6] = {0xC11EE75A, 0xA4AD0973, 0xF61C9018, 0x32E37BCD, 0x2DCC1F26, 0x344380CC};
unsigned int key[4] = {0x10203, 0x4050607, 0x8090A0B, 0x0C0D0E0F};
int i, j;
long sum = 0, delta = 0x61C88647;
// 解码
for(i=0;i < 6;i+=2){
sum = 0 - (32 * delta);
for(j = 0; j < 32; j++) {
enc[i+1] -= (((enc[i] >> 5) ^ (16 * enc[i])) + enc[i]) ^ (key[((sum >> 11) & 3)] + sum);
sum += delta;
enc[i] -= ((((enc[i+1] >> 5) ^ (16 * enc[i+1])) + enc[i+1]) ^ key[sum & 3] + sum);
}
}
// 打印
for (i = 0; i < 6; i++)
{
for (j = 0; j<=3; j++)
{
printf("%c", (enc[i] >> (j * 8)) & 0xFF);
}
}
return 0;
}