Jump to content

[V] Script/Native Documentation and Research


Recommended Posts

 

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.

  • Like 2

Did some more bruteforcing and found a lot of native names, and updated nativeDB accordingly

0x866004A8 - NETWORKCASH - NETWORK_EARN_FROM_AI_TARGET_KILL0x3D96A21C - NETWORKCASH - NETWORK_SPENT_PLAYER_HEALTHCARE0x2E51C61C - NETWORKCASH - NETWORK_SPENT_NO_COPS0xD57A5125 - NETWORKCASH - NETWORK_SPENT_REQUEST_JOB0x8957038E - NETWORKCASH - NETWORK_SPENT_IN_STRIPCLUB0x3F75CC38 - NETWORK - NETWORK_SESSION_ACTIVITY_QUICKMATCH0xDB67785D - NETWORK - NETWORK_SESSION_IS_PRIVATE0x6A0BEA60 - NETWORK - NETWORK_SESSION_WAS_INVITED0x7017257D - NETWORK - NETWORK_SESSION_MARK_VISIBLE0x4977AC28 - NETWORK - NETWORK_SESSION_IS_VISIBLE0x6BB93227 - NETWORK - NETWORK_SESSION_CHANGE_SLOTS0x3FDA00F3 - NETWORK - NETWORK_GET_NUM_PRESENCE_INVITES0x8F7D9F46 - NETWORK - NETWORK_GET_NUM_SCRIPT_PARTICIPANTS0x5C065D55 - NETWORK - NETWORK_IS_CABLE_CONNECTED0x56E75FE4 - NETWORK - NETWORK_SESSION_IS_CLOSED_FRIENDS0x3FD49D3B - NETWORK - NETWORK_SESSION_FORCE_CANCEL_INVITE0xE6EEF8AF - NETWORK - NETWORK_SESSION_BLOCK_JOIN_REQUESTS0x742075FE - NETWORK - NETWORK_SESSION_PREPARE_FIRST_DLC ? (possibly hash collision)0xD7F934F4 - NETWORK - NETWORK_GET_ENTITY_IS_NETWORKED0x1E5F6AEF - NETWORK - NETWORK_CHANGE_TRANSITION_SLOTS0xE96CFE7D - NETWORK - NETWORK_HAS_FOLLOW_INVITE0x3242F952 - NETWORK - NETWORK_CLEAR_FOLLOW_INVITE0x208DD848 - NETWORK - NETWORK_GET_RANDOM_INT0x8D27280E - NETWORK - NETWORK_DISABLE_INVINCIBLE_FLASHING0xCAB21090 - NETWORK - NETWORK_OVERRIDE_TRANSITION_CHAT0x9ECF722A - NETWORK - NETWORK_CLEAR_VOICE_CHANNEL0x38BC35C8 - NETWORK - NETWORK_CLEAR_PROPERTY_ID0x9262744C - NETWORK - NETWORK_ENABLE_MOTION_DRUGGED0xCCA9C022 - NETWORK - NETWORK_SET_TRANSITION_ACTIVITY_ID0xCDEBCCE7 - NETWORK - NETWORK_ARE_TRANSITION_DETAILS_VALID0xF7134E73 - NETWORK - NETWORK_REMOVE_ALL_TRANSITION_INVITE0xAB969F00 - NETWORK - NETWORK_ACTION_FOLLOW_INVITE0x4538C4A2 - NETWORK - HAS_NETWORK_TIME_STARTED0xE22445DA - NETWORK - NETWORK_GET_PRIMARY_CLAN_DATA_CLEAR0x455DDF5C - NETWORK - NETWORK_GET_PRIMARY_CLAN_DATA_CANCEL0xA4EF02F3 - NETWORK - NETWORK_GET_PRIMARY_CLAN_DATA_PENDING0x68A054E - NETWORK - NETWORK_GET_PRIMARY_CLAN_DATA_SUCCESS0x4EC0D983 - NETWORK - NETWORK_PLAYER_GET_USERID0xC5E0C989 - NETWORK - NETWORK_GET_PRESENCE_INVITE_SESSION_ID0x47D61C99 - NETWORK - NETWORK_DO_TRANSITION_QUICKMATCH_ASYNC0xE1F86C6A - NETWORK - NETWORK_GET_TIMEOUT_TIME0xD7E5CF9 - NETWORK - NETWORK_JOIN_GROUP_ACTIVITY0xCF358946 - FIRE - ADD_EXPLOSION_WITH_USER_VFX0x1C68D9DC - SCRIPT - REQUEST_SCRIPT_WITH_NAME_HASH0x06674818 - SCRIPT - HAS_SCRIPT_WITH_NAME_HASH_LOADED0x96C26F66 - SCRIPT - SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED0x10B6AB36 - STREAMING - FORMAT_FOCUS_HEADING0xFA037FEB - STREAMING - NEW_LOAD_SCENE_START_SPHERE0x47352E14 - STREAMING - SET_PLAYER_SWITCH_OUTRO

Mostly useless network natives cause they're the easiest to figure out, but at least it will make the scripts more readable.

 

Edit: Found even more.

0x8332730C - VEHICLE - SET_VEHICLE_ENVEFF_SCALE0xD5F1EEE1 - VEHICLE - GET_VEHICLE_ENVEFF_SCALE0xAA8BD440 - VEHICLE - SET_VEHICLE_EXCLUSIVE_DRIVER0xE0FC6A32 - VEHICLE - SET_FORCE_HD_VEHICLE0xD1B71A25 - VEHICLE - SET_LAST_DRIVEN_VEHICLE0x8D15BE5D - SYSTEM - START_NEW_SCRIPT_WITH_NAME_HASH0xE38A3AD4 - SYSTEM - START_NEW_SCRIPT_WITH_NAME_HASH_AND_ARGS0x6AEFE6A5 - CAM - IS_SCRIPT_GLOBAL_SHAKING0x26FCFB96 - CAM - STOP_SCRIPT_GLOBAL_SHAKING0x4B67D7EE - PATHFIND - DOES_NAVMESH_BLOCKING_OBJECT_EXIST0x86DDF9C2 - DATAFILE - DATAFILE_GET_FILE_DICT0x5DCD0796 - DATAFILE - DATAFILE_IS_SAVE_PENDING0xA8171E9E - GAMEPLAY - GET_PREV_WEATHER_TYPE_HASH_NAME0x353E8056 - GAMEPLAY - GET_NEXT_WEATHER_TYPE_HASH_NAME0x21636EE - GAMEPLAY - IS_STUNT_JUMP_MESSAGE_SHOWING0x48CEB6B4 - STREAMING - REQUEST_MENU_PED_MODEL0x2798F56F - DLC1 - GET_SHOP_PED_OUTFIT_LOCATE0x35BCA844 - DLC1 - IS_DLC_VEHICLE_MOD0xBE70849B - NETWORKCASH - NETWORK_PAY_EMPLOYEE_WAGE0x451A2644 - NETWORKCASH - NETWORK_PAY_UTILITY_BILL0xADF8F882 - NETWORKCASH - NETWORK_GET_VC_BALANCE0x16184FB5 - NETWORKCASH - NETWORK_GET_VC_BANK_BALANCE0x4F5B781C - NETWORKCASH - NETWORK_GET_VC_WALLET_BALANCE0x5E81F55C - NETWORKCASH - NETWORK_EARN_FROM_MISSION_H0x5AA379D9 - NETWORKCASH - NETWORK_CAN_SPEND_MONEY0x8262C70E - NETWORK - NETWORK_IS_TRANSITION_MATCHMAKING0xC71E607B - NETWORK - NETWORK_OPEN_TRANSITION_MATCHMAKING0x82D32D07 - NETWORK - NETWORK_CLOSE_TRANSITION_MATCHMAKING0xCEE79711 - NETWORK - NETWORK_APPLY_TRANSITION_PARAMETER0x7771AB83 - NETWORK - NETWORK_X_AFFECTS_GAMERS0x74EE2D8B - NETWORK - NETWORK_OVERRIDE_CHAT_RESTRICTIONS0x95F1C60D - NETWORK - NETWORK_OVERRIDE_RECEIVE_RESTRICTIONS0xD4DA14EF - UI - IS_SOCIAL_CLUB_ACTIVE0xD094F11A - SOCIALCLUB - SC_EMAIL_MESSAGE_CLEAR_RECIP_LIST
Edited by TaazR

 

0x1C68D9DC - SCRIPT - REQUEST_SCRIPT_WITH_NAME_HASH0x06674818 - SCRIPT - HAS_SCRIPT_WITH_NAME_HASH_LOADED0x96C26F66 - SCRIPT - SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED

 

I spent HOURS trying to figure out what those natives were. I can't believe I didn't think to try "WITH_NAME_HASH", I think I did "BY_HASH" or something like that. I stupidly called those natives "REQUEST_STREAMED_SCRIPT"...apologies to anyone who was thrown off by my bad research.

 

You sir, are a god. Well technically bruteforcing did the work for you, but still! :p

Edited by Fireboyd78
  • Like 3
unknown modder

 

 

0x1C68D9DC - SCRIPT - REQUEST_SCRIPT_WITH_NAME_HASH0x06674818 - SCRIPT - HAS_SCRIPT_WITH_NAME_HASH_LOADED0x96C26F66 - SCRIPT - SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED
I spent HOURS trying to figure out what those natives were. I can't believe I didn't think to try "WITH_NAME_HASH", I think I did "BY_HASH" or something like that. I stupidly called those natives "REQUEST_STREAMED_SCRIPT"...apologies to anyone who was thrown off by my bad research.

 

You sir, are a god. Well technically bruteforcing did the work for you, but still! :p

It took me equally as long to figure out R* calls raycasts shape tests
  • Like 1

 

0x1C68D9DC - SCRIPT - REQUEST_SCRIPT_WITH_NAME_HASH0x06674818 - SCRIPT - HAS_SCRIPT_WITH_NAME_HASH_LOADED0x96C26F66 - SCRIPT - SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED

I spent HOURS trying to figure out what those natives were. I can't believe I didn't think to try "WITH_NAME_HASH", I think I did "BY_HASH" or something like that. I stupidly called those natives "REQUEST_STREAMED_SCRIPT"...apologies to anyone who was thrown off by my bad research.

 

You sir, are a god. Well technically bruteforcing did the work for you, but still! :p

 

Yeah it's easy to use the bruteforcer when you can search for anything by doing something like "REQUEST_SCRIPT_WITH_{wordlist}_{wordlist}"

 

Alexander needs to update the nativeDB, a lot of natives are missing their 32 bit console hash so there is no way to bruteforce them. And a lot of other natives are hash collisions and it doesn't let you change their names. It's also missing the natives from the recent GTA updates.

Edited by TaazR

@TaazR

How did you figure to change interior styles for Bikers interiors?

0xC1F1920BAF281317

 

It's not in the natives.h file since it's a dlc native, you have to add it in yourself

 

parameters are: (int interiorID, char* prop, int unknown)

Edited by TaazR

I found this, only for warehouse:

http://pastebin.com/05mW4SLW

In my script it's

			0xC1F1920BAF281317(id[59], "Furnishings_01", 1);			0xC1F1920BAF281317(id[59], "Walls_01", 1);			0xC1F1920BAF281317(id[59], "Decorative_01", 1);			0xC1F1920BAF281317(id[59], "Mural_01", 1);			0xC1F1920BAF281317(id[59], "lower_walls_default", 1);

use 02 instead of 01 for the other style

Edited by TaazR

Hello ,

i play gta 5 on my laptop and i had to modify script.cpp file for the native trainer, cuz i dont have numpad.

i have uploaded it to google drive,link below.

can u compile it into a nativetrainer.asi file ?

i have very bad internet speeds to download micosoft visual studio.

 

GOOGle drive link

https://drive.google.com/open?id=0B2xX40IRr0gLVTh6SEpucUJRNms

Edited by kingnikpic
unknown modder

@unknown modder

@all

I dont know how to do this so here is my request for the decompiled scripts (v944.2)

 

thanks in advance!!!

https://www.gta5-mods.com/tools/decompiled-scripts-b757

Hello ,

i play gta 5 on my laptop and i had to modify script.cpp file for the native trainer, cuz i dont have numpad.

i have uploaded it to google drive,link below.

can u compile it into a nativetrainer.asi file ?

i have very bad internet speeds to download micosoft visual studio.

 

GOOGle drive link

https://drive.google.com/open?id=0B2xX40IRr0gLVTh6SEpucUJRNms

Wrong topic, this is about documentation and research, try asking here http://gtaforums.com/forum/372-coding/

  • Like 2

Here are some of the new natives from 1.0.944.2 (add to VEHICLE namespace)

static BOOL _HAS_VEHICLE_ROCKET_BOOST(Vehicle vehicle) { return invoke<BOOL>(0x36D782F68B309BDA, vehicle); }static BOOL _IS_VEHICLE_ROCKET_BOOST_ACTIVE(Vehicle vehicle) { return invoke<BOOL>(0x3D34E80EED4AE3BE, vehicle); }static void _SET_VEHICLE_ROCKET_BOOST_ACTIVE(Vehicle vehicle, BOOL active) { invoke<Void>(0x81E1552E35DC3839, vehicle, active); }static void _SET_VEHICLE_ROCKET_BOOST_REFILL_TIME(Vehicle vehicle, float seconds) { invoke<Void>(0xE00F2AB100B76E89, vehicle, seconds); }static BOOL _HAS_VEHICLE_JUMPING_ABILITY(Vehicle vehicle) { return invoke<BOOL>(0x9078C0C5EF8C19E9, vehicle); }static BOOL _HAS_VEHICLE_PARACHUTE(Vehicle vehicle) { return invoke<BOOL>(0xBC9CFF381338CB4F, vehicle); }static BOOL _CAN_VEHICLE_PARACHUTE_BE_ACTIVATED(Vehicle vehicle) { return invoke<BOOL>(0xA916396DF4154EE3, vehicle); }static void _SET_VEHICLE_PARACHUTE_ACTIVE(Vehicle vehicle, BOOL active) { invoke<Void>(0x0BFFB028B3DD0A97, vehicle, active); }
Edited by Unknown_Modder
unknown modder

 

Here are some of the new natives from 1.0.944.2 (add to VEHICLE namespace)

static BOOL _HAS_VEHICLE_ROCKET_BOOST(Vehicle vehicle) { return invoke<BOOL>(0x36D782F68B309BDA, vehicle); }static BOOL _IS_VEHICLE_ROCKET_BOOST_ACTIVE(Vehicle vehicle) { return invoke<BOOL>(0x3D34E80EED4AE3BE, vehicle); }static void _SET_VEHICLE_ROCKET_BOOST_ACTIVE(Vehicle vehicle, BOOL active) { invoke<Void>(0x81E1552E35DC3839, vehicle, active); }static BOOL _HAS_VEHICLE_JUMPING_ABILITY(Vehicle vehicle) { return invoke<BOOL>(0x9078C0C5EF8C19E9, vehicle); }static BOOL _HAS_VEHICLE_PARACHUTE(Vehicle vehicle) { return invoke<BOOL>(0xBC9CFF381338CB4F, vehicle); }static BOOL _CAN_VEHICLE_PARACHUTE_BE_ACTIVATED(Vehicle vehicle) { return invoke<BOOL>(0xA916396DF4154EE3, vehicle); }static void _SET_VEHICLE_PARACHUTE_ACTIVE(Vehicle vehicle, BOOL active) { invoke<Void>(0x0BFFB028B3DD0A97, vehicle, active); }

I should really add those to my decompiler. Also this brings a point that nativeDB is in serious need of an update. No new natives have been added there(presumably because they wont work on earlier game versions). Also natives with parameters added/removed haven't been updated

 

 

Here are some of the new natives from 1.0.944.2 (add to VEHICLE namespace)

static BOOL _HAS_VEHICLE_ROCKET_BOOST(Vehicle vehicle) { return invoke<BOOL>(0x36D782F68B309BDA, vehicle); }static BOOL _IS_VEHICLE_ROCKET_BOOST_ACTIVE(Vehicle vehicle) { return invoke<BOOL>(0x3D34E80EED4AE3BE, vehicle); }static void _SET_VEHICLE_ROCKET_BOOST_ACTIVE(Vehicle vehicle, BOOL active) { invoke<Void>(0x81E1552E35DC3839, vehicle, active); }static BOOL _HAS_VEHICLE_JUMPING_ABILITY(Vehicle vehicle) { return invoke<BOOL>(0x9078C0C5EF8C19E9, vehicle); }static BOOL _HAS_VEHICLE_PARACHUTE(Vehicle vehicle) { return invoke<BOOL>(0xBC9CFF381338CB4F, vehicle); }static BOOL _CAN_VEHICLE_PARACHUTE_BE_ACTIVATED(Vehicle vehicle) { return invoke<BOOL>(0xA916396DF4154EE3, vehicle); }static void _SET_VEHICLE_PARACHUTE_ACTIVE(Vehicle vehicle, BOOL active) { invoke<Void>(0x0BFFB028B3DD0A97, vehicle, active); }

I should really add those to my decompiler. Also this brings a point that nativeDB is in serious need of an update. No new natives have been added there(presumably because they wont work on earlier game versions). Also natives with parameters added/removed haven't been updated

 

 

Yes fully agree, we would have to update NativeDB to give it the native news and also put the last hash.
Or at least add a quick hash translator to avoid having to translate them by hand by scrolling version by version, It would be more practical. :santa:
Otherwise it's me where the last update to change calling convention for native functions or composition structure arguments ?
Because I can no longer invoke certain native functions correctly, it may be me, i'll see that but I would like a confirmation if not.
Thanks.
Since when have no longer needs to reverse the stack of arguments for native functions ?

That was my problem, now it seems to work perfectly.


Sorry for my double post.

Edited by Transmet
unknown modder

 

Yes fully agree, we would have to update NativeDB to give it the native news and also put the last hash.

Or at least add a quick hash translator to avoid having to translate them by hand by scrolling version by version, It would be more practical. :santa:
Otherwise it's me where the last update to change calling convention for native functions or composition structure arguments ?
Because I can no longer invoke certain native functions correctly, it may be me, i'll see that but I would like a confirmation if not.
Thanks.

We dont need to worry about translated hashes for nativeDB, SHV can handle that fine, but natives that are in later game versions can't be used without manually adding the hashes to your natives.h file. Also what is your reason for manually invoking natives

 

 

Yes fully agree, we would have to update NativeDB to give it the native news and also put the last hash.

Or at least add a quick hash translator to avoid having to translate them by hand by scrolling version by version, It would be more practical. :santa:
Otherwise it's me where the last update to change calling convention for native functions or composition structure arguments ?
Because I can no longer invoke certain native functions correctly, it may be me, i'll see that but I would like a confirmation if not.
Thanks.

We dont need to worry about translated hashes for nativeDB, SHV can handle that fine, but natives that are in later game versions can't be used without manually adding the hashes to your natives.h file. Also what is your reason for manually invoking natives

 

I use my own hooker which only works with the latest hashs and does not perform internal conversion as SHV.
unknown modder

 

 

 

Yes fully agree, we would have to update NativeDB to give it the native news and also put the last hash.

Or at least add a quick hash translator to avoid having to translate them by hand by scrolling version by version, It would be more practical. :santa:
Otherwise it's me where the last update to change calling convention for native functions or composition structure arguments ?
Because I can no longer invoke certain native functions correctly, it may be me, i'll see that but I would like a confirmation if not.
Thanks.

We dont need to worry about translated hashes for nativeDB, SHV can handle that fine, but natives that are in later game versions can't be used without manually adding the hashes to your natives.h file. Also what is your reason for manually invoking natives

 

I use my own hooker which only works with the latest hashs and does not perform internal conversion as SHV.

Aside from the fact I'm 99% sure this is for GTA:O modding, you can just use the translatin table and have some script do the conversion for you

 

 

 

 

Yes fully agree, we would have to update NativeDB to give it the native news and also put the last hash.

Or at least add a quick hash translator to avoid having to translate them by hand by scrolling version by version, It would be more practical. :santa:
Otherwise it's me where the last update to change calling convention for native functions or composition structure arguments ?
Because I can no longer invoke certain native functions correctly, it may be me, i'll see that but I would like a confirmation if not.
Thanks.

We dont need to worry about translated hashes for nativeDB, SHV can handle that fine, but natives that are in later game versions can't be used without manually adding the hashes to your natives.h file. Also what is your reason for manually invoking natives

 

I use my own hooker which only works with the latest hashs and does not perform internal conversion as SHV.

Aside from the fact I'm 99% sure this is for GTA:O modding, you can just use the translatin table and have some script do the conversion for you

 

 

I use my own hooker to develop my own multiplayer mod, then stop the prejudices.

And I already made a program to perform the translations automatically, i was just saying that it would be better to have a small tool on the website.
Happy Holidays.
Edited by Transmet
unknown modder

Don't know if it's been asked before but is it safe to call new natives on older versions of the game? Will SHV just ignore the call or is it going to throw an exception?

I think SHV will throw an exception, if not then GTA V definitely will, all unregistered natives point to a function that causes a game crash.

Here are some of the new natives from 1.0.944.2 (add to VEHICLE namespace)

static BOOL _HAS_VEHICLE_ROCKET_BOOST(Vehicle vehicle) { return invoke<BOOL>(0x36D782F68B309BDA, vehicle); }static BOOL _IS_VEHICLE_ROCKET_BOOST_ACTIVE(Vehicle vehicle) { return invoke<BOOL>(0x3D34E80EED4AE3BE, vehicle); }static void _SET_VEHICLE_ROCKET_BOOST_ACTIVE(Vehicle vehicle, BOOL active) { invoke<Void>(0x81E1552E35DC3839, vehicle, active); }static void _SET_VEHICLE_ROCKET_BOOST_REFILL_TIME(Vehicle vehicle, float seconds) { invoke<Void>(0xE00F2AB100B76E89, vehicle, seconds); }static BOOL _HAS_VEHICLE_JUMPING_ABILITY(Vehicle vehicle) { return invoke<BOOL>(0x9078C0C5EF8C19E9, vehicle); }static BOOL _HAS_VEHICLE_PARACHUTE(Vehicle vehicle) { return invoke<BOOL>(0xBC9CFF381338CB4F, vehicle); }static BOOL _CAN_VEHICLE_PARACHUTE_BE_ACTIVATED(Vehicle vehicle) { return invoke<BOOL>(0xA916396DF4154EE3, vehicle); }static void _SET_VEHICLE_PARACHUTE_ACTIVE(Vehicle vehicle, BOOL active) { invoke<Void>(0x0BFFB028B3DD0A97, vehicle, active); }

Here's another one:

static BOOL _IS_THIS_MODEL_AN_AMPHIBIOUS_CAR(Hash model) { return invoke<BOOL>(0x633F6F44A537EBB6, model); } // 0x633F6F44A537EBB6

They have put this below IS_MODEL_A_VEHICLE

9T21RiU.png

(Edit: Changed the name to _IS_THIS_MODEL_AN_AMPHIBIOUS_CAR as it fits better)

 

Currently only returns true for 0x4662BCBB (technical2 | Technical Aqua). Not for Blazer Aqua since it's a quadbike (explanation below).

 

And yes, it's _IS_THIS_MODEL_AN_AMPHIBIOUS_CAR. Why? Let's take a look at the changes to IS_THIS_MODEL_A_CAR:

 

b877 b944

v85ETtr.pngYrR5PoQ.png

 

No other IS_THIS_MODEL_* native checks for value 6.

 

I don't know why R* made it for cars only but to check if the model is an amphibious quadbike, you would need to manually check if CVehicleModelInfo + 0x318 is 7 instead of 6.

Edited by Unknown_Modder

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
  • 4 Users Currently Viewing
    1 member, 0 Anonymous, 3 Guests

    • IDK_94949349
×
×
  • Create New...

Important Information

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