Descrambling progs.dat?
Descrambling progs.dat?
there are some progs.dat files that appear to be scrambled and cause a segmentation fault in many decompilers.
Is there a counter application to SCRAM.EXE that allows for unscrambling a scrambled progs.dat file?
Is there a counter application to SCRAM.EXE that allows for unscrambling a scrambled progs.dat file?
Actually, I've been using frikdec! On a little endian P4 processor running GNU/Linux (debian/sid)FrikaC wrote:I don't know if you've tried frikdec, but it more or less nullifies what SCRAMBLER! does. Then again, because it's also based on unqcc (as are most all decompilers) there may be certain cases that aren't accounted for (unqcc is a real disaster).
Here's the output (when trying to decompile a scrambled progs.dat)
Code: Select all
Decompiling...
Read Data from progs.dat:
Total Size is 644552
Version Code is 6
CRC is 5927
113612 strofs
39157 numstatements
2118 numfunctions
5872 numglobaldefs
241 numfielddefs
23118 numpr_globals
----------------------
Segmentation fault
Code: Select all
Decompiling...
Read Data from qwprogs.dat:
Total Size is 443368
Version Code is 6
CRC is 54730
69696 strofs
29910 numstatements
763 numfunctions
3902 numglobaldefs
248 numfielddefs
18416 numpr_globals
----------------------
Segmentation fault
FINALLY!
WOW! I've been struggling with trying to decompile progs.dat using various qcc programs for weeks! I think I downloaded every qc compiler known to man just to try and get this done. I want to make some small changes to certain mods, or implement certain aspects of some mods into other ones... *IE KILLER QUAKE PATCH + SUPER DUPER QUAKE WEAPONS! YES!
/me = super n00b
so now just a quick question... decompiling progs.dat from Neil Manke's Starship map, and I get this...
frikdec progs.dat
decompliling...
"" defs.qc
"" subs.qc
fatal error - index (15988) out of bounds.
does this mean that defs.qc and subs.qc are the only .qc files contained within progs.dat? I could live with that. And then...
frikqcc -dec progs.src
defs.qc
subs.qc
subs.qc (123 to 133): warning: Too many closing braces
subs.qc (123 to 133): error: "}" is not a type
./progs.dat - 11 error(s), 11 warning(s)
Should I be worried about these? lol
Basically for the starship maps I want to add a second shotgun weapon, one that will shoot the laser.
thanks!
/me = super n00b
so now just a quick question... decompiling progs.dat from Neil Manke's Starship map, and I get this...
frikdec progs.dat
decompliling...
"" defs.qc
"" subs.qc
fatal error - index (15988) out of bounds.
does this mean that defs.qc and subs.qc are the only .qc files contained within progs.dat? I could live with that. And then...
frikqcc -dec progs.src
defs.qc
subs.qc
subs.qc (123 to 133): warning: Too many closing braces
subs.qc (123 to 133): error: "}" is not a type
./progs.dat - 11 error(s), 11 warning(s)
Should I be worried about these? lol
Basically for the starship maps I want to add a second shotgun weapon, one that will shoot the laser.
thanks!
subs.qc (123 to 133): warning: Too many closing braces
subs.qc (123 to 133): error: "}" is not a type
those messages are more likely to be caused by a mod that was optimised, rather than scrambled.
sadly, scrambled mods are easier to decompile than optimised ones...
certain optimisations can make an utter utter mess.
alternatively, they just used a 'for' statement, which is an easy way to confuse qc decompilers without even using a scrambler or optimisations - generally the decompiler doesn't know what the heck a 'for' statement is, and certainly not what the bytecode looks like.
but if it is just one of these, fix the function, the rest will be fine.
And I've no idea what index out of bounds would be caused by, other than optimisations.
subs.qc (123 to 133): error: "}" is not a type
those messages are more likely to be caused by a mod that was optimised, rather than scrambled.
sadly, scrambled mods are easier to decompile than optimised ones...
certain optimisations can make an utter utter mess.
alternatively, they just used a 'for' statement, which is an easy way to confuse qc decompilers without even using a scrambler or optimisations - generally the decompiler doesn't know what the heck a 'for' statement is, and certainly not what the bytecode looks like.
but if it is just one of these, fix the function, the rest will be fine.
And I've no idea what index out of bounds would be caused by, other than optimisations.
I purposely put this code in my defs.qc to debunk most decompilersFrikaC wrote:I don't know if you've tried frikdec, but it more or less nullifies what SCRAMBLER! does. Then again, because it's also based on unqcc (as are most all decompilers) there may be certain cases that aren't accounted for (unqcc is a real disaster).
Code: Select all
void () decompiler_error =
{
local string dopefish;
dopefish = ("dont smoke fish, drink bud.\n");
};
If you try to decompile CAx (http://www.quakeone.com/cax), it spits out void() decompiler_error as the last line,
Code: Select all
void (entity , entity , entity , float ) T_Damage;
float (entity , entity , string ) CanDamage;
float modelindex_eyes = 0;
float modelindex_player = 0;
void () decompiler_error =
{
local string ;
I suppose the decompiler cant assign a value to a variable intermittently or whatever, but this keeps "little kiddies" from taking a competitive multiplayer mod and hacking it and putting up a skewed server. I dunno, maybe this is outdated. Open source is one thing that keeps the world humble.
If anyone wanting to start up a new multiplayer mod, you should check out this lost treasure www.quakeone.com/qrack/elohim22.zip
The old (Jan. 1998) open source of the Clan Elohim DM server (aka CRMOD) by J.P.Grossman and Paul Baker . (shub hub it ?? i think i have the only version?!!)
Great resource to learn quakeC.