begemott
October 28th, 2003, 11:21
Hi,
I have an application protected with HASP4 (and I have the dongle).
There are .protect and _TEXT_HA sections.
I thought that since I have the dongle it will be easy to remove the envelope but...
1. Softice doesn't break - bpx, bpm aaaa X don't work.
This seems strange to me. In the essays regarding HASP4 it is decribed that bpm should work on CreateFileA, FreeEnvironmentStringsA etc. Any ideas?
Windbg didn't help me too(the program doesn't run at all).
Olly works...
First I noticed that the runnung program uses msvcrt.dll
To my way of thinking this means that the entry point of original(unpacked) exe will look like WinMainCRTStartup. So I created something like signature of WinMainCRTStartup and searched the process memory. I found two instances of the signature - one in the .text section and one in the .protect section.
I decided that the oep is where I found (what I think is)WinMainCRTStartup code in the .text section.
Next I dumped the running exe, removed the .protect section, correct the ep in a pe editor.
Next I used ImpRec to fix the imports.
And finally...my exe doesn't run.
(I also tried to dump the exe when the debugger breaks at the oep with no success)
Is this the right way to deal with the HASP4 envelope?
What to do further?
Regards!
I have an application protected with HASP4 (and I have the dongle).
There are .protect and _TEXT_HA sections.
I thought that since I have the dongle it will be easy to remove the envelope but...
1. Softice doesn't break - bpx, bpm aaaa X don't work.
This seems strange to me. In the essays regarding HASP4 it is decribed that bpm should work on CreateFileA, FreeEnvironmentStringsA etc. Any ideas?
Windbg didn't help me too(the program doesn't run at all).
Olly works...
First I noticed that the runnung program uses msvcrt.dll
To my way of thinking this means that the entry point of original(unpacked) exe will look like WinMainCRTStartup. So I created something like signature of WinMainCRTStartup and searched the process memory. I found two instances of the signature - one in the .text section and one in the .protect section.
I decided that the oep is where I found (what I think is)WinMainCRTStartup code in the .text section.
Next I dumped the running exe, removed the .protect section, correct the ep in a pe editor.
Next I used ImpRec to fix the imports.
And finally...my exe doesn't run.
(I also tried to dump the exe when the debugger breaks at the oep with no success)
Is this the right way to deal with the HASP4 envelope?
What to do further?
Regards!