Quantcast

Jump to content

» «
Photo

[V] Script/Native Documentation and Research

1,141 replies to this topic
Fireboyd78
  • Fireboyd78

    Strangely Animated

  • Members
  • Joined: 30 Apr 2011
  • United-States

#991

Posted 30 December 2016 - 03:38 AM Edited by Fireboyd78, 30 December 2016 - 03:47 AM.

Here are native addresses for b944 (social club version): http://camx.me/gtav/...sses-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!

uNiverselEgacy
  • uNiverselEgacy

    Player Hater

  • Members
  • Joined: 15 Jul 2015
  • United-States

#992

Posted 16 January 2017 - 09:28 PM

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.


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#993

Posted 18 January 2017 - 04:16 PM

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

  • Jitnaught and MAFINS like this

uNiverselEgacy
  • uNiverselEgacy

    Player Hater

  • Members
  • Joined: 15 Jul 2015
  • United-States

#994

Posted 18 January 2017 - 08:01 PM

 

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.


uNiverselEgacy
  • uNiverselEgacy

    Player Hater

  • Members
  • Joined: 15 Jul 2015
  • United-States

#995

Posted 18 January 2017 - 08:10 PM

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.


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#996

Posted 18 January 2017 - 09:33 PM

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.


Unknown_Modder
  • Unknown_Modder

    Staff at GTA5-Mods.com

  • Members
  • Joined: 07 May 2015
  • Germany

#997

Posted 26 January 2017 - 06:57 PM Edited by Unknown_Modder, 05 February 2017 - 06:19 PM.

Here's another new (build 944) native:
static BOOL _DOES_VEHICLE_HAVE_DOOR(Vehicle vehicle, int doorIndex) { return invoke<BOOL>(0x645F4B6E8499F632, vehicle, doorIndex); } // 0x645F4B6E8499F632
Spoiler
  • sasuke78200, Jitnaught and R3QQ like this

Unknown_Modder
  • Unknown_Modder

    Staff at GTA5-Mods.com

  • Members
  • Joined: 07 May 2015
  • Germany

#998

Posted 02 February 2017 - 06:25 PM Edited by Unknown_Modder, 05 February 2017 - 06:20 PM.

Sorry for the double post but I can't believe no one named 0xFC695459D4D0E219 yet so I did it. It's that obvious:
Spoiler

http://www.dev-c.com...c695459d4d0e219

qiangqiang101
  • qiangqiang101

    I'm Not MentaL

  • Members
  • Joined: 02 Feb 2010
  • Malaysia

#999

Posted 02 February 2017 - 07:43 PM Edited by qiangqiang101, 02 February 2017 - 07:43 PM.

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/nat...90125f1f79ecdf8

  • R3QQ likes this

unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#1000

Posted 02 February 2017 - 11:10 PM Edited by unknown modder, 02 February 2017 - 11:13 PM.

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


Keklol
  • Keklol

    Player Hater

  • Members
  • Joined: 11 Feb 2017
  • None

#1001

Posted 13 February 2017 - 02:14 PM

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


Unknown_Modder
  • Unknown_Modder

    Staff at GTA5-Mods.com

  • Members
  • Joined: 07 May 2015
  • Germany

#1002

Posted 25 February 2017 - 10:11 PM Edited by Unknown_Modder, 27 February 2017 - 04:47 PM.

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
  • sasuke78200 and kagikn like this

Unknown_Modder
  • Unknown_Modder

    Staff at GTA5-Mods.com

  • Members
  • Joined: 07 May 2015
  • Germany

#1003

Posted 26 February 2017 - 08:07 PM Edited by Unknown_Modder, 27 February 2017 - 09:57 PM.

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.


Unknown_Modder
  • Unknown_Modder

    Staff at GTA5-Mods.com

  • Members
  • Joined: 07 May 2015
  • Germany

#1004

Posted 04 March 2017 - 11:58 PM Edited by Unknown_Modder, 06 March 2017 - 03:48 PM.

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

  • ikt, sasuke78200, xAgent47 and 1 other like this

The Stunt
  • The Stunt

    Player Hater

  • New Members
  • Joined: 09 Mar 2017
  • Canada

#1005

Posted 09 March 2017 - 04:48 AM Edited by The Stunt, 09 March 2017 - 04:59 AM.

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


ItsiAdam
  • ItsiAdam

    Memer

  • Members
  • Joined: 08 Jun 2016
  • United-Kingdom

#1006

Posted 14 March 2017 - 06:06 PM

are natives real?

  • Scriptkiddy1337 likes this

mockba.the.borg
  • mockba.the.borg

    Punk-ass Bitch

  • Members
  • Joined: 17 Jan 2016
  • United-States

#1007

Posted 14 March 2017 - 07:39 PM

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.


Unknown_Modder
  • Unknown_Modder

    Staff at GTA5-Mods.com

  • Members
  • Joined: 07 May 2015
  • Germany

#1008

Posted 14 March 2017 - 07:54 PM

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.


The_Creator
  • The_Creator

    Player Hater

  • Members
  • Joined: 21 Jan 2017
  • Ukraine

#1009

Posted 14 March 2017 - 09:15 PM

LbO0aZV.png

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

mockba.the.borg
  • mockba.the.borg

    Punk-ass Bitch

  • Members
  • Joined: 17 Jan 2016
  • United-States

#1010

Posted 15 March 2017 - 01:54 AM

 

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.


user0103
  • user0103

    Player Hater

  • Members
  • Joined: 10 Oct 2016
  • Northern-Mariana-Islands

#1011

Posted 16 March 2017 - 10:51 AM

What about native translations table?


user0103
  • user0103

    Player Hater

  • Members
  • Joined: 10 Oct 2016
  • Northern-Mariana-Islands

#1012

Posted 16 March 2017 - 11:13 AM Edited by user0103, 16 March 2017 - 11:13 AM.

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


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#1013

Posted 16 March 2017 - 10:59 PM

What about native translations table?

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


user0103
  • user0103

    Player Hater

  • Members
  • Joined: 10 Oct 2016
  • Northern-Mariana-Islands

#1014

Posted 17 March 2017 - 10:30 AM

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.

unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#1015

Posted 17 March 2017 - 11:33 AM

 

 

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?


user0103
  • user0103

    Player Hater

  • Members
  • Joined: 10 Oct 2016
  • Northern-Mariana-Islands

#1016

Posted 17 March 2017 - 01:17 PM Edited by user0103, 17 March 2017 - 01:20 PM.

 

 

 

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.

  • Transmet likes this

Transmet
  • Transmet

    LS:MP Leader & Developper

  • Members
  • Joined: 01 Aug 2014
  • France

#1017

Posted 17 March 2017 - 01:32 PM Edited by Transmet, 17 March 2017 - 01:38 PM.

 

 

 

 

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.

  • user0103 likes this

Alexander Blade
  • Alexander Blade

    Come As You Are

  • Members
  • Joined: 05 Nov 2006
  • None
  • Best Tool 2016 [OpenIV]
    Major Contribution Award [Mods]

#1018

Posted 18 March 2017 - 12:00 PM

GTA V Native hash translation table from b944 to b1011 .

 

http://pastebin.com/yz3bxJSs

  • ikt, sasuke78200, Fun 2 and 6 others like this

user0103
  • user0103

    Player Hater

  • Members
  • Joined: 10 Oct 2016
  • Northern-Mariana-Islands

#1019

Posted 18 March 2017 - 02:39 PM


GTA V Native hash translation table from b944 to b1011 .
 
http://pastebin.com/yz3bxJSs

Many thanks for that!

Rbn3D
  • Rbn3D

    Player Hater

  • Members
  • Joined: 18 Mar 2017
  • Spain

#1020

Posted 25 March 2017 - 06:38 PM

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users