脱壳后运行
发现按下"登陆"就卡死了
到dis_entry 发现这样一段代码
_android_log_print(3, "tdog-loader", "ADDR %x", [COLOR="Red"]dword_60000[/COLOR]);
f = *(_DWORD *)v10;
l = *(_DWORD *)(v10 + 4);
_android_log_print(3, "tdog-loader", "MM %x _F %x _L %x", *(_DWORD *)v10, 0, 0);
cxa_demangle(1, [COLOR="Blue"]_cxa_atexit[/COLOR], &s);
_android_log_print(3, "tdog-loader", "HOOK SUCCESS");
LOAD:00060000 dword_60000 DCD 0x6610, 0x104 ; DATA XREF: LOAD:abs_export_function_block_offseto
函数地址:0x6610 //Unwind_GetCFAB
函数大小:0x104
_cxa_atexit:0x2DB28
目测该函数被壳hook了...
转到 _cxa_atexit
int __fastcall _cxa_atexit(int a1, int a2)
{
int v2; // ST0C_4@1
int v3; // ST08_4@1
v2 = a1;
v3 = a2;
tdog_decrypt(20, -20, 20, (int)&ll, 0x5F7C8B38u);//解密
((void (__fastcall *)(_DWORD, _DWORD))dword_0)(v2, v3);//执行
return tdog_encrypt(20, -20, 20, (int)&ll, 0x5F7C8B38u);//加密
}
这个函数
解密了一段代码 然后执行该代码 然后又 加密了
估计那段代码是0x6610。
带壳运行验证一下
IDA附加com.crackme
跳到base+0x6610
libcrackme.so:5B4E3610 sub_5B4E3610
libcrackme.so:5B4E3610 BX PC//跳到5B4E3614
libcrackme.so:5B4E3610 ; ---------------------------------------------------------------------------
libcrackme.so:5B4E3612 DCB 0xC0 ;
libcrackme.so:5B4E3613 DCB 0x46 ; F
libcrackme.so:5B4E3614 ; ---------------------------------------------------------------------------
libcrackme.so:5B4E3614
libcrackme.so:5B4E3614 _5B50AB28
libcrackme.so:5B4E3614 LDR PC, =loc_5B50AB28//跳到_cxa_atexit
libcrackme.so:5B4E3614 ; ---------------------------------------------------------------------------
libcrackme.so:5B4E3618 off_5B4E3618 DCD loc_5B50AB28 ; DATA XREF: libcrackme.so:_5B50AB28r
果然被hook了。。。
跟入sub_5B50AB28
int __fastcall sub_5B50AB28(int a1, int a2)
{
int v2; // ST0C_4@1
int v3; // ST08_4@1
v2 = a1;
v3 = a2;
sub_5B5157F8(0x5B4E3624u, 0xF0u, 0x5B4E3624u, 0x5B524DD4u, 0x5F7C8B38u);//tdog_decrypt
((void (__fastcall *)(_DWORD, _DWORD))*loc_5B523E58)(v2, v3);
return sub_5B51579C(0x5B4E3624u, 0xF0u, 0x5B4E3624u, 0x5B524DD4u, 0x5F7C8B38u);//tdog_encrypt
}
修改脱壳机源码加入
tdog_decrypt((UINT*)(base+0x6624), 0xF0, (UINT*)(base+0x6624), &new_size, 0x5F7C8B38);
重新脱壳