Log in

View Full Version : Asprotect Debugger v0.99b


Manko
April 23rd, 2003, 05:00
Hi!

Back when everybody started making debuggers of all kinds, pretty recently, I decided it was time to start programming on the PC, and asm was the natural choice, since I have my nose down in it as soon as I have time...

I decided to rellease my small proggy with commented source, so some of you will have a chance to learn, or improve the proggy...
Actually You can do whatever you wich with it.
It's not so nicely coded, since this is my first app, and commenting source was a pain, though I'm glad someone persuaded me to do it... Besides, how could I rellease source otherwise?
I hope this will be interesting to both RCE and Alexey, since I think it's time for him to know some of the tricks we use... Though these are far from all, I still look forward to getting some new code in aspr to play with.
I suspect though, we'll only see changes to signatures, - if anything - , not true inovations...

When you have tested my app, you will realise it'll work perfectly with sice and other apps. Actually I hope you will do it that way, since I don't handle dips or stolen bytes, in any way... It was never my intention to do everything, since I like to have my hands in the code. (Though this could easily be converted into a simple unpacker...)
(Besides, dips can never be handled ok, in an unpacker, since it is custom code by author, though most are lazy and use alexeys old example code, or whatever... I'm guessing his new advice is far better, but not used by stupid authors...)
(ANyway it's the encryption of crucial code, that is what they should use... but don't...)

I suggest to anyone interested in building any debugging apps to visit [Yates] and Iczelion's pages as they have some pretty good stuff on these and other things...

Snipped from the presentation in my source...
Code:
; It's just a small proggy to mainly show some important info for un-
; packing asprotect_ed apps. It will ofcourse do some other minor tasks...
;
; Features:
;
; 1. Put EAX=12121212h in place after GetSystemTime to stop pre-OEP-
; code from moving with every execution... Also same for IAT. (Rare)
;
; 2. It will show IATstart, end, length and ask to clean out some
; redirection, resolve emulated APIs and remove trashbytes, sometimes
; put between real IATentries.
; It will not yet resolve DialogBoxParamA + that visual-basic API...
;
; 3. It will show Dip-Table, pause and let you erase entries if wanted,
; making aspr-code skip those dips... Remember (!), some entries
; in the Dip-table are just "dip-data", not actual dips...
;
; 4. It will singlestep to oep and record occurance of some signatures
; such as stolenbyteserase, oepjumpsetup and stolenbytes(sometimes).
; It will ofcourse pause at all these and at OEP, where it also will
; show last address executed before reaching OEP.
;
; 5. Show any access violation exceptions caused by the debuggee after
; OEP... My thinking is, we might catch some tricks testing if API's
; are writeable.
;
; 6. Now if debugged prog is not aspred but dynamically loads dll that is,
; my proggy manage this as well.


edit:
!!! Look for updated version further down! !!!
(This was downloaded 162 time(s).)

edit:
Just go to this stupid page, to download...

http://www.kommunicera.umea.se/hemma/mawiklund/

/Manko

Hopcode
April 23rd, 2003, 11:16
Hello!

Congratulations for your sweet tool.
Im pretty sure a lot of ppl will learn from its source.
Me included for sure.

I gave it a try, and it works pretty fine.
i might modify it a little like inserting int 3 at the place of the
OEP (to allow /PEDUMP to dump directly from entry point), i might also modify a bit the bytes you display for the stolen bytes. on my target, it misses like 4 or 6 bytes and we have the complete "listing" needed to insert them.
might also insert an int 3 around that place, so i can make a screen dump etc..

Thanks again for sharing your work.

HopCode

banshee
April 23rd, 2003, 13:54
Great tool!
Thanks for sharing!
Tested it a little, all works fine except the OEP. On my target it reports 005474e0 instead of 00546ea0 which I think is true (I found it manually). Anyway great tool to make life easier

Manko
April 23rd, 2003, 14:11
Hi!

Hopcode:
Yeah, that's the idea! Change this to you're liking and you'll probably learn something from that too...

You're welcome!

banshee:
I'd sure like to know what target my OEP-seeker-routine, bummed out on. Could you tell me? Though I don't quite believe you... Sure it wasn't one of the dips or something?
(Though I know I altered one thing that could make it fail, and I haven't tested with older versions...)

Thanks for the kind words!

/Manko

Zilot
April 24th, 2003, 03:33
http://www.skola-crepaja.edu.yu/Laza/wile3.gif

No more comments

banshee
April 24th, 2003, 09:06
Manko:

h**p://www.mailnavigator.com/MNavi15.exe

I'm not 100% sure cos I'm only newbie Anyway will be thankful if you would check it.

Manko
April 24th, 2003, 14:18
Hi, banshee!

I just noticed a misstake... the value shown as dip-table-adress never get's filled so it displays a 0. (Though the diptable is displayed correctly. Easily fixed... but it's pretty unnecessary...)

I'm dead sure about the OEP my proggy display. If you could PM me how you got your OEP, It'd be great!

Nice target you got there! Especially this:
Code:
IATentry 569430 = EB1450 was not resolved...
I'v never seen that emulation before... gonna check it out when I have time.

/Manko

Iwarez
April 24th, 2003, 16:17
The OEP the program reports is right. Except offcourse that the OEP should be corrected with the stolen bytes.

Manko
April 24th, 2003, 17:52
Hi!

sigh!

I looked at the wrong adress... Much more interesting code on wróng adress...

This was only yet another sig for prestoredresultsemulatedAPI, will include it, if I make a new version... Well atleast in my own...

Quote:
Originally posted by Manko
Code:
IATentry 569430 = EB1450 was not resolved...


Nighti night!

/Manko

sv
April 25th, 2003, 04:34
Hi Manko

Nice works !

...
GetCPInfo KERNEL32.DLL 56942c d9abd4
FreeResource KERNEL32.DLL 569430 bff92f43
FreeLibrary KERNEL32.DLL 569434 d9abec
...

Your FreeResource pattern
'cmp ebx, 05dec8b55h ; sig: 558bec5dc20400 is FreeResource'

This one is 558bec8b humm! Perhaps another one !

Regards

SV

Manko
April 25th, 2003, 07:36
Hi, sv!

Thanks! Could you pm target to me?

I'm aware my proggy don't handle all emul API variants yet.
But most things are easy to fix... You could even do it yourself.

Don't feel like updating proggy, unless I add something good, or I have to correct many errors...

Two thoughts of mine are:
1. Auto skip erase of stolen bytes. (easy)
2. Make it put stolen bytes to real OEP and report it. (Little more work, and might be fragile... Haven't looked...)

Have only received few suggestions.... (One realy good, but sorta wasted on a lazy noob like me... But I will look at it...)

Anyone have more ideas, thoughts or questions on proggy or source?

/Manko

Hopcode
April 25th, 2003, 11:04
>This one is 558bec8b humm! Perhaps another one !

Yes, i also noticed that.
It is indeed FreeResource.

Woops, i forgot one API slot!
No wonder it was failing

File is unpacked and runs fine :-)
I prefer to do it by hand to be sure im still able to do it
But Your tool is very handy Manko and the best is the source
I will modify it a bit later so it suits me even better

Regards,

HopCode

banshee
April 25th, 2003, 15:28
Manko:
I'm sorry. Now I think I said the wrong oep. Does the start code looks like this?

.text:005474C8 public start
.text:005474C8 start proc near
.text:005474C8
.text:005474C8 var_18 = dword ptr -18h
.text:005474C8 var_14 = dword ptr -14h
.text:005474C8 var_10 = dword ptr -10h
.text:005474C8
.text:005474C8 push ebp
.text:005474C9 mov ebp, esp
.text:005474CB add esp, 0FFFFFFE8h
.text:005474CE push ebx
.text:005474CF push esi
.text:005474D0 xor eax, eax
.text:005474D2 mov [ebp+var_18], eax
.text:005474D5 mov [ebp+var_10], eax
.text:005474D8 mov [ebp+var_14], eax
.text:005474DB mov eax, offset dword_547008
.text:005474E0 call sub_4075DC
.text:005474E5 mov esi, dword_55028C
.text:005474EB xor eax, eax
.text:005474ED push ebp
.text:005474EE push offset loc_547683
.text:005474F3 push dword ptr fs:[eax]
.text:005474F6 mov fs:[eax], esp
.text:005474F9 call sub_402AA4
.text:005474FE test eax, eax
.text:00547500 jle loc_547594
.text:00547506 mov eax, dword_55025C
.text:0054750B mov eax, [eax]
.text:0054750D call sub_40A078
.text:00547512 mov ecx, eax
.text:00547514 mov edx, dword_55025C
.text:0054751A mov edx, [edx]
.text:0054751C mov eax, offset dword_5680A0
.text:00547521 call sub_404070
.text:00547526 jmp short loc_54752F

Manko
April 25th, 2003, 19:50
Hi!

Minor update of my proggy...

1. 2 new sigs for IAT resolv.
2. It skips erase of stolen bytes.
3. It display ebx on OEP, since this often contain number of stolen bytes...

BUGFIX: NOW it CAN skip dips... (Stupid me. I never let it know which address the table was at... That is, the part that does the erase, to skip dips...)

banshee:

That is completely correct!

sv, hopcode:

Yup it was freeresource...
(Stupid me. Was too lazy to really look at it...)
What he did was put in code to return getcommandline-result, just to screw with resolving...

edit:
!!! Look for updated version further down! !!!
(Was donwloaded about 50(?) times...)

/Manko

Manko
April 26th, 2003, 17:50
Hi!

Now proggy show info on stolen bytes and real OEP when reach temp OEP, and ask to copy stolen bytes to real OEP.
(It only work with newer versions for now. Would be easy to do older, but I don't have em...)

Older donwloads in this thread was erased, so's not to cause unnecessary downloads and/or confusion...

Look far later in thread to find new version of tool!

/Manko

Attachment: asprdbgr.zip
This has been downloaded 401 time(s).

S3ri@l CoDe9x
May 3rd, 2003, 06:09
Great Update!


Works Good!!!


Best Regards!

Paul333
May 5th, 2003, 20:12
Hello Manko

WOW!!..Some great reviews here .

Well done and thanks Manko

..errm how does it work?

Hope noone thinks im daft but nothing happens when i run it?..it loads a file then just sits there ,when i close the file im running asprdebugger asks "HUH? Finished".I dont know how to use this .do i have to use switches i dont see any in your infos?..Do i have to run it within softice or something?..Please help

Thanks

paul333

Manko
May 6th, 2003, 12:21
Hi, Paul333!

I am guessing you compiled this yourself, and forgot to compile it with "console"-switch?
(Because that is the only earlier reported case where proggy just sit without doing anything.)

If not. What target are you trying?? (You can PM.)

/Manko

Paul333
May 8th, 2003, 18:20
It happens with any target....I did not compile it ,i know the source is there and its possible but i didnt have to ,im using the exe thats already there

AsprDbgr.exe "AsprDbgr v0.99beta (:P) Made by me... Manko."

Lol dont tell me.thats not the main program then is it??

paul333

Manko
May 9th, 2003, 11:35
Hi!

Since it is working for most anyone else (?), I think it would be best to continue this by PMing...

Only thought I have on this is that maybe you are using it on an unsupported OP... Maybe some other prob? I didn't bother to have this proggy do much fail-checking...

btw, If you really want it to work, you could debug it...
...and have more meaningful info, on which to arrive at a sollution/explanation to this problem...

...or you could compile it and see what happens...

/Manko

Paul333
May 9th, 2003, 19:24
Hi Manko

I can debug it if i know some facts

Is AsprDbgr.exe .the main exe?

If so ...when i double click it it asks for a file to open then does nothing...WHY?.....Do i need to do more than simply double click it and open a file packed with asprotect...ie..do i have to use switches?......if so theres no switches in any of the info;s you supplied

Only files in your zip are

AsprDbgr.txt
AsprDbgr.asm
AsprDbgr.exe

Manko NONE of these hAve info on how to use the program with switches........your.asm file has references to possible switches hardcoded but if i use any of them from that file nothing happens

So i assumed just double click it to rum ??

Help me out here.Explain how your program is ran?

Im being serious here ..Is this just a wind up?..does it actually work?...if so accept my apoligies

Thanks its appreciated

paul333

Manko
May 10th, 2003, 02:43
Hi, Paul!

Hmm... You don't like PM?

Anyway... It is THAT simple... Run it, choose an aspred exe and follow the movements...

But something is obviously wrong. Why wont you tell me which OP you're running? That MIGHT help. (I'll probably say; - It's not supported... )
And why don't you check for yourself what your puter is doing to my fine program? (You have tools. You even have source. And the bug is on YOUR setup. Sadly not mine, or it would be easy to fix...)
Most likely some API-call is not working/hanging...? Maybe syminitialize...? THAT I can fix... easy...

I need more info.

btw, you're not helped by hinting it's a fake...

/Manko

Paul333
May 11th, 2003, 07:35
Quote:
Originally posted by Manko
Hi, Paul!

btw, you're not helped by hinting it's a fake...

/Manko


I know , sorry ,accept my apoligies Manko

Im using windows 98 ..if its not supported then thats that ...if it is supported then ill give you peace and leave it for a while

thanks for patience

paul333

Manko
May 11th, 2003, 08:26
Hi, Paul!

Quote:
Originally posted by Paul333
/.../
Im using windows 98 ..if its not supported then thats that
/.../
paul333

That's that...

I did it on w2k, for w2k, since that is what I work with...
W9X is MUCH too buggy for my taste.

/Manko

Paul333
May 11th, 2003, 17:21
Lol i should have said what OS from the start Manko.sorry

Thats that then...., same as aspstripperXP too , no one builds for win987 anymore...... i have win 2000 ,win 98 SE and win XP sitting on my comp waiting to be installed sometime in the future so i can use your debugger and the other fine tools

Not at the mo though

Cheers

paul333

Feisu
July 31st, 2003, 23:17
Hi,Manko

New version of ASProtect can found it,Can't debug.Can you have a see?

hxxp://www.gelosoft.com/synchro.exe

This Software is pack by new version of ASProtect,When I use your tool to debug it, It show
http://feisu.hanzify.org/pic/debug.png

Manko
August 8th, 2003, 19:16
Hi, Feisu!

Actually I had noticed this too, and sollution was not so much work... Problem is, I have very little time these days for RE...

So here goes: New version, at last...

(Read the included .txt...)

deleted... downloaded 62 times...

/Manko

Feisu
August 8th, 2003, 22:36
Quote:
Originally posted by Manko
Hi, Feisu!

Actually I had noticed this too, and sollution was not so much work... Problem is, I have very little time these days for RE...

So here goes: New version, at last...

(Read the included .txt...)

/Manko



great tools!

great job!

thanks very much.

Manko
August 19th, 2003, 08:51
Hi!

Did a small update...

STupid page for AsprDbgr1b... (http://www.kommunicera.umea.se/hemma/mawiklund/)

now IAT is fully cleaned again... (I, hope...)
some other small changes...

I have done nothing about stolen bytes, or the faulty reported "(temp)OEP" in newest targets...

It's not so hard to find them both...

When paused at right place, fire up sice, use 'addr' command, set bpx, continue execution, when it break, trace till you know what's what... repeat till you're satisfied...

/Manko

aka
August 19th, 2003, 17:35
Thanks, and I am waiting for your tutorials.

seven
August 20th, 2003, 04:19
what is ( stolen bytes ) means ?
can some1 plz explain ?
thx

Manko
August 20th, 2003, 06:32
Hi!

Stolen bytes:
When aspr packs a program he will strip it of the first few instructions and put them in it's own space and run them there and then jump to following instruction in proggies space...
This is done to complicate things for us...
It was too simple, so NOW he has put lots of crapcode in ther to confuse us and he has changed the code a bit totrick us and also he emulates part of code that is after those stolen bytes, so we end up inside some procedure, complicating things further... blabla...

btw, I did stupid dirty update to proggy to get tempOEP on new aspr, it will break if variations occur, but I had no time to make proper code...

http://www.kommunicera.umea.se/hemma/mawiklund/

/Manko

Feisu
August 22nd, 2003, 00:21
thanksbut have one app packed by aspr.detected it.plz you have a see:P

SpeedCommander 9

hxxp://www.sp-download.de/sc9/sc9.exe

Manko
August 22nd, 2003, 01:40
Hi!

Hehe, I had forgotten about aspr-packed dlls...

Actually they run before the proggy, so I just put my patching routine when process was created...

I also left it where it is because apps switch context as they are being loaded... hmm...

Still, asprdbgr, doesn't debug the target as it should. It stops before it has displayed resolved api... hmm...

I'm working on it.

/Manko

Manko
August 22nd, 2003, 02:51
Hehe... stupid me. I had "SuperBPM" (a variant...) on so my app couldn't do BPM's...

Anyway, had to do some other things...

Go get it!

http://www.kommunicera.umea.se/hemma/mawiklund/

/Manko

Manko
August 22nd, 2003, 03:39
Ehrm... I accidentally killed my app... Had to do stupid sollution...
(If I have time, I'll try and fix this...) (Could do a msgbox-question, but that feels wrong...) (Hmm.... or maybe just check exe... (Will fix later!

/Manko

Computer_Angel
August 22nd, 2003, 22:52
Can anyone explain to me:

What is the dip-table, and what is it used for ?
While using the aspr debugger, the console show:

Dip-Table at adress: BF7AB4
0 5771B8 0 0 5771CC 0 0 5771E8 5775E0 577614 0 0 0 0

Is there any tuts for aspr debugger ? I try to use it but don't know how to unpack :-D

JMI
August 23rd, 2003, 02:40
Come on guy:

This is why we have a "search" function on the Board. Press the search button at the top of the Forum, go to the left hand side and enter "aspr + dip" and you will find several interesting entries. Also try "asprotect + dip" and anything by +Spl/\j and aspr and/or asprotect. There's lots of material here, just go do some of the work of actually looking yourself. Then, after you read up, then ask questions.

Regards.