Game 11
Challenge: Reverse engineering a Windows executable with string manipulation
Step 1: Identify File
file Project1.exeOutput: PE32 executable for MS Windows 4.00 (GUI), Intel i386, 8 sections
Step 2: Extract Strings from Hex
From IDA disassembly, key strings:
CODE:0045041C Congratulation!CODE:00450434 Authkey :CODE:004504B8 2abbe4b6CODE:004504CC 44536ca0CODE:004504E0 81aae922CODE:004504F4 e32fa0deStep 3: Analyze Form Creation
In _TForm1_FormCreate, these strings are assigned to variables at offsets:
lea eax, [ebx+300h]mov edx, offset _str_2abbe4b6.Textcall @System@@LStrAsg$qqrpvpxv
lea eax, [ebx+304h]mov edx, offset _str_44536ca0.Textcall @System@@LStrAsg$qqrpvpxv
lea eax, [ebx+308h]mov edx, offset _str_81aae922.Textcall @System@@LStrAsg$qqrpvpxv
lea eax, [ebx+30Ch]mov edx, offset _str_e32fa0de.Textcall @System@@LStrAsg$qqrpvpxvAll strings are concatenated in order:
push dword ptr [ebx+300h]push dword ptr [ebx+308h]push dword ptr [ebx+304h]push dword ptr [ebx+30Ch]Result: 逐字符爆破结束后得到 32 位 hex 串(见文末 spoiler)。
Alternative: Decompiled Code Analysis
int __fastcall TForm1_Button1Click(int a1){ System::__linkproc__ LStrAsg(a1 + 784, &str_2V[1]); System::__linkproc__ LStrAsg(a1 + 788, &str_XS[1]); System::__linkproc__ LStrAsg(a1 + 792, &str_B6[1]); System::__linkproc__ LStrAsg(a1 + 796, &str_H1[1]); System::__linkproc__ LStrAsg(a1 + 800, &str_0F[1]);
System::__linkproc__ LStrCatN( a1 + 816, 5, v2, *(_DWORD *)(a1 + 792), // B6 *(_DWORD *)(a1 + 796), // H1 *(_DWORD *)(a1 + 788), // XS *(_DWORD *)(a1 + 800)); // 0F}The strings are rearranged in the concatenation. Check assembly for the actual order.
Assembly Order
push dword ptr [ebx+310h] ; 2Vpush dword ptr [ebx+318h] ; B6push dword ptr [ebx+31Ch] ; H1push dword ptr [ebx+314h] ; XSpush dword ptr [ebx+320h] ; 0F
; Password: 2VB6H1XS0F2abbe4b681aae92244536ca0e32fa0de