- Lord PE
- ImpREC
- Fasm
- Frhed or other hex editor
[1 : Getting Started]
Loading at EP you'll notice it looks exactly like ASPR entrypoint =)
For those interested, how do we tell the difference?
Open exe in reshack or similar and if the "63" reference is present
it will contain something to this effect:
First you will need to apply protection against checking of debug bits. [see plugin above]
press shift-f9 and ignore any exceptions until you stop on the following:
00330000 C3 ret
wtf? why'd we stop =P ?
just one ret in the memory range!
you'll note at the bottom it says we hit a break-on-access.
Odd, since we never set one.
This is a funny trick, Ashkbiz sets the protect on this memory range to the same as mem-bp.
This will make olly stop and pass except.
The protector then checks if ret executed or if exception occured.
Solution?
Lie.. change the C3 -> CC and cause int3 exception =D
Good idea, weakly implemented.
So good, we changed ret to int3.
Now press ctrl-G and go to LoadLibraryA and set a BP
Continue pressing shift-f9 until we break in LoadLibrary
tracing out of function [ctrl-f9] we end up in internal import resolver.
Note, remember to remove breakpoint in loadlibrary when you are done with it.
Open Your dump in LordPE PE editor and change the following entries:
Change Base of Code to zero and olly will analyse it later.
Fixing resources:
Open memory map in olly [alt-M] and scroll till you see
00400000 | 00001000 | Unpackme | | PE Header
Double click this line.
Scroll down untill you see the Resource Table Address / Size in the dump.
Change the Resource Directory RVA / size in dumped exe to one we see in olly and it will be 90% fixed!
RVA: 00089000
SIZE: 00009C00
Fixing TLS:
We will add our own TLS directory.
Open LordPE and go to section table.
Right click and hit add section header.
You can name it .tls =)
Set virtual size to 1000 and raw size to 200
Now in your hex editor of choice add 0x200 bytes to end of dumped exe.
Finally go to the TLS directory in the Directory Table and set it to RVA of section [000E5000].
Size is always 18.
Save and open TLS directory with the [...] button.
Authored by:
haggar on
Friday, January 26 2007 @ 08:29 PM CET
Yes, you're right. CPUID-RDTSC trick is "stolen" , don't know for other tricks. But if it is just that trick taken from his challenge , I doubt that he has reason for complaining. Every protector has RDTSC checks.
Btw, bpx, could you please explain RET-INT3 hack.
I unpacked this protector before, but I don't know why you replaced RET with INT3 ? I sow that protector protects memory. If we step in (F7-F8) block and execute return, we will end in
RDTSC
PUSH EAX
RET
that crush application obviously. So first trick is that protector handler needs to handle exception.
But if it handles RETN (memory is protected) later it crushes (which I found way how to fix btw), but why it doesn't crushes on INT3?
is the protector also called \"NTkrnl Secure Suite ??
i remember reading nicolez brulez complaining about that protector that it uses code from his honeynet sotm33 challenge code
http://www.websense.com/securitylabs/blog/blog.php?BlogID=102