Fake51
June 2nd, 2001, 12:32
I'm having a problem with Safedisc. The encrypted file I'm working on is Thief 2: The Metal Age. Thing I'm trying to do is unwrap main executable, seeing that I have the game installed from original cd.
The problem lies in fixing the imports: they are ofcourse rerouted to Dplayerx.dll. From what I've read about Safedisc, the reroute normally works something like:
- push # of Api function to call
- push # of import module, i.e. 0 or 1 (as it only reroutes calls to kernel32 and user32
- call main dll routine.
- return with address of Api function
- jump to function
The version I'm working does the first three steps, but instead of returning with the address of the api, it jumps from inside the call. This is ofcourse not a problem, but when I looked inside the routine I found that the Api chosen by the routine didn't depend solely on the function # passed to the routine. It also depends on where the call to the Api came from.
Which leads to the real problem: calls from the main exe can go thru the same reroute, but result in different Api calls (which they do). Thus, trying to use something like Import Reconstructor on the import table will result in the program crashing (I'm guessing the same would happen with Revirgin, but I haven't been able to try since the darn thing doesn't work on my machine - don't know why).
Anybody tried this version of safedisc or had a go at Thief 2? Suggestions would be appreciated. Right now I'm figuring that I'll probably have to rip the code out of Dplayerx.dll and then insert it into the main exe, but if there's an easier way i'd love to go there instead.
Cheers
Fake
The problem lies in fixing the imports: they are ofcourse rerouted to Dplayerx.dll. From what I've read about Safedisc, the reroute normally works something like:
- push # of Api function to call
- push # of import module, i.e. 0 or 1 (as it only reroutes calls to kernel32 and user32
- call main dll routine.
- return with address of Api function
- jump to function
The version I'm working does the first three steps, but instead of returning with the address of the api, it jumps from inside the call. This is ofcourse not a problem, but when I looked inside the routine I found that the Api chosen by the routine didn't depend solely on the function # passed to the routine. It also depends on where the call to the Api came from.
Which leads to the real problem: calls from the main exe can go thru the same reroute, but result in different Api calls (which they do). Thus, trying to use something like Import Reconstructor on the import table will result in the program crashing (I'm guessing the same would happen with Revirgin, but I haven't been able to try since the darn thing doesn't work on my machine - don't know why).
Anybody tried this version of safedisc or had a go at Thief 2? Suggestions would be appreciated. Right now I'm figuring that I'll probably have to rip the code out of Dplayerx.dll and then insert it into the main exe, but if there's an easier way i'd love to go there instead.
Cheers
Fake