blabberer
September 20th, 2007, 09:18
well has got standard ollydbg thwarting measures
changed, rva and loader flags crap (view->file --> special -> peheader -> right click - modify integer -> savefile as new ) thats gone (read sotm 33 challenges results for details)
then got tls callbacks
events -> stop at system bp -> change peb->ntGlobalFlag to 0x72 (orred Loader_Show_Snap) and then watch the dbg prints to finad where is the call back
in tls callback it uses the fld tbyte olly crashing trick (view file nop the crap and save) thats gone (see ollydbg bugs section for posts regarding this)
then in tls callbacks it checks for temp break that olly sets (when you hit system start bp simply remove teh one shot bp from -> view -> break points (alt+b) right click remove
btw nice obfuscated algorithm there to check the byte 0xcc in memory
the check is fooled
it reaches the entry point in Pe header --> here statrs another round of crap obfuscation and finding kernel base and find loadlibrary address and getprocaddressing them to build import library
Code:
00796710 F3:A6 REPE CMPS BYTE PTR ES:[EDI], BYTE PTR DS:[ESI]
ECX=0000000E (decimal 14.)
DS:[ESI]=stack [0022FFB0]=47 ('G')
ES:[EDI]=[77ECF541]=41 ('A')
EAX 77E60000 kernel32.77E60000
ECX 0000000E
EDX 77ECDF20 kernel32.77ECDF20
EBX 00000000
ESP 0022FF98
EBP 0022FFF0
ESI 0022FFB0 ASCII "GetProcAddress"
EDI 77ECF541 ASCII "ActivateActCtx"
EIP 00796710 0wnzmodf.00796710
btw it rehashes the import address by xorring it again iirc there was an interesting post in this forum about some malware finding the import address and rehashing it again search the forum or read all one by one
Code:
0079C032 35 A5446DDD XOR EAX, DD6D44A5
0079C037 A3 55607900 MOV DWORD PTR DS:[796055], EAX
77E7B332 xor it with that constant
you will see
EAX 77E7B332 kernel32.GetProcAddress
EAX=AA8AF797
DS:[00796055]=AA8AF797
single step through every instruction till you understand you will be able to unpack this in a few days if you havent unpacked ever
