本帖最后由 wgf4242 于 2024-8-12 07:44 编辑
附件 https://wwi.lanzoup.com/iYKzj272ztwd
在经输入内容后下硬件断点观察.
140004160有个位逆序...
[C] 纯文本查看 复制代码 for ( i = 0; i < 36; ++i )
{
*((_BYTE *)a1[1] + i) = (2 * (*((_BYTE *)a1[1] + i) & 0x55)) | ((*((_BYTE *)a1[1] + i) & 0xAA) >> 1);
*((_BYTE *)a1[1] + i) = (4 * (*((_BYTE *)a1[1] + i) & 0x33)) | ((*((_BYTE *)a1[1] + i) & 0xCC) >> 2);
*((_BYTE *)a1[1] + i) = (16 * (*((_BYTE *)a1[1] + i) & 0xF)) | ((*((_BYTE *)a1[1] + i) & 0xF0) >> 4);
result = (unsigned int)(i + 1);
}
中间有try catch...处理了一下还是报错.
后面还会触发一个sub_140004260. 还没看懂. byte_140042000是个表. , 这里把 表里的内容和 Str[i%4]进行了异或存到了1e0000里.
[C] 纯文本查看 复制代码 BOOL __fastcall sub_140004260(__int64 a1)
{
int ii; // [rsp+20h] [rbp-28h]
_BYTE *v3; // [rsp+30h] [rbp-18h]
lpAddress = VirtualAlloc(0i64, 0xE8ui64, 0x1000u, flOldProtect);
v3 = lpAddress;
for ( ii = 0; ii < 232; ++ii )
v3[ii] = *(*(a1 + *(*(a1 - 16) + 4i64) - 8) + ii % 4) ^ byte_140042000[ii];
return VirtualProtect(lpAddress, 0xE8ui64, 0x20u, &flOldProtect);
}
[C] 纯文本查看 复制代码 unsigned char byte_140042000[232] = {
0x27, 0x44, 0x7F, 0xEB, 0x3A, 0x8F, 0x1A, 0x2E, 0xFB, 0x41, 0xE6, 0x46, 0xFB, 0x59, 0xEE, 0x42,
0xFB, 0x49, 0xD6, 0x46, 0xF9, 0x49, 0xEE, 0x85, 0x72, 0x85, 0xB3, 0xF6, 0x3A, 0x87, 0xB3, 0x16,
0xF9, 0x4C, 0xF2, 0x87, 0x37, 0xF8, 0x31, 0x4B, 0x82, 0x0C, 0xF6, 0x0E, 0x72, 0xCB, 0xB3,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 0x2C, 0xAB, 0xCD
};
后面好像还调用到这个 byte_140042000
[C] 纯文本查看 复制代码 void sub_140004350()
{
hThread = beginthreadex(0i64, 0, StartAddress, byte_140042000, 0, &ThrdAddr);
SetThreadAffinityMask(hThread, 1ui64);
Sleep(0x64u);
}
void __fastcall __noreturn StartAddress(void *a1)
{
int ii; // [rsp+20h] [rbp-18h]
while ( 1 )
{
for ( ii = 0; ii < 0xE8; ++ii )
{
if ( *(lpAddress + ii) == 204 )
exit(-1);
}
}
}
这个 StartAddress 没看懂干了啥.单纯检查有CC就退出么.
大概 1E0000 里面放的是一段程序。最后会调用。
最后密文比较为 720CF60E8C69236959A806EF2A1A56B696ACEE925CF2ED0A5F368E41A636867256D254C2 .只位逆序后解出部分明文.
sub_140001230 成功后把 062066363060267B 每个进行 ^0x55 最后输出 Su3ce5s.
硬件断点 断下的我都看了...可能差了一步..调试执行最终都是报错.没解出明文..
感觉需要确定前4个字符来还原 1e0000的代码,我的想法是通过最后是retn(C3) 异或 byte_140042000最后字节(0xCD) 再逆位序可得 第4字符为p.前面3个怎么确定呢? , 把最后比较内容直接 位逆序得到 N0op.应该快出了.
|