B-$hep SCR decompiler
Posted: 04 Jan 2010, 17:34
Hi guys.
I have a plan to make a SCR decompiler.
First at least some simple one that decompiles very basic scripts.
Primary thing i must figure out is that how variables are saved in SCR, probabaly every variable has been converted to pointer that points to some table item which holds all data in script. From where GTA2 reads the data.
Of course i haven't deeply looked at this part but it seems so. Something like that.
For example:
PLAYER_PED dummy = (112.7, 5.7, 5.7) 1 180
Where has that "dummy" gone in SCR ?!! Where is PLAYER_PED?! And such stuff that must be figured out.
If SCR would use simple tokens for each command then it would be pretty easy to make a decompiler. But probably it has tokens but as i said i haven't figured out this yet really.
What i need: for example how LEVELSTART, LEVELEND is saved.
If you skip any of these then MIS compiler will crash. So this is one problem, just to tell you.
But because if had so much luck with SCR files already, im sure i can figure out something.
The best thing about them that they are small, only 80,7KB. Of course alot of data is packed but still they contain alot of empty space also. Depends on scr.
I have a plan to make a SCR decompiler.
First at least some simple one that decompiles very basic scripts.
Primary thing i must figure out is that how variables are saved in SCR, probabaly every variable has been converted to pointer that points to some table item which holds all data in script. From where GTA2 reads the data.
Of course i haven't deeply looked at this part but it seems so. Something like that.
For example:
PLAYER_PED dummy = (112.7, 5.7, 5.7) 1 180
Where has that "dummy" gone in SCR ?!! Where is PLAYER_PED?! And such stuff that must be figured out.
If SCR would use simple tokens for each command then it would be pretty easy to make a decompiler. But probably it has tokens but as i said i haven't figured out this yet really.
What i need: for example how LEVELSTART, LEVELEND is saved.
If you skip any of these then MIS compiler will crash. So this is one problem, just to tell you.
But because if had so much luck with SCR files already, im sure i can figure out something.
The best thing about them that they are small, only 80,7KB. Of course alot of data is packed but still they contain alot of empty space also. Depends on scr.