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

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Alexander Blade

[V] Script/Native Documentation and Research

Recommended Posts

Fireboyd78

 

 

Here are native addresses for b944 (social club version): http://camx.me/gtav/addresses-b944_2.txt

Why post the addresses when the base is dynamic?

 

http://pastebin.com/WA8c4Zan

 

You need to patch the exe with a hex editor to disable layout randomization. Change offset 0x186 from 0x22 to 0x23.

 

A bit late to responding to this, but I finally figured out what Cam meant. Basically, you want to turn on the "Relocation stripped" flag for the Characteristics of the PE. Steam version offset is 0x17E as of 944.

 

Thank you so much for this tip. I can finally create my own dumps!

Edited by Fireboyd78

Share this post


Link to post
Share on other sites
uNiverselEgacy

I was always wondering why SHV is not written in a way that a direct translation table is generated at startup instead of having to go through 10+ tables (now that we got 10+ updates since 335) every time a native is called? Is it because such optimization has little impact on the overall performance? But I think with scripts that call hundreds if not thousands of natives each frame, such change might make a slightly noticeable difference.

Share this post


Link to post
Share on other sites
unknown modder

I was always wondering why SHV is not written in a way that a direct translation table is generated at startup instead of having to go through 10+ tables (now that we got 10+ updates since 335) every time a native is called? Is it because such optimization has little impact on the overall performance? But I think with scripts that call hundreds if not thousands of natives each frame, such change might make a slightly noticeable difference.

Its not done like that. When you call a native, the hash gets translated to current game version, then it finds the handler for the native and stores it in a map to cache it. Next time you call that native it just retrieves the cached handler. Though It still takes time searching for the cached native. A much nicer solution would be like this

inline static Ped GET_PLAYER_PED(Player player){ static NativeHandler handler(0x43A66C31C68491C0); return handler.invoke<Ped>(player); }

This would make it so that when you call a native for the first time it will still translate and cache the native, but each successive call it doenst need to do any searching at all.

Obviouslt NativeHandler would need to be defined in SHV and do translation in the ctor

Share this post


Link to post
Share on other sites
uNiverselEgacy

 

I was always wondering why SHV is not written in a way that a direct translation table is generated at startup instead of having to go through 10+ tables (now that we got 10+ updates since 335) every time a native is called? Is it because such optimization has little impact on the overall performance? But I think with scripts that call hundreds if not thousands of natives each frame, such change might make a slightly noticeable difference.

Its not done like that. When you call a native, the hash gets translated to current game version, then it finds the handler for the native and stores it in a map to cache it. Next time you call that native it just retrieves the cached handler. Though It still takes time searching for the cached native. A much nicer solution would be like this

inline static Ped GET_PLAYER_PED(Player player){ static NativeHandler handler(0x43A66C31C68491C0); return handler.invoke<Ped>(player); }

This would make it so that when you call a native for the first time it will still translate and cache the native, but each successive call it doenst need to do any searching at all.

Obviouslt NativeHandler would need to be defined in SHV and do translation in the ctor

 

Ah my bad. I disabled or somehow messed up the cache without the knowledge of it existing, and that explains why I was always doing translations.

I like your proposed solution but obviously it requires some nontrivial change to SHV and the natives header file.

Share this post


Link to post
Share on other sites
uNiverselEgacy

0x44CD1F493DB2A0A6 seems to be the native that sets vehicle weapon ammo. I'm surprised it's a new native in 944.

Maybe it's because previous you always get infinite ammo.

Share this post


Link to post
Share on other sites
unknown modder

0x44CD1F493DB2A0A6 seems to be the native that sets vehicle weapon ammo. I'm surprised it's a new native in 944.

Maybe it's because previous you always get infinite ammo.

Its only been added now as its needed to limit the ruiner2 missiles

 

 

I was always wondering why SHV is not written in a way that a direct translation table is generated at startup instead of having to go through 10+ tables (now that we got 10+ updates since 335) every time a native is called? Is it because such optimization has little impact on the overall performance? But I think with scripts that call hundreds if not thousands of natives each frame, such change might make a slightly noticeable difference.

Its not done like that. When you call a native, the hash gets translated to current game version, then it finds the handler for the native and stores it in a map to cache it. Next time you call that native it just retrieves the cached handler. Though It still takes time searching for the cached native. A much nicer solution would be like this

inline static Ped GET_PLAYER_PED(Player player){ static NativeHandler handler(0x43A66C31C68491C0); return handler.invoke<Ped>(player); }

This would make it so that when you call a native for the first time it will still translate and cache the native, but each successive call it doenst need to do any searching at all.

Obviouslt NativeHandler would need to be defined in SHV and do translation in the ctor

 

Ah my bad. I disabled or somehow messed up the cache without the knowledge of it existing, and that explains why I was always doing translations.

I like your proposed solution but obviously it requires some nontrivial change to SHV and the natives header file.

Yeah, While its nice, Its not going to be implemented unfortunately. Though it could easily be added alongside the current method for SHV.

Share this post


Link to post
Share on other sites
Unknown_Modder

Here's another new (build 944) native:

 

static BOOL _DOES_VEHICLE_HAVE_DOOR(Vehicle vehicle, int doorIndex) { return invoke<BOOL>(0x645F4B6E8499F632, vehicle, doorIndex); } // 0x645F4B6E8499F632

VCd2qhO.png

 

Edited by Unknown_Modder

Share this post


Link to post
Share on other sites
qiangqiang101

Can someone change int PATHFIND::GENERATE_DIRECTIONS_TO_COORD to void?

 

int GENERATE_DIRECTIONS_TO_COORD(float x, float y, float z, BOOL p3, float *direction, float *p5, float *distToNxJunction) // 0xF90125F1F79ECDF8 0xED35C094

 

BOOL p3 was 1

 

direction:
0 = You Have Arrive
1 = Recalculating Route, Please make a u-turn where safe
2 = Please Proceed the Highlighted Route
3 = Keep Left (unsure)
4 = In (distToNxJunction) Turn Left
5 = In (distToNxJunction) Turn Right
6 = Keep Right (unsure)
7 = In (distToNxJunction) Go Straight Ahead
8 = In (distToNxJunction) Join the freeway
9 = In (distToNxJunction) Exit Freeway

 

http://dev-c.com/nativedb/func/info/f90125f1f79ecdf8

Edited by qiangqiang101

Share this post


Link to post
Share on other sites
unknown modder

snip

Just because it always returns 0, doesnt mean its a void

void __fastcall pathfind__generate_directions_to_coord(NativeContext *a1){  NativeContext *v1; // [email protected]  NativeVector3 v2; // [sp+30h] [bp-28h]@1  v1 = a1;  sub_13FF34F98(    &v2,    (NativeVector3 *)a1->Args,    a1->Args->Arg4.DWORD,    a1->Args->Arg5.PDWORD,    a1->Args->Arg6.PDWORD,    (float *)a1->Args->Arg7.QWORD);  v1->Returns->Item1.DWORD = 0;}

this behavior is still seen on the current game version, though R*s native obfuscation makes it harder to find

Edited by unknown modder

Share this post


Link to post
Share on other sites
Keklol

where I could download the latest version of the SDK? :r*:

Share this post


Link to post
Share on other sites
Unknown_Modder

Found another new one: VEHICLE::_0x1DA0DA9CB3F0C8BF

static BOOL _0x1DA0DA9CB3F0C8BF(Vehicle vehicle) { return invoke<BOOL>(0x1DA0DA9CB3F0C8BF, vehicle); } // 0x1DA0DA9CB3F0C8BF

Returns true if the wheels on a vehicle with lowerable wheels (vehicleType == 7) are lowered, false otherwise.
I suck at naming things so can someone please post a name that fits my description?
The name must start with an underscore because we can't know the actual name and alphabetically fit between GET_IS_WAYPOINT_RECORDING_LOADED and GET_LANDING_GEAR_STATE if possible.
LbO0aZV.png

EDIT: Also found this one: VEHICLE::_GET_HAS_LOWERABLE_WHEELS (checks if CVehicle->vehicleType equals 7).

static BOOL _GET_HAS_LOWERABLE_WHEELS(Vehicle vehicle) { return invoke<BOOL>(0xDCA174A42133F08C, vehicle); } // 0xDCA174A42133F08C

EDIT2: Found another one (again): VEHICLE::_RAISE_LOWERABLE_WHEELS

static void _RAISE_LOWERABLE_WHEELS(Vehicle vehicle) { invoke<Void>(0xF660602546D27BA8, vehicle); } // 0xF660602546D27BA8
Edited by Unknown_Modder

Share this post


Link to post
Share on other sites
Unknown_Modder

Sorry for the double post but I found another one: VEHICLE::_GET_NUMBER_OF_VEHICLE_DOORS

static int _GET_NUMBER_OF_VEHICLE_DOORS(Vehicle vehicle) { return invoke<int>(0x92922A607497B14D, vehicle); } // 0x92922A607497B14D

This one was added with build 463. I'm about 99% sure it's the correct name since it's stored directly after GET_NUMBER_OF_VEHICLE_COLOURS.

 

EDIT: Another new one: VEHICLE::_GET_ENTRY_POSITION_OF_DOOR

static Vector3 _GET_ENTRY_POSITION_OF_DOOR(Vehicle vehicle, int doorIndex) { return invoke<Vector3>(0xC0572928C0ABFDA3, vehicle, doorIndex); } // 0xC0572928C0ABFDA3

Note: The position is the world position.

Edited by Unknown_Modder

Share this post


Link to post
Share on other sites
Unknown_Modder

Sorry for my 3rd post in a row but this is really important. For some reason the DB got reset again.

@@Alexander Blade, pls fix :(

EDIT: It's been reverted :D

Edited by Unknown_Modder

Share this post


Link to post
Share on other sites
The Stunt

@TaazR is there a way to make a mod for kick online people from the lobby without being the host of the lobby ?

Edited by The Stunt

Share this post


Link to post
Share on other sites
ItsiAdam

are natives real?

Share this post


Link to post
Share on other sites
mockba.the.borg

Hi all,

A quick question about natives:

If we look at the natives list from natives.h (from dev-c.com) we see, for example, that PLAYER_ID is 0x4F8644AF03D0E0D6 0x8AEA886C.

0x8AEA886C is easy, it is just a joaat of PLAYER_ID, but what about 0x4F8644AF03D0E0D6? Was there a function to calculate that one back in the days?

 

I know such function would be useless today, as the natives have changed their hashes over time, but I would like to be able to calculate the original from the name.

 

Cheers,

Mockba.

Share this post


Link to post
Share on other sites
Unknown_Modder

Hi all,

A quick question about natives:

 

If we look at the natives list from natives.h (from dev-c.com) we see, for example, that PLAYER_ID is 0x4F8644AF03D0E0D6 0x8AEA886C.

0x8AEA886C is easy, it is just a joaat of PLAYER_ID, but what about 0x4F8644AF03D0E0D6? Was there a function to calculate that one back in the days?

 

I know such function would be useless today, as the natives have changed their hashes over time, but I would like to be able to calculate the original from the name.

 

Cheers,

Mockba.

It's just random 64-bit values and we were able to match them to the jenkins hashes by group indexing them using the console version of the game.

Share this post


Link to post
Share on other sites
The_Creator

LbO0aZV.png

Hello there! What tool(or tools) do you use for find natives?

Share this post


Link to post
Share on other sites
mockba.the.borg

 

Hi all,

A quick question about natives:

 

If we look at the natives list from natives.h (from dev-c.com) we see, for example, that PLAYER_ID is 0x4F8644AF03D0E0D6 0x8AEA886C.

0x8AEA886C is easy, it is just a joaat of PLAYER_ID, but what about 0x4F8644AF03D0E0D6? Was there a function to calculate that one back in the days?

 

I know such function would be useless today, as the natives have changed their hashes over time, but I would like to be able to calculate the original from the name.

 

Cheers,

Mockba.

It's just random 64-bit values and we were able to match them to the jenkins hashes by group indexing them using the console version of the game.

 

Hmmm ok ... so there was no real "function" to generate these hashes back then. got it.

Share this post


Link to post
Share on other sites
user0103

What about native translations table?

Share this post


Link to post
Share on other sites
user0103

I'm sorry, didn't notice that ScriptHook hasn't been updated yet.

Edited by user0103

Share this post


Link to post
Share on other sites
unknown modder

What about native translations table?

guessing you want that to mod online, which isnt supported here

Share this post


Link to post
Share on other sites
user0103

 

What about native translations table?

guessing you want that to mod online, which isnt supported here

You are wrong and Alex posts tables for reason.

Share this post


Link to post
Share on other sites
unknown modder

 

 

What about native translations table?

guessing you want that to mod online, which isnt supported here

You are wrong and Alex posts tables for reason.

 

really, why do you need the tables?

Share this post


Link to post
Share on other sites
user0103

 

 

 

What about native translations table?

guessing you want that to mod online, which isnt supported here

You are wrong and Alex posts tables for reason.

 

really, why do you need the tables?

 

Strange question, to find native C++ functions by their names. But I already find out all I needed. Stop the prejudices.

I don't want to rely on ScriptHook for my modifications when it's closed-source, you see what happens when project is controlled by one developer.

Edited by user0103

Share this post


Link to post
Share on other sites
Transmet

 

 

 

 

What about native translations table?

guessing you want that to mod online, which isnt supported here

You are wrong and Alex posts tables for reason.

 

really, why do you need the tables?

 

Strange question, to find native C++ functions by their names. But I already find out all I needed. Stop the prejudices.

I don't want to rely on ScriptHook for my modifications when it's closed-source, you see what happens when project is controlled by one developer.

 

 

Leave him alone, he sees only evil.

He also gave me his speech.

It is a good intention.

Edited by Transmet

Share this post


Link to post
Share on other sites
Rbn3D

Hi all,

 

Has anyone found a native to add torque at position to entity/vehicle? Or to add force at position? I'm trying to implement custom physics and I need, at least, one of these natives.

 

Also, the link to the Multithreaded native bruteforce tool in first post seems to be dead. Can someone reaupload it?

 

Thanks.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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