fastman92 Posted February 10, 2012 Share Posted February 10, 2012 (edited) For GTA VC: :TestCheatString{Description: Compares typed string against passed stringType: IFParameters: Passed: [email protected] - 1th part of cheat string [email protected] - 2nd optional part of cheat sting [email protected] - 3th optional part of cheat string [email protected] - 4th optional part of cheat string ([email protected] together) Result: none Returns true or false.Example: if 05F5: call_scm_func @TestCheatString 2 STRING 0x454D4954 0x435943 // TIMECYC }{ ///////////////[email protected] - cheat string to [email protected] - copied cheat string [email protected] - static adress of [email protected] - ending of merged _cheatString: _cheatString + strlen([email protected]) - 1 [email protected] - adress of _gtaStrlen / read character from [email protected] - adress of [email protected], increased dynamically \\\\\\\\\\\\\\\}[email protected] = 0xA10942 // _cheatString05EC: [email protected] = current_thread_pointer0085: [email protected] = [email protected] // integer values and [email protected] += 64 // [email protected] [email protected] += 48 // [email protected] pointer0085: [email protected] = [email protected] // integer values and handles0085: [email protected] = [email protected] // integer values and handles 05E2: call_function 0x00642540 num_params 1 pop 1 get_string [email protected] length_to [email protected]: [email protected] += [email protected] // (int)[email protected] -= 1 while 002D: [email protected] >= [email protected] // (int) 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 05DF: write_memory [email protected] size 1 value [email protected] virtual_protect 0 [email protected] -= 1 [email protected] += 1 end 05DF: write_memory [email protected] size 1 value 0x00 virtual_protect 0 // NULL termination05E2: call_function 0x00642620 _strcmp num_params 2 pop 2 STRING2 [email protected] STRING1 [email protected] RESULT_TO [email protected] [email protected] == falseelse_jump @TestCheatString_return_false 05DF: write_memory [email protected] size 1 value 0x00 virtual_protect false // NULL termination return_true05F6: ret 0 :TestCheatString_return_falsereturn_false05F6: ret 0 Works with: gta-vc.exe, 2,94 MB (3 088 896 bytes) Remember there are no string variables in GTA VC. You can`t put [email protected] or [email protected] = "CHEAT" and pass it to function. It will be compiled mistakenly by SB, there`s no such opcode to handle string type of variables. You must write integers instead of strings. For GTA SA find it within In-game Timecyc Editor source. It uses many dependencies. Edited February 10, 2012 by fastman92 Link to comment Share on other sites More sharing options...
Swoorup Posted February 11, 2012 Share Posted February 11, 2012 (edited) All of your findings should be pinned. Fastman92 you should set up a site or something and put up all your works. I hate it when it takes too much of my time going through the forums looking for something useful. Most of the modding section topics contains bulk, unwanted posts Edited February 11, 2012 by Swoorup Link to comment Share on other sites More sharing options...
spaceeinstein Posted February 11, 2012 Share Posted February 11, 2012 That's what the wiki is for. Link to comment Share on other sites More sharing options...
DK22Pac Posted February 11, 2012 Share Posted February 11, 2012 Ive made someth when I worked on MagicSpawner for GTA3. {$CLEO}{$I scmfuncs.txt}05E5: [email protected] = game_versionwhile true wait 0 if player.Defined($PLAYER_CHAR) then for [email protected] = 90 to 150 05F5: call_scm_func @getCarModelName 1 model [email protected] get_string_offset_to [email protected] 05F5: call_scm_func @getStringNumChars 2 string_offset [email protected] include_null_terminator 0 get_num_chars_to [email protected] if [email protected] <> 0 then 05F5: call_scm_func @testCheat 2 string_offset [email protected] num_chars [email protected] get_result_to [email protected] if [email protected] == 1 then 0054: store_player $PLAYER_CHAR position_to [email protected] [email protected] [email protected] 02C1: set [email protected] [email protected] [email protected] to_car_path_coords_closest_to [email protected] [email protected] [email protected] 05F5: call_scm_func @getDistanceBetweenPoints 6 XYZ [email protected] [email protected] [email protected] and_XYZ [email protected] [email protected] [email protected] to [email protected] if [email protected] > 15.0 then 05F5: call_scm_func @getCoordsFromActor 4 actor $PLAYER_ACTOR offset 0.0 3.0 0.0 store_to [email protected] [email protected] [email protected] end 05F5: call_scm_func @spawnCar 4 model [email protected] XYZ [email protected] [email protected] [email protected] [email protected] *= 2 if [email protected] == 0 then [email protected] += 0x95CCB6 [email protected] = 0x95CCB6 [email protected] = 0x5051E0 else [email protected] += 0x95CE6E [email protected] = 0x95CE6E [email protected] = 0x5052C0 end 0085: [email protected] = [email protected] 0085: [email protected] = [email protected] for [email protected] = 0 to 19 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 05DF: write_memory [email protected] size 2 value [email protected] virtual_protect 0 inc([email protected]) [email protected] += 2 end 05DF: write_memory [email protected] size 2 value 0x20 virtual_protect 0 // [email protected] += 2 05DF: write_memory [email protected] size 2 value 0x73 virtual_protect 0 // s [email protected] += 2 05DF: write_memory [email protected] size 2 value 0x70 virtual_protect 0 // p [email protected] += 2 05DF: write_memory [email protected] size 2 value 0x61 virtual_protect 0 // a [email protected] += 2 05DF: write_memory [email protected] size 2 value 0x77 virtual_protect 0 // w [email protected] += 2 05DF: write_memory [email protected] size 2 value 0x6E virtual_protect 0 // n [email protected] += 2 05DF: write_memory [email protected] size 2 value 0x65 virtual_protect 0 // e [email protected] += 2 05DF: write_memory [email protected] size 2 value 0x64 virtual_protect 0 // d 05E1: call [email protected] num_params 2 pop 2 0 [email protected] end end end endend //-----------------------------------------------------------------------------------{eNums bodyparts}const SLOWERLEGL = 0 SMID = 1 SHEAD = 2 SUPPERARML = 3 SUPPERARMR = 4 SLHAND = 5 SRHAND = 6 SUPPERLEGL = 7 SUPPERLEGR = 8 SFOOTL = 9 SFOOTR = 10 SLOWERLEGR = 11 var_0 = [email protected] var_1 = [email protected] var_2 = [email protected] var_3 = [email protected] var_4 = [email protected] var_5 = [email protected] var_6 = [email protected] var_7 = [email protected] var_8 = [email protected] var_9 = [email protected] var_10 = [email protected] var_11 = [email protected] var_12 = [email protected] var_13 = [email protected] var_14 = [email protected] var_15 = [email protected] timer1 = [email protected] timer2 = [email protected] endgoto @end//-----------------------------------------------------------------------------------:getCoordsFromActor{05F5: call_scm_func @getCoordsFromActor 4 actor $PLAYER_ACTOR offset 0.0 2.0 0.0 store_to [email protected] [email protected] [email protected]}05E6: [email protected] = actor [email protected] [email protected] += 405E5: [email protected] = game_version05EC: [email protected] = [email protected] += 0x34if [email protected] == 0then 05E1: call 0x5A37D0 num_params 4 pop 4 [email protected] 1 [email protected] [email protected] 05E1: call 0x5A3A90 num_params 4 pop 4 [email protected] 1 [email protected] [email protected]: ret 3 [email protected] [email protected] [email protected]//-----------------------------------------------------------------------------------:getCoordsFromCar{05F5: call_scm_func @getCoordsFromCar 4 car [email protected] offset 0.0 2.0 0.0 store_to [email protected] [email protected] [email protected]}05E7: [email protected] = car [email protected] [email protected] += 405E5: [email protected] = game_version05EC: [email protected] = [email protected] += 0x34if [email protected] == 0then 05E1: call 0x5A37D0 num_params 4 pop 4 [email protected] 1 [email protected] [email protected] 05E1: call 0x5A3A90 num_params 4 pop 4 [email protected] 1 [email protected] [email protected]: ret 3 [email protected] [email protected] [email protected]//-----------------------------------------------------------------------------------:getCoordsFromObject{05F5: call_scm_func @getCoordsFromObject 4 object [email protected] offset 0.0 2.0 0.0 store_to [email protected] [email protected] [email protected]}05E8: [email protected] = object [email protected] [email protected] += 405E5: [email protected] = game_version05EC: [email protected] = [email protected] += 0x34if [email protected] == 0then 05E1: call 0x5A37D0 num_params 4 pop 4 [email protected] 1 [email protected] [email protected] 05E1: call 0x5A3A90 num_params 4 pop 4 [email protected] 1 [email protected] [email protected]: ret 3 [email protected] [email protected] [email protected]//-----------------------------------------------------------------------------------:getLocalVarOffset{05F5: call_scm_func @getLocalVarOffset 1 var 0 store_to [email protected]}05EC: [email protected] = [email protected] *= [email protected] += 0x30005A: [email protected] += [email protected]: ret 1 [email protected]//-----------------------------------------------------------------------------------:getActorBodypartPosition{05F5: call_scm_func @getActorBodypartPosition 2 actor $PLAYER_ACTOR bodypart SUPPERARML store_to [email protected] [email protected] [email protected]}05E6: [email protected] = actor [email protected] [email protected] += [email protected] *= 4005A: [email protected] += [email protected]: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 0x1005E0: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 0x8005E0: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 405E0: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 405E0: [email protected] = read_memory [email protected] size 4 virtual_protect 005F6: ret 3 [email protected] [email protected] [email protected]//-----------------------------------------------------------------------------------:ActorRemoveBodypart{05F5: call_scm_func @ActorRemoveBodypart 2 actor $PLAYER_ACTOR bodypart SUPPERARML}05E6: [email protected] = actor [email protected] struct05E5: [email protected] = game_versionif [email protected] == 0then 05E3: call_method 0x4EAEE0 struct [email protected] num_params 2 pop 0 0 [email protected] 05E3: call_method 0x4EAF90 struct [email protected] num_params 2 pop 0 0 [email protected]: ret 0//-----------------------------------------------------------------------------------:spawnCar{05F5: call_scm_func @spawnCar 4 model [email protected] XYZ [email protected] [email protected] [email protected]}model.Load([email protected])038B: load_requested_models car.Create([email protected], [email protected], [email protected], [email protected], [email protected])model.Destroy([email protected])car.RemoveReferences([email protected])05F6: ret 0//-----------------------------------------------------------------------------------:showTextBox{05F5: call_scm_func @showTextBox 1 string_offset [email protected]}05E5: [email protected] = game_versionif [email protected] == 0then [email protected] = 0x95CCB6 [email protected] = 0x5051E0else [email protected] = 0x95CE6E [email protected] = 0x5052C0endfor [email protected] = 0 to 19 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 05DF: write_memory [email protected] size 2 value [email protected] virtual_protect 0 inc([email protected]) [email protected] += 2end05E1: call [email protected] num_params 2 pop 2 0 [email protected]: ret 0//-----------------------------------------------------------------------------------:getDistanceBetweenPoints{05F5: call_scm_func @getDistanceBetweenPoints XYZ [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] to [email protected]} 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0063: [email protected] -= [email protected] 0063: [email protected] -= [email protected] 0063: [email protected] -= [email protected] 006B: [email protected] *= [email protected] 006B: [email protected] *= [email protected] 006B: [email protected] *= [email protected] 005B: [email protected] += [email protected] 005B: [email protected] += [email protected] 01FB: [email protected] = square_root [email protected] if [email protected] < 0.0 then 0097: absf [email protected] end05F6: ret 1 [email protected] //-----------------------------------------------------------------------------------:getCarModelName{05F5: call_scm_func @getCarModelName 1 model 90 get_string_offset_to [email protected]}[email protected] *= [email protected] += 0x83D40805E0: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 0x405F6: ret 1 [email protected]//-----------------------------------------------------------------------------------:getStringNumChars{05F5: call_scm_func @getStringNumChars 2 string_offset [email protected] include_null_terminator 1 get_num_chars_to [email protected]}for [email protected] = 0 to 99 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 if [email protected] == 0 then if [email protected] == 1 then inc([email protected]) end 05F6: ret 1 [email protected] end inc([email protected])end05F6: ret 1 0//-----------------------------------------------------------------------------------:stringReverse{05F5: call_scm_func @stringReverse 4 string_offset 0x885B90 num_chars [email protected] store_to 0x5F7650 skip_null_terminator 1}if [email protected] == 0then [email protected] -= 2else dec([email protected])end005A: [email protected] += [email protected]: [email protected] = [email protected] [email protected] = 0 to [email protected] 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 05DF: write_memory [email protected] size 1 value [email protected] virtual_protect 0 dec([email protected]) inc([email protected])endinc([email protected])05DF: write_memory [email protected] size 1 value 0 virtual_protect 005F6: 0//-----------------------------------------------------------------------------------:testCheat{05F5: call_scm_func @testCheat 2 string_offset [email protected] num_chars [email protected] get_result_to [email protected]}05E5: [email protected] = game_versionif [email protected] == 0then 05F5: call_scm_func @stringReverse 4 string_offset 0x885B90 num_chars [email protected] store_to 0x5F7650 skip_null_terminator 1 05E2: call_function 0x5A08B0 num_params 2 pop 2 [email protected] 0x5F7650 [email protected] 05F5: call_scm_func @stringReverse 4 string_offset 0x885B40 num_chars [email protected] store_to 0x5F7438 skip_null_terminator 1 05E2: call_function 0x5A0B70 num_params 2 pop 2 [email protected] 0x5F7438 [email protected] if [email protected] == 0then if [email protected] == 0 then 05DF: write_memory 0x885B90 size 1 value 0 virtual_protect 0 else 05DF: write_memory 0x885B40 size 1 value 0 virtual_protect 0 end 05F6: ret 1 1else 05F6: ret 1 0end:end Link to comment Share on other sites More sharing options...
ThePrince Posted June 29, 2012 Share Posted June 29, 2012 I'm not good in Coding, but i want to change VC Cheat codes, Let say for Exemple: i want to change ASPIRINE to ASPRO. how do i write the Cheat String ? Link to comment Share on other sites More sharing options...
fastman92 Posted July 5, 2012 Author Share Posted July 5, 2012 (edited) I'm not good in Coding, but i want to change VC Cheat codes, Let say for Exemple: i want to change ASPIRINE to ASPRO. how do i write the Cheat String ? Replacing standard cheats is bit tricky for newbies. I described it here: http://www.gtaforums.com/index.php?showtop...st&p=1060723183 006D8624 ASPIRINE db 'HSPSVkVH',0 Encrypted ASPIRINE becomes HSPSVkVH and I shared function to decrypt and encrypt strings using GTA VC cheat algorithm. Encrypted ASPRO becomes RWWTN To replace cheat string we need to write into memory address of that cheat. The code will work assuming that your gta_vc.exe has 3 088 896 bytes. {$CLEO}// Author: fastman92// Description: ASPIRINE cheat code is replaced into ASPRO code05DF: write_memory 0x6D8624 size 4 value 0x54575752 virtual_protect false // "RWWT"05DF: write_memory 0x6D8628 size 2 value 0x004E virtual_protect false // "N" and NULL05DC: end_custom_thread Must be compiled as CLEO script. You can cheat strings if you happen to know the details of simple GTA VC IDB reengineering till the plugin to change the cheat strings comes out. ------------------------------- Today i created a very useful SCM function GetBaseIP for GTA VC. It gets memory address to beginning of script content. The code will work assuming that your gta_vc.exe has 3 088 896 bytes. {$CLEO}05F5: call_scm_func @GetBaseIP 0 store_to [email protected]// you can do// [email protected] -= @label// to get memory address to @label while true wait 0 01E5: show_text_1number_highpriority GXT 'NUMBER' number [email protected] time 5000 flag 1 // See the address of script content in decimal format end05DC: end_custom_thread:GetBaseIP// Example: 05F5: call_scm_func @GetBaseIP 0 store_to [email protected]: [email protected] = [email protected] += 0x1005E0: [email protected] = read_memory [email protected] size 4 virtual_protect false:[email protected] += 0x821280 // [email protected] += 3 // size of (03 00 00, [email protected] = )[email protected] += @GetBasePastTheReadMemory05F6: ret 1 [email protected] Edited July 5, 2012 by fastman92 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