Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Memory coding


TheGodfather.
 Share

Recommended Posts

TheGodfather.

Hi, Everyone...

I need to know about memory coding I saw ZAZ tutorial but it wasn't too much helpful.. confused.gif

Can someone tell me about it (how to use mem codes in CLEO)?? Or atleast provide a link for tutorial related to mem coding ?? dozingoff.gif

 

Please guys I am waiting for your replies.. sarcasm.gif

Link to comment
Share on other sites

Hi ,

 

Memory coding is like the mother cell from were opcodes and scripts are generated ( daughter cells)

 

First , i didn't understand sh*t from what people were saying in the forums( Dword CPed , 0x4qs5d4.... , ) and all that stuff , but i managed somehow to understand it a bit by myself , so here is the parts that i understood :

 

. Opcodes are memory addresses , in fact the whole GTA SA is based on memory addresses , Opcodes were made to simplify things , like instead of writing a whole (read memory [email protected] write 0xdq145 .... size ..value ..) u simply write the opcode ( 0az1:show_hud )

 

 

.If you check out this wiki page , u can find some memory addresses , and when i say some i mean like 1% of the whole memory addresses that exists in GTA , about 215.432.564 memory address ...

 

.Lets try one of those , for exemple i picked this :

__________________________

0xB70153 - [byte] Current Hour

__________________________

 

Ok , as you can see this memory address is about the actual hour ingame , so , you either get (read) its value , or give (write) it a value . So when we want to get some ingame stats ( What is the actual Hour , Fat stat , Stamina , Health , Armour , .... ) we read memories , and when we want to edit stats ( I want the actual hour to be 08 am ...) we write memories .

 

So you either :

 

0A8D: [email protected] = read_memory 0xB70153 size 1 virtual_protect 0

 

or

 

0A8C: write_memory 0xB70153 size 1 value 8 virtual_protect 0

 

 

Now for the part that im not sure about , and im too lazy (or stupid) to figure it out , its the Size , i "think" that it refers to the nature of the memory (0xB70153 - [byte] Current Hour) I think that size 1 : Byte , size 2 : Dword , size 4 : Float , im not sure ...

 

 

 

____________________________________________

 

 

 

 

As you can notice by going throu' the wiki page , there are some lines that say ( CPed +0x568 ...)

 

Well , i dont know about them , but i figured out how to get them work ... :

 

Here is a script that i made for it :

 

:Memo

wait 400

0A96: [email protected] = actor $PLAYER_ACTOR struct

0A8E: $status = [email protected] + 0x4DF // int

0A8D: $status = read_memory $status size 1 virtual_protect 0

03C4: set_status_text $status type 0 GXT 'ZER2_43' // global_variable // Score ~1~

059C: enable_status_text $status flashing 0 // global_variable

jump @Memo

 

 

 

In the wiki:

 

CPed +0x4DF = Current anim play-state:

0 = nothing

61 = starting/stopping

62 = looping

 

 

this memory address functions like this :

 

First , we get CJ's structure with ; 0A96: [email protected] = actor $PLAYER_ACTOR struct , its the CPed .

 

Then we add the thing that we want to this struct CPed , in the exemple i added 0x4DF ; 0A8E: $status = [email protected] + 0x4DF // int

 

Finally to see the result i add a status text ; 03C4: set_status_text $status type 0 GXT 'ZER2_43' // global_variable // Score ~1~

059C: enable_status_text $status flashing 0 // global_variable .

 

 

 

 

 

Hope you like this biggrin.gif , i know , im kinda hazardous bored.gif ...

Link to comment
Share on other sites

 

Memory coding is like the mother cell from were opcodes and scripts are generated ( daughter cells)

Opcodes aren't memory addresses.

 

@arijitsen

All applications use memory. A memory address points to a specific point in the memory of an application. The size is how much memory the pointer points to. BYTE = 1, WORD = 2 and DWORD = 4.

 

 

CPed +0x4DF = Current anim play-state:0 = nothing61 = starting/stopping62 = looping 

 

In this case, CPed is the address of the actor struct. So you need to get that first. If you add 0x4DF to that address, it points to the region where the current anim play-state is stored. Now you have the pointer to that address. The only thing you have to do is read it.

Link to comment
Share on other sites

TheGodfather.

@fable - Which wiki are you talking about ??

 

As you can notice by going throu' the wiki page , there are some lines that say ( CPed +0x568 ...)

Anyways I am getting to undertand a bit by bit but suppose I want to make a script by which when I press TAB it gives me weapon set 1 So what we are going to use

read memory 0x969130 ...or write memory ??

 

What this two opcodes do ???What's the diff. bet. them..Can you give me an ex. of a mem. coding script.???

I am a good modder but memmory coding is my weak point.. confused.gif

Hmm..I sound kinda funky to you huh?? confused.giflol.gif

Link to comment
Share on other sites

This wiki :

http://www.gtamodding.com/index.php?title=...resses_%28SA%29

 

Ok , so you want to use Weapon Set 1 :

 

Cheats:

 

[byte] Can be either on (1) or off (0).

 

. 0x969130 - Weapon Set 1

. 0x969131 - Weapon Set 2

. 0x969132 - Weapon Set 3

....

 

 

First, as Bad.boy! mentioned , you need to know first the value that this memory address can handle , for this one , its a [byte] , so it can either be 1 or 0 ( 1:True , 0:False)

 

-------------------------Writing memory--------------------------

Now if you want to add this weapon set to the game , you just have to :

 

0A8C: write_memory 0x969130 size 1 value 1 virtual_protect 0

 

Now the cheat is activated , and you shall have the weapon set , if you want to desactivate it , then :

 

0A8C: write_memory 0x969130 size 1 value 0 virtual_protect 0

 

-------------------------Reading memory--------------------------

 

Lets say you cant remember if you've already activated the cheat , you need to know if the cheat is activated or not , here is when we use read_memory :

 

0A8D: [email protected] = read_memory 0x969130 size 1 virtual_protect 0

 

So , [email protected] is the answer from the game :

 

[email protected] == 1 : Cheat is activated

[email protected] == 0 : Cheat is desactivated

 

 

Link to comment
Share on other sites

TheGodfather.

Thanks a lot now you got my point & now I not only understood but also my script runs..I mean works thanks a lot... biggrin.gif

 

I needed to know this for a long time ..Thanks inlove.gif

Have some cookies both of you cookie.gifcookie.giflol.gif

Link to comment
Share on other sites

 

First, as Bad.boy! mentioned , you need to know first the value that this memory address can handle , for this one , its a [byte] , so it can either be 1 or 0 ( 1:True , 0:False)

A byte can be also be a small number. It can range from 0 to 255 or -128 to 127. But in this case it is indeed a boolean.

Link to comment
Share on other sites

TheGodfather.

Bad.boy - So is byte dependent on certain cases ?? How will I come to know when it will be no. & when it will be boolean ??

Also while going through the mem addresses I found :

 

0xA49F04 - [dword] Helena Progress 

 

So what this DWORD stands for ??

Link to comment
Share on other sites

That's the relationship progress for Helena, one of the girlfriends. It's a number between 0-100, representing your current relationship with her.

user posted image
Link to comment
Share on other sites

BOOL is a value that can be 1 (true) or 0 (false), Well, if you insert another value that's not 0 we can consider that the value is true, it is normally implemented as a BYTE.

BYTE is a value with 1 byte in size (as the name tell). Depending if the value is signed or unsigned the value can be in the range 0~255 or -128~127

WORD is a value with 2 bytes in size. The value can be -32768~32767 if signed or 0~65535 if unsigned.

DWORD is a D(ouble)WORD, that means that the size is 4. The value can be -2147483648~2147483647 if signed or 0~4294967295 if unsigned.

There's more, but they don't have a point at all in gta modding.

 

By the way, what about that PM? You couldn't understand?

Link to comment
Share on other sites

It is advisable to not confuse such types with Microsoft's typedefs which are unsigned unequivocally. On the other hand, here is the comparison between ASM and the most used ANSI types.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

TheGodfather.

Thanks guys..I needed to know that... alien.gif

@Link2012- I understood what you told me but got kinda confused with that read & write memory..Also I tried to write some

mem. code scripts but they didn't worked but now it's Ok... colgate.gif

 

Link to comment
Share on other sites

TheGodfather.

Thanks ...I think I should ask all my memory coding related problems here..If you guys don't have any problem...

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.