Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    2. GTANet 20th Anniversary

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

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

    1. Red Dead Redemption 2

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

    1. Grand Theft Auto Series

      1. 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. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. 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. 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

      1. Court House
    3. Suggestions

Documenting GTA-SA memory addresses


Recommended Posts

A long time ago, someone had been asking in this topic about the address for the value of the breath meter which shows when you are underwater. PLPynton recently posted the relevant location to an SCM memory-hacking topic so I figured I'd share it here too.

 

0xB7CDE0 -- Breath Meter current value (float) [uS v1.0 exe]

 

The max of the breath meter is approximately 1150.0 + (1.5 * lung_capacity_stat) although the exact value might be stored somewhere.

Link to post
Share on other sites

7230CC - Rendertarget Height (mirrors, mod shops- when GFX Detail is set above "Low") - Default 512

7230D1 - Rendertarget Width (mirrors, mod shops- when GFX Detail is set above "Low") - Default 1024

 

7230EA - Unknown rendertarget, height 512

7230EF - Unknown rendertarget, width 1024

 

723121 - Rendertarget Height (mirrors, mod shops - when GFX Detail is set TO "Low") , height 256

723126 - Rendertarget Width (mirrors, mod shops - when GFX Detail is set TO "Low") , width 512

 

723133 - Unknown rendertarget, height 256

723138 - Unknown rendertarget, width 512

 

The following values correspond to license plate text rendering sizes, and are located within one of the functions that control license plate rendering, but have no effect if changed ingame, and crash the game if altered from the main menu, before the game is initially loaded:

 

6FDED3 - license plate text, image height, 16

6FDED5 - license plate text, image width, 64

 

All image dimensions in this post are in decimal

Link to post
Share on other sites

Does anybody know where the wind comes from and how much of it is applied? it is impossible to be steady inside a helicopter, it continously pulls you to noerheast.

 

Link to post
Share on other sites
  • 1 month later...

* 0x8D44F8 - Start of Traintype models block (corresponds SCM opcode 06D8).

 

There are 16 blocks, each one has its own set of models (up to 16) for the particular train type.

 

Block addresses:

 

0x8D44F8 type 00x8D4538 type 10x8D4578 type 20x8D45B8 type 30x8D45F8 type 40x8D4638 type 50x8D4678 type 60x8D46B8 type 70x8D46F8 type 80x8D4738 type 90x8D4778 type 100x8D47B8 type 110x8D47F8 type 120x8D4838 type 130x8D4878 type 140x8D48B8 type 15

 

 

 

Each block contains:

+0 [DWord] = train model

+4 to +3C [All DWords] = carriage model

 

Changing of these entries allows to create the trains with the number of carriages up to 15 (and seems even more than 15).

More insteresting is that these values could be changed via SCM in runtime wink.gif

 

Link to post
Share on other sites

 

Is there any way to run SA at a custom res.? Such as 300x300 or even as low as 150x150(Palm Low Res)

Don't know if this is what you're looking for, but if you want to run the game at lower than 640x480, here's one way to do it.

 

Static pointer at 0xC97C48 points to block of game resolution and video card details eg.

 

+0x00 desktop width+0x04 desktop height+0x08 desktop resolution+0x14  minimum width allowed(640)+0x18  minimum height allowed(480)..there then follows the list of resolutions supported by your card, starting at 0x284 bytes width4 bytes height4 bytes supported resolution4 bytes unknown4 bytes unknown

 

Before you begin you must have your saved game resolution set to anything except 640x480x16. Start up SA and change the values at +0x14 and +0x18 to the resolution of your choice, say 320x240. How you do this is up to you (in-process dll, TSearch, etc). Then once that's done go to the graphic options menu and change the resolution to 640x480x16. You should now be able to enjoy a heavily pixellated, retro game experience.

 

Full screen 320x240

user posted image

 

A little trickier to achieve, windowed at 320x200

user posted image

Edited by Cowpat
Link to post
Share on other sites

Wow Cowpat, that is really handy. A tool that wold allow you to set the variables for the screen size would be awesome. Maybe I could writing something to do that, although it would be my first program in C++ since last year. I'm a little rusty.

 

Also Cowpat, are you using VC++ .NET 2003? If not what version?

Link to post
Share on other sites
Wow Cowpat, that is really handy. A tool that wold allow you to set the variables for the screen size would be awesome. Maybe I could writing something to do that, although it would be my first program in C++ since last year. I'm a little rusty.

 

Also Cowpat, are you using VC++ .NET 2003? If not what version?

By the screen shot I can say that its Microsoft Visual C++ 6 off the Visual Studio 98 Suite. Most coders around here (That I have talked to) use it.

Link to post
Share on other sites

dustcrazy: I think with fullscreen you are pretty much stuck with the standard resolutions.

But with windowed mode you can have pretty much any resolution you want.

 

80x50 dialog frame

user posted image

 

16x10 no frame

user posted image

 

I even ran the game in one pixel - I kid ye not - you could move the mouse around and

the pixel would change hue according to what camera was pointing at. Not much use for anything though lol.

 

jarjar: You're welcome to source code if you want. I usually stick to VC 6.0

 

DexX: I'm working my way thru that stuff right now. I tried 0x884940 - diffusetexwrap and

it's quite scary out in the countryside, hardly even looks like the same game.

Link to post
Share on other sites
jarjar: You're welcome to source code if you want. I usually stick to VC 6.0

That would be great thanks smile.gif. I am only just begining to learn this type of thing, so it would be much appreciate. PM me if you don't wish to post it publicly. Thanks mate. smile.gif.

Link to post
Share on other sites

 

That would be great thanks. I am only just begining to learn this type of thing, so it would be much appreciate. PM me if you don't wish to post it publicly.

May as well post a link here so anyone who wants it can get it. I've fixed the problem of graphical corruption at high speeds, as suspected it was due to motion blur.

 

This should compile straight away in VC6, and in anything after with a minimum of fuss.

 

Download

 

P.S. You'll need to have the TexResource.bmp file in the same directory as the dll as it is loaded at runtime.

Link to post
Share on other sites
  • 1 month later...

Hey! Can you help me? I have to load a weapon model, but I don't know the address of this function. I want to put a minigun into the game. I wrote to the memory address, and If i had a minigun before, I can add ammo to it, but if I did not have a minigun before, than an error occurs , so i have to load the weapon model. Just dont know how.. suicidal.gif

Please help me!

Link to post
Share on other sites

This is a list of the function and lib addresses, generated from ida for SA. Of particular interest are the Renderware functions, which are preceded by either "_" or "__", using mixed cases (Rw vs rw). So for example, you should search for "_rw", or "__Rw". Some Renderware functions are also identified by "Rp" and "Rx".

 

http://www.3dhole.com/gtafiles/sa_function_dump.rar

 

Some of the functions i've named myself, most i haven't.

Link to post
Share on other sites

i cant change the resolution... If i go to the adress ( 0xC97C48 ) and add the 14, i can´t view and change the resolution (640x480)

 

I use TSearch...

 

 

btw: can you give me a cheat file (cht) for TSearch? thx then you can get a cookie.gif

Link to post
Share on other sites

not sure if there's no such stuff, but want to share

some info about text_draw.

 

 

TextDrawers Pool = 0x00A913E8;-------------------------------------------   StructSize = 68;    StructsCount = 96;    Total Pool Size = 68*96 = 6528 bytes;-------------------------------------------    TextDrawer struct =   +0   dword     letter width   +4   dword     letter height   +8   byte[4]   letter color RGBA   +0B  byte      unknown_flag               (opcode 0341h)   +0C  byte      text_centered flag   +0D  byte      text_in_box flag   align   +10  dword     linewidth   +14  dword     unknown (lineheight?)      (opcode 0344h)   +18  dword     background box color RGBA   +1C  byte      text_proportional flag   +1D  byte[4]   letter background color RGBA   +21  byte      shadow type                (opcode 060Dh)   +22  byte      outline type               (opcode 081Ch)   +23  byte      unknown flag (align left?) (opcode 03E0h)   +24  byte      align right flag           (opcode 034Eh)   align   +28  dword     Font (draw_style)   +2C  dword     XPos   +30  dword     YPos   +34  char[8]   text GxtEntry   +3C  dword     number param #1            (045Ah)   +40  dword     number param #2            (045Bh)   +44  end;-------------------------------------------

 

Link to post
Share on other sites
i cant change the resolution... If i go to the adress ( 0xC97C48 ) and add the 14, i can´t view and change the resolution (640x480)

 

I use TSearch...

 

 

btw: can you give me a cheat file (cht) for TSearch? thx then you can get a cookie.gif

First, are you using v1.0 of San Andreas?

 

The value at 0xC97C48 is the address of where the block of resolution data will be found. You look up one address to find another. In other words the value at 0xC97C48 "points" to the data. When you have found the data then you add +14 hexadecimal.

 

If you have already tried this and found nothing then it may be you have different executable from me, in which case the address will be at a slightly different position.

 

If you still have problems please PM me.

Link to post
Share on other sites

While we're on the topic of TSearch, can anyone get me a direct link to the download/download site of it? I have been told many times before to search Google for it in tutorials and the like. But not once have I ever been able to find it. So if someone can get me a link it would be much appreciated smile.gif.

 

One other question while I am here, now it's of course possible to read the players X, Y and Z co-ordinated while in-game using memory hacking. I wanted to know, is it also possible to get the player rotation/angle too? The X, Y and Z co-ordinates are a major need when SCM coding for example, but without being able to read rotation/angle too it makes it very difficult. If you objects just gonna be facing North, South, East or West then your fine, but anything between there and some guess work has to come into it.

Link to post
Share on other sites

 

While we're on the topic of TSearch, can anyone get me a direct link to the download/download site of it? I have been told many times before to search Google for it in tutorials and the like. But not once have I ever been able to find it. So if someone can get me a link it would be much appreciated smile.gif.

There is a page about TSearch on wikipedia, with a download link. Seems to be the right one.

 

http://www.mpgh.net/downloads/tools/tsearch_16.rar

 

 

For your second question, you can read out anything the games saves in memory, so is the rotation. I'm sure the offsets are mentioned somewhere in this topic.

 

This could help: http://www.gtamodding.com/index.php?title=...%29#Pedestrians

Edited by Squiddy
Link to post
Share on other sites
While we're on the topic of TSearch, can anyone get me a direct link to the download/download site of it? I have been told many times before to search Google for it in tutorials and the like. But not once have I ever been able to find it. So if someone can get me a link it would be much appreciated smile.gif.

There is a page about TSearch on wikipedia, with a download link. Seems to be the right one.

 

http://www.mpgh.net/downloads/tools/tsearch_16.rar

Ah yes, thats exactly what I was looking for, thank you so much mate smile.gif.

 

 

For your second question, you can read out anything the games saves in memory, so is the rotation. I'm sure the offsets are mentioned somewhere in this topic.

 

This could help: http://www.gtamodding.com/index.php?title=...%29#Pedestrians

 

Ah, I see, Cheers' for the link. So this:

 

 

DWORD(CPed+0x14) +0x0 to +0x2C is the rotation matrix

 

 

Is what I am looking for I take it? Thats interesting. I wonder why no co-ordinate grabbing tools support it yet. Odd.

 

Now this is gonna be a huge help to me, I just need to do some more research on how to do memory hacking with either C#, Visual Basic 6 or Delphi and I'll be able to code a tool to do exactly what I need it to do. Any tips on where I can find some helpful information on how to do that?

Link to post
Share on other sites
Is what I am looking for I take it? Thats interesting. I wonder why no co-ordinate grabbing tools support it yet. Odd.

That's the whole matrix, so it should contain all angles in all 3 dimensions. I'm sure there is a single z-angle offset, but it wasn't in the list.

Link to post
Share on other sites
Is what I am looking for I take it? Thats interesting. I wonder why no co-ordinate grabbing tools support it yet. Odd.

That's the whole matrix, so it should contain all angles in all 3 dimensions. I'm sure there is a single z-angle offset, but it wasn't in the list.

Ah yes, I see. Would there be anyway to edit that code to have ti work for just z_angle?

Link to post
Share on other sites

At player block +0x558, dword, (and again at +0x562 for some reason).

 

Value here changes with player angle rather than camera angle. It runs from 0 (North) to -3.14 (South)

and then from +3.14 to 0 at North again. That looks like you could calculate something in radians from it and then convert to degrees if required.

 

Edit: You don't have to calculate radians because the value is in radians (since 180 degrees = 3.14 radians), the only thing that needs to be done is to test whether the value is positive or negative in order to determine which 'half' of the compass the rotation is in.

Edited by Cowpat
Link to post
Share on other sites
  • 4 weeks later...

Although I'm a little late.. just for the sake of completion... another method to retrieve the Z angle is from the rotation matrix...

 

if pMat was the matrix array... i.e.:

 

float *pMat = *(float**)(CPed+0x14);

 

then:

 

float fZAngle = atan2(-pMat[4], pMat[5]);

 

will give you the angle in radians... multiply by 180.0 / PI to get it in degrees... to normalize it to [0, 360), do something like:

 

while(fZAngle < 0.0f) fZAngle += 360.0f;

while(fZAngle >= 360.0f) fZAngle -= 360.0f;

 

This should work for any entity (vehicles, objects, etc).. not just peds.

Link to post
Share on other sites
  • 3 weeks later...

Not sure if this has been posted or not...

 

CVehicle+1445 [byte] Car Tire (Left-Front) Status: 1:Flat, 0:OK, 2:Used by planes when landing gear is up

CVehicle+1446 [byte] Car Tire (Left-Rear) Status: 1:Flat, 0:OK, 2:Used by planes when landing gear is up

CVehicle+1447 [byte] Car Tire (Right-Front) Status: 1:Flat, 0:OK, 2:Used by planes when landing gear is up

CVehicle+1448 [byte] Car Tire (Right-Rear) Status: 1:Flat, 0:OK, 2:Used by planes when landing gear is up

CVehicle+1628 [byte] Bike Tire (Front) Status: 1:Flat, 0:OK

CVehicle+1629 [byte] Bike Tire (Rear) Status: 1:Flat, 0:OK

 

When the player is in a car, the bike tire addresses contain different values.

When the player is on a bike, the car tires contain different values.

Link to post
Share on other sites
  • 1 month later...

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
  • 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.