upx加壳 32位
脱壳完后代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 int __cdecl main (int argc, const char **argv, const char **envp) { _BYTE v4[12 ]; _DWORD v5[3 ]; _BYTE v6[5 ]; int v7; int v8; int v9; char v10; int i; __main(); qmemcpy(v4, "*F'\"N,\"(I?+@" , sizeof (v4)); printf ("Please input:" ); scanf ("%s" , v6); if ( v6[0 ] != 'A' || v6[1 ] != 67 || v6[2 ] != 84 || v6[3 ] != 70 || v6[4 ] != 123 || v10 != 125 ) return 0 ; v5[0 ] = v7; v5[1 ] = v8; v5[2 ] = v9; for ( i = 0 ; i <= 11 ; ++i ) { if ( v4[i] != _data_start__[*(v5 + i) - 1 ] ) return 0 ; } printf ("You are correct!" ); return 0 ; }
注意一下数组的一个元素是四个字节 所以v5存储的是用户输入的12个字节
data_start _[*(v5 + i) - 1] 即用户输入的字符转化为ascii码后再-1 这个值为n v4等于 = _data_start[n]
所以逆向程序可以写成
1 2 3 4 5 6 a = [42 ,70 ,39 ,34 ,78 ,44 ,34 ,40 ,73 ,63 ,43 ,64 ] b = "~}|{zyxwvutsrqponmlkjihgfedcba`_^]\\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$# !\"" flag = "" for i in a: flag = chr (b.find(chr (i))+1 ) print (flag,end="" )