Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   New Asprotect? (https://forum.exetools.com/showthread.php?t=4294)

hobgoblin 05-18-2004 03:46

New Asprotect?
 
1 Attachment(s)
I just found this one at the RCE forum. The poster asked for people to try to unpack it, so I figured I could post it here (without stepping on someones toes). Anybody capable of unpacking it?

bollygud 05-18-2004 10:14

1 Attachment(s)
yes i can... and i just did :)

93k -> 1MB

and i see whoever protected it did not use the EP redirection. wouldn't have mattered tho.

Please keep in mind that this will only work on my machine, or possibly only on the OS in which I unpacked it. As it contains the aspr envelope attached to the dump, I will not post it for possible security reasons, nor do I recommend anyone posting their own dump with the aspr envelope attached.

---edit---
oops, forgot to trim down the size of my aspr envelope :) had a bunch of 00's.
once trimmed is only 229k. i'm not uploading another jpg. just thought i'd clear that up.

Computer_Angel 05-18-2004 11:09

this "unpackme" is protected with asprotect 1.31 beta, and the poster not using the option hide OEP (to make it unpack easier? :) ).
I've see nothing in your picture, just a lordpe screen.
With lordpe i can dump it too, but can't fix the IAT, any ideal ?

bollygud 05-18-2004 23:11

i'm not posting the file cuz it contains the aspr envelope, which could possible contain other info. but if you must know here is the unpacked oep:

Quote:

00401000 > 6A 00 PUSH 0
00401002 E8 C1030000 CALL 004013C8
00401007 A3 C0314000 MOV DWORD PTR DS:[4031C0],EAX
0040100C 6A 00 PUSH 0
0040100E 68 2B104000 PUSH 0040102B
00401013 6A 00 PUSH 0
00401015 68 00304000 PUSH 00403000 ; ASCII "MainDialog"
0040101A FF35 C0314000 PUSH DWORD PTR DS:[4031C0]
00401020 E8 73030000 CALL 00401398
00401025 50 PUSH EAX
00401026 E8 97030000 CALL 004013C2 ; JMP to kernel32.ExitProcess
0040102B 55 PUSH EBP
0040102C 8BEC MOV EBP,ESP
0040102E 817D 0C 10010000 CMP DWORD PTR SS:[EBP+C],110
00401035 0F85 8E000000 JNZ 004010C9
0040103B FF75 08 PUSH DWORD PTR SS:[EBP+8]
0040103E 8F05 C4314000 POP DWORD PTR DS:[4031C4]
00401044 51 PUSH ECX
00401045 33C9 XOR ECX,ECX
00401047 51 PUSH ECX
00401048 8D81 28304000 LEA EAX,DWORD PTR DS:[ECX+403028]
0040104E 50 PUSH EAX
0040104F 6A 00 PUSH 0
00401051 68 43010000 PUSH 143
00401056 68 B80B0000 PUSH 0BB8
0040105B FF75 08 PUSH DWORD PTR SS:[EBP+8]
0040105E E8 4D030000 CALL 004013B0
00401063 59 POP ECX
00401064 83C1 05 ADD ECX,5
00401067 81F9 9B000000 CMP ECX,9B
0040106D ^ 75 D8 JNZ SHORT 00401047
0040106F 59 POP ECX
00401070 6A 00 PUSH 0
00401072 6A 00 PUSH 0
00401074 68 4E010000 PUSH 14E
00401079 68 B80B0000 PUSH 0BB8
0040107E FF75 08 PUSH DWORD PTR SS:[EBP+8]
I showed the lordpe screenshot to show it running and the size of the process.

Computer_Angel 05-19-2004 00:32

hi,
unpack is easy, but do you try to fixed iat yet ?
This prog is small, and not contain many api, so you can solve it easily, but think when there's a lot of api, at that time, what can we do now :)

hobgoblin 05-19-2004 01:57

Well
 
Hi guys,
Why don't you guys in a few words explain how you unpacked it and fixed the iat?

regards,

bollygud 05-19-2004 05:34

Quote:

Originally Posted by hobgoblin
Hi guys,
Why don't you guys in a few words explain how you unpacked it and fixed the iat?

regards,

To keep it as few words as possible, I'll simply explain the method by which you can unpack and run this version. If you're not familiar with aspr or the pe file format then the following will not help you.

Get to OEP as usual, break on many exceptions and jump over the last exception and RET which will eventually lead you to EP. Then you can dump, that's the easy part. Then what you must do is dump the ASPR envelope from memory and attach it to your dump. I have seen regular sized apps with big import tables and at the moment I have no way of fixing or creating and iat. Once you've attached your ASPR to your dump you need to fix the import table to point to the proper thunks.

That's the extreme basic way of doing it

There are things you can do to change the ASPR envelope's native address, etc. Plus lots of cleaner ways to rebuild your pe. But that right there is the basic idea.

Also note that this approach will only allow the dump to run on your machine or possibly only the same os. It's definitely not a cross-platform solution with a generic iat/import table. But it works nonetheless.

One other thing to mention. Since this version does not use the native iat to point to system apis or redirected apis it will be quite a task to create an iat and that, really, is the only stumbling block for a more 'pure' solution. The other things such as obfuscated redirected functions are quite a bit tougher with this version, but that can always be resolved by simply attaching the obfuscated code somewhere and redirecting the jump/call to it.

I hope that answers some questions

koyaan 05-19-2004 06:58

i cant get it to run in ollydebug... passed a lot of exceptions but after a
while and "illegal instruction" windows box pops up and my process is killed...

i then set olly options to ingore most exceptions and restarted... it loads nicely and i get the debugge detect msgbox... and then it crashes i cant even click ok ... isdebuggerpresent plug did not help

hobgoblin 05-19-2004 14:13

Yes,
 
Thank you for your input. It's a good starting point for further investigation.:-)

regards,

britedream 05-19-2004 23:33

As I indicated in my earlier post that I would look for unpacking the beta through traditional way, the key to this is to correct the code calls and jumps to asprotect area, the good news is the I found the locations that will correct calls and jumps, the only problem is time, I need to test it and unpack it through this method.I did run a program that I protected with the correction in place and it ran fine , which means these corrections are good.I did test this also on the unpackmenow, and it corrected all calls and jumps that I could see, but due to lack of time I couldn't pursue any further, but I will do that on the weekend if time permit.

regards.

Computer_Angel 05-19-2004 23:55

it detect debugger, but you can easily bypass it by using IsDebuggerPresent plugin.
I also use the get api call in Imprec, try to make valid range from 401000 to 401fff to get the emulate api. That's way i did, but the weak point is i must correct every emulate api ---> It's so bad because there're alot of them.

hobgoblin 05-20-2004 00:55

Hi
 
Hi britedream,
I'm looking foreward to learn about your solution. :)

BTW, has anyone found a program protected by this new version?

Darren 05-20-2004 02:47

why not find the part in the unpacker that cycles through all the imports and patches the calls in the app with addresses of the redirected api in the envolope section, make a little ollyscript to capture the true api address and use ollyscript to put in correct api address and then use imprec tool to search for call [xxxxxx] and rebuild u a import that directly patches the calls,
or capture the table out of memory aspr uses to create these redirected calls
and build your own tool to build imports section and fix the call [xxxxxx] to point to a new IAT

- Darren

bollygud 05-20-2004 08:00

Quote:

Originally Posted by hobgoblin
BTW, has anyone found a program protected by this new version?

WhereIsIt 3.59

I also look forward to hearing more about true iat direction fixing from britedream. From my observation, it appears that there is never an 'original' call structure that is then overwritten. It only seems that there are some basic distance bytes that are then calc'd and overwritten to the direct calls/jumps to the aspr env. If you have found something else that's truly be amazing. :)

Darren 05-20-2004 10:26

1 Attachment(s)
this is the internal import table i mean, aspr steps through this and decodes as it goes, patching the calls and jumps to the envolope. on my machine the address of the code that does this is 0xc1550a. its possible to hijack this code with a little ollyscript and avoid it pointing calls to envolope code but to the real api addresses in memory, also i suspect with a few tweaks to the script it should be possible to make the script create an IAT and all the patched jumps/calls will be pointing to this new IAT, then its a case of sniffing out any emulated api and fixing them up manually

- Darren

bollygud 05-22-2004 14:10

well, i managed to do it, but the solution doesn't seem to fit every situation so i'll not post any real specifics yet. just wanted everyone to know that it is possible. it took a lot of rebuilding. rebuilding an iat, fixing jumps/calls, etc.

i do have one question, maybe someone can help me out. is there an api that acts the opposite of GetModuleHandleA? in other words, an api that can be feed in a number that is the modules handle, like 77000000, and it will spit out the module name? just curious, cuz something like that could help somewhat.

nerst 05-22-2004 14:40

Quote:

Originally Posted by bollygud
i do have one question, maybe someone can help me out. is there an api that acts the opposite of GetModuleHandleA? in other words, an api that can be feed in a number that is the modules handle, like 77000000, and it will spit out the module name? just curious, cuz something like that could help somewhat.

GetModuleFileNameA ??? :confused:

bollygud 05-23-2004 00:44

hehe, duh! :)

thanks. my brain is a little fried ;)

santa_kewl 05-29-2004 14:48

Hi all,

On the last exception you will see anti softice sice too :).
hmm still need time to find why the iat is not able to resolve using revirgin or imprec....

Regards

Darren 05-29-2004 19:10

because an IAT isnt used, aspr engine patches calls/jumps in the user code directly

Crk 05-29-2004 22:31

i managed to make a working dump and found OEP for whereisit? 3.60 ... but can't fix IAT ..has anyone been able to find a solution for this?

SvensK 05-30-2004 02:13

@Crk: britedream just posted that he unpacked latest whereisit. I'm sure he'll tell you how.

Hmm, is the OEP at 006FB5EC ?

Crk 05-30-2004 05:36

since i couldn't fix IAT i deleted all files... i forgot which one is but manually you will be able to find it ... look with W32Dasm for the string : WHEREISIT.CHM

a little up is OEP where that piece of code start (558BEC......)

there are not stolen bytes! :)

i'm waiting for britedream tut about fixing IAT
it looks new asprotect and armadillo are using almost same technique to protect IAT this time .. for how long? ;)

Regards.

SvensK 05-30-2004 15:35

@Crk: Ok, then at least I had found the OEP and dumped the exe.

britedream 06-01-2004 17:01

in the new asprotect just use peid oep finder when checking the protection, it will give you the correct oep if not protected , in the two I checked it gave the correct oep.

deviljin 07-20-2004 20:15

Proposed solution for fixing IAT
 
1 Attachment(s)
Since no one has posted a solution for fixing IAT of new asprotect, i post here a simple solution. I do not know it works in any situation since i did not try it on commercial software but u can check it out. I think that my solution is just an application of different suggestions i find in this forum.

I took the Unpackmenow as an example.

Regards
deviljin


All times are GMT +8. The time now is 14:30.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX