:
Hm, wondering if you got what I meant...
I'll use the Commander Keen format as an example here.
The way it's compression works is that a byte of A7 marks a "near" reference, and a byte of A8 marks a "far" reference. Should either of those bytes actually be part of a word, the word is replaced with 00 Ax xx. However, someone had a genius idea of writing the most inefficient (but thus quick and simple) algorithm ever - no compression *at all*, it just puts the 00 in so A7 and A8 aren't interpreted as flags.
So... why couldn't something similar be done? (ie: the only modification from the uncompressed file is "escaping" (to use MySQL terminology.. xD) the flags) Of course I'm guessing there *is* some reason, but I'm wondering what it might be?
|
Because it uses CUSTOM compression, e.g there is a function that would look something like:
void LoadCam(void* camPtr)
{
LoadVlcResource(camPtr); // Grab the "Bits " block
DecodeVlcBlocks(camPtr);
WriteVlcBlocksToVram(camPtr);
DestroyVlcRes(camPtr);
}
Apart from that's a very high level example, since its actually assembly.. and each sub function is doing tons more stuff. It can't be changed. The only thing I can do is this:
Write a injection hook dll that OVERWRITES the call address of "LoadCam" and do something like this:
void MyLoadCam(void* camPtr)
{
if ( IsMyMagicSpecailNoneCompressedCam(camPtr)
{
DoVeryNastyHorribleEvenMoreDangerousHack();
DoExtremelyDodgyHackOfWritingToVram();
}
else
{
LoadCam(camPtr);
}
}
Which I've managed to do, apart from what would be in DoExtremelyDodgyHackOfWritingToVram() dosen't really work too well at the moment since it trashes the games heap.
Edit: All right chumps I reversed the load image function which makes the DoExtremelyDodgyHackOfWritingToVram() less dodgy and easier to implement. Screen shot of my redirection dll clearing the screen to white ;D
Edit again: And as expected it causes the steam version to explode due to that binary have different function addresses since its packed. Which means there will only likely be ONE version of AE that this will work with.