Thanks a lot for sharing the great stuff.

The source is now here:
http://keeper.lubie.org/html/dk2_too...r.php#txtrtool
If I recall correctly, I used EXE from v1.7.
Thanks a lot for sharing the great stuff.
Picking this up where you guys left off, as the sources for the dk2 texure tool don't seem to be close to completion or public use.
I'm currently reversing the function at 005B2450 (supposedly part of the decryption algorithm, from what I'm finding and from cross referencing the work done here).
I'm hoping I can get it working the other way around too, so people can swap out textures and recompile it.
If anyone has any info they'd like to share, or info they'd like to know, just ask.
EDIT:
Moving on to that second function, truly is a mess to reverse the stuff in there!
I'll keep you posted.
EDIT:
I've got breakpoints working over a remote connection, seems to be doing ok, sometimes the keyboard/mouse input becomes unresponsive, but otherwise it's working great.
Also, the application is sending these messages to one of the standard streams:
(R,G,B) = (5,6,5)
(R,G,B) (shifts) = (11,5,0)
The first message might indicate how many bits per color are being used.
The second message might indicate the shift lengths made during compression.
Still wondering what the random bytes are for...
EDIT:
bool scaryDecrypt(addr sourceBuffer, addr destinationBuffer, num rowByteLength, num textureWidth, num textureHeight);
Getting somewhere, being able to debug it remotely has been a huge help.
EDIT:
scaryDecrypt checks whether we are running in 16 or 32 bit display mode, the algorithms after that check are almost identical with some optimization/limitation for the selected mode.
Last edited by JvetS; March 29th, 2012 at 10:05. Reason: Progress update
Looks good so far![]()
D Programming Language - R.I.P. C++

