gtaloconbest98 Posted August 9, 2014 Share Posted August 9, 2014 As you know,the CLEO port of those games has no read/write file opcode.So communication between script is impossible unless the local variable was passed.Even then there is no way the variable can 'survive' when the game shuts downIII and VC only supports 8 byte strings so this must be a pain.I guess if there were some opcodes,it would be change default directory 0 // 0 for game root,1 for user fileload file in directory 'TEMP' filename 'NAME' with extension 'EXT' as [email protected]file [email protected] loadedread file [email protected] offset 0x21 size 1 store to [email protected]write file [email protected] offset 0x21 size 1 with value 0x93release file [email protected] from memory Is there anyway to achieve this via scm coding ? Link to comment Share on other sites More sharing options...
DK22Pac Posted August 9, 2014 Share Posted August 9, 2014 (edited) 05E1-05E2 opcodes, fopen/fclose/fseek/fwrite. Here's a quick example for GTA3 1.0 {$CLEO}// get offset to @filename into [email protected]: [email protected] = [email protected] += 0x9805E0: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] -= @filename//05E2: call_function 0x479120 num_params 1 pop 1 _filename [email protected] _retfile_to [email protected] // open file05E1: call 0x5AC490 num_params 3 pop 3 _origin 0 _offset 0x21 _file [email protected] // file [email protected] = 0x93// get [email protected] offset to [email protected]: [email protected] = [email protected] += 0x34//05E1: call 0x5AC000 num_params 4 pop 4 _file [email protected] _size 1 _count 1 _data [email protected] // write into file05E1: call 0x5AB990 num_params 1 pop 1 _file [email protected] // close file05DC: end_custom_thread:filenamehex "test.txt" 00end Edited August 9, 2014 by _DK Link to comment Share on other sites More sharing options...
gtaloconbest98 Posted August 10, 2014 Author Share Posted August 10, 2014 That's really helpful but I have to look for the address that hold the function,check for its param,then use 05f1-05f2 to call it.My C programming skill isn't good enough for reverse-enginner work yet.The whole point of this thread was to ask someone who can add those opcodes,thus save me the trouble.But I guess I was being lazy. Anyways,thank for the help.I really appreciate it Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now