Log in

View Full Version : Crypkey 6.0 Stealth Unpacking


squidge
December 28th, 2002, 01:24
An application protected with Crypkey Stealth component, version 6.0. Unlike the old pre-6.0 versions, these seem to be protected much better than the old ones.

When the program is run, a small temporary file is created which is 10Kb in length. This is run as a side-process to the parent and gets given several parameters, such as the full path to the parent, the parent's process ID, a location in the process ID's memory, and finally a couple of file handles to play with. It attaches itself to the parent using DebugActiveProcess and screams if it can't do it (for example, if your trying to debug the parent app). Once it has succeeded it runs the app as normal, but receives all debug notification events.

Meanwhile, the target app is decompressed and placed into memory by multiple calls to WriteProcessMemory. The import table however, is not written or decompressed. After a bit of event synchronisation between the parent and it's sibling process using CreateEvent/WaitForSingleObject, it turns into uses pipes for two way communications between the two processes.

Now, after all that, it finally places the import table into it's resting home and all API calls are resolved. This table is useless if the app is dumped unless you have something like Revirgin handy, as several things get trashed on the way.

The program then calls the OEP and everything runs as normal.

Or so you think. Dump the app and rebuild the IT and it'll still crash.

That's because instead of the normal table of JMP commands for jumping to various API calls, they have all been replaced with INT 3 breakpoint (0xCC) commands. That 10Kb sibling program the parent spawned receives the breakpoint exception as it's debugging it, and then calls the API on the parents program behalf by checking the entries in the exception structures (such as the exception address).

Once the program is finally repaired to normal, it runs as if it wasn't packed in the first place.

Has anyone noticed this kind of protection used in other programs? I'm interested to find out how they managed to implement such as scheme, looking at the old (and basic) Stealth protection used in 5.7 and earlier.

Now all I need do is write an unpacker for these executables, as they take quite a while to do manually.

nsaihan
March 29th, 2003, 13:39
You say: "Now all I need do is write an unpacker for these
executables, as they take quite a while to do manually"

So that sounds like you have done it at least once. Could
you say what tools you used and what approach you used
to interrupt the sequence so you could "dump the app"?

I find I am motivated to do one, manually, even if it is less
than convenient. (Unless you already wrote such an
unpacker and are willing to share it.)


Noam

squidge
March 29th, 2003, 13:56
Yes, I have already written an unpacker for Crypkey 6.0 applications, but I feel it not appropriate to publish to the web.

It is quite easy to dump however - think about the protection of Armadillo whilst examining this one, and you shouldn't have any problems.

jacky1108
August 18th, 2004, 01:54
squidge, I have a app protected with crypkey 6.x, I tried many times to unpack it, but all failed. could you give me a detail tut about this? and I sound another problem that the app shows a strange site code like "NW8B R8TT XY00 VJV0 75KT 00Q", it's longer than normal one, when I tried use this to generate site key, sitekey generator says the length of the site code is not correct, do you know why?
sorry for my poor English.