Coding

 Reply to this postStart new topic

making new opcode

JuarezPL
post Feb 1 2012, 07:21 PM
Post #1


The New Guy!

Posts: 11
Joined: 27-January 12



Hi guys.
How I can create new opcode without cleo 4 functions?
Go to the top of the page
 
+Quote Post
Deji
post Feb 1 2012, 07:39 PM
Post #2


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Learn ASM and, optionally C++ or another programming language and learn to use IDA (The Interactive Dissasembler) to see how R* did it.


--------------------
Go to the top of the page
 
+Quote Post
fastman92
post Feb 1 2012, 09:19 PM
Post #3


Trained Member

Posts: 77
Joined: 25-October 10



Download In-game Timecyc Editor or my Car spawner 2.1 and see how i created 2 new opcodes.
003D: is_zero 5@
003E: overwrite_camera_state 2
I included original source of these opcodes made as a CLEO script.

This post has been edited by fastman92: Feb 1 2012, 09:25 PM
Go to the top of the page
 
+Quote Post
JuarezPL
post Feb 2 2012, 02:40 PM
Post #4


The New Guy!

Posts: 11
Joined: 27-January 12



I need to create opcode Test_Cheat, but I don't know how I can write it in c++ confused.gif
Go to the top of the page
 
+Quote Post
Swoorup
post Feb 2 2012, 04:15 PM
Post #5


The New Guy!

Posts: 8
Joined: 23-January 12



Guys, Correct me if I am wrong.

But should we hook it to ProcessOneCommand function. Anything is necessary other than that?
From what I have understood simply analyzing the binary The function just checks for opcode's ID and passes them to the necessary functions that carry out the opcodes actual function
Go to the top of the page
 
+Quote Post
fastman92
post Feb 2 2012, 04:23 PM
Post #6


Trained Member

Posts: 77
Joined: 25-October 10



SANNY
:TestCheatString
{
Description:
    Compares typed string against passed string
Type: IF

Dependencies:
  - Detect_EXE_version.txt

Parameters:
   Passed:
     0@ - 1th part of cheat string
     1@ - 2nd part of cheat sting
       2@ - 3th optional part of cheat string
       3@ - 4th optional part of cheat string
      
      (0@v together)  
   Result:
     none
       Returns true or false.

Example:
  06D2: 28@v = "TEST" // @v = string                                                                                                    
  0AB1: call_scm_func @TestCheatString 4 STRING 28@ 29@ 30@ 31@
}

{   ///////////////
0@v - cheat string to check
4@v - copied cheat string
8@ - static adress of _cheatString
9@ - ending of merged _cheatString: _cheatString + strlen(0@v) - 1    
10@ - adress of _gtaStrlen / read character from _cheatString
11@ - adress of 4@v, increased dynamically
    \\\\\\\\\\\\\\\
}

8@ = 0x969110

0A9F: 9@ = current_thread_pointer
0A8E: 11@ = 9@ + 76 // int
9@ += 60

0AA7: call_function 0x0069DB50 num_params 1 pop 1 get_string 9@ length_to 9@

005A: 9@ += 8@  // (int)
9@ -= 1

    while 002D:   9@ >= 8@  // (int)
    0A8D: 10@ = read_memory 9@ size 1 virtual_protect 0
    0A8C: write_memory 11@ size 1 value 10@ virtual_protect 0

    9@ -= 1
    11@ += 1
    end
    
0A8C: write_memory 11@ size 1 value 0x00 virtual_protect 0  // NULL termination        

if
08F9:   0@v == 4@v
else_jump @TestCheatString_return_false      
0A8C: write_memory 8@ size 1 value 0x00 virtual_protect false  // NULL termination    
0485: return_true
0AB2: ret 0
    
:TestCheatString_return_false
059A: return_false
0AB2: ret 0


I have it compatible with gta_sa 1.01, but this version which i share here is not.
It`s compatible with CLEO3 and newer.

How to use:
CODE
if
0AB1: call_scm_func @TestCheatString 2 STRING 0x454D4954 0x435943   // TIMECYC


CODE
if
0AB1: call_scm_func @TestCheatString 3 STRING 0x4a554843 0x5a455241 0x0      // CHUJAREZ

Use capital letters.
http://home.paulschou.net/tools/xlate/

This post has been edited by fastman92: Apr 4 2012, 06:51 PM
Go to the top of the page
 
+Quote Post
JuarezPL
post Feb 2 2012, 05:59 PM
Post #7


The New Guy!

Posts: 11
Joined: 27-January 12



QUOTE
CHUJAREZ

O.o

Thanks bro. cool.gif
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members: