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. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    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 IV 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 SA Mods
    10. GTA Vice City

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA III 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

Alexander Blade

Nothing special til the PC release :)

 

Also, anything new in the world of V scripts, Alexander?

 

Share this post


Link to post
Share on other sites
kraftwerkd

Just wanted to extend my thanks to everyone doing this. You guys give me inspiration to learn coding!

Share this post


Link to post
Share on other sites
Alexander Blade

Launching online database with natives !

 

NATIVE DB is aimed to gather every piece of information about script native functions that we have , think of it as of native wiki where anyone who wants to contribute can do so and everyone who needs the latest script documentation or the header with natives for ScriptHook can get it right here !

 

Suggestions are welcome .

 

NATIVE DB

Edited by Alexander Blade

Share this post


Link to post
Share on other sites
sasuke78200

Looks nice Alexander, but maybe you should add the changes we made on this page.

Share this post


Link to post
Share on other sites
Alexander Blade

Why don't you do it , there are not much of a changes there :D

 

Looks nice Alexander, but maybe you should add the changes we made on this page.

Share this post


Link to post
Share on other sites
sasuke78200

I'm a lazy boy, haha.

 

 

(I made some minor changes)

Share this post


Link to post
Share on other sites
NTAuthority

Suggestions are welcome .

perhaps json/xml dump for generating call stubs for different environments without having to parse the C++ header?

Share this post


Link to post
Share on other sites
2much4u

Suggestions are welcome .

 

Would like to be able to hit ctrl + f and search through all the natives without having to download a file or open up each individual category. That was something I could easily do on the wiki page.

Edited by 2much4u

Share this post


Link to post
Share on other sites
KiLLerBoy_001

Agree with the CTRL+F thing makes it kinda hard ( guess he could add a custom search function )


BTW love the VEHICLE::0xE943B09C (i call it "_SET_VEHICLE_RPM_MULTIPLIER") its pretty neat

_SET_VEHICLE_RPM_MULTIPLIER(EntityID, Float) is how its used

Share this post


Link to post
Share on other sites
sasuke78200

I was documenting some natives, when I saw that we can't set the return type to void or change the return type of a native when you set it to void.

 

Like, "_0xC0B971EA" which is returning a boolean.

 

We also can't submit a change of an unnamed native it says "Invalid name format", can you fix this please ?

Share this post


Link to post
Share on other sites
Alexander Blade

If it says return type is void or vector then this is for sure , that's why you can't edit it , for example original scripts use 0xC0B971EA as a void one only and according to the code it's void as well

 

I see a name check bug while submitting , thx

 

 

I was documenting some natives, when I saw that we can't set the return type to void or change the return type of a native when you set it to void.

 

Like, "_0xC0B971EA" which is returning a boolean.

 

We also can't submit a change of an unnamed native it says "Invalid name format", can you fix this please ?

Edited by Alexander Blade

Share this post


Link to post
Share on other sites
sasuke78200

Oh yeah sorry for the void return, I wasn't reading the good native.

Share this post


Link to post
Share on other sites
proditaki

 

 

Suggestions are welcome .

Would like to be able to hit ctrl + f and search through all the natives without having to download a file or open up each individual category. That was something I could easily do on the wiki page.

Theres an "expand all" option. Then u can ctrl+f

 

Edit: or was this added after that comment? :p

Edited by proditaki

Share this post


Link to post
Share on other sites
Alexander Blade

After :D

 

 

 

Suggestions are welcome .


Would like to be able to hit ctrl + f and search through all the natives without having to download a file or open up each individual category. That was something I could easily do on the wiki page.
Theres an "expand all" option. Then u can ctrl+f

Edit: or was this added after that comment? :p

 

Edited by Alexander Blade

Share this post


Link to post
Share on other sites
XeClutch

I figure I should give my 2 cents regarding the native hook since I haven't posted anything on here in awhile. Now that PC is released I figure you guys could use some of this information.

 

When calling a native, use the following struct.

typedef struct _NativeParams{    PDWORD pdwReturn; // ptr to DWORD array    DWORD dwParamCount;    PDWORD pdwParams; // ptr to DWORD array (24 elems) that consists of the arguments that are passed through the native call    _NativeParams(DWORD _dwParamCount, ...)    {        dwParamCount = _dwParamCount;        va_list params;        va_start(params, dwParamCount);        for (int i = 0; i < dwParamCount; i++)            pdwParams[i] = va_arg(params, DWORD);        va_end(params);    }} NativeParams, *pNativeParams;

You can create a successful script hook by hooking the function that ciphers through the RAGE opcodes (dubbed "ParseOpCodes" by XBLToothpik). I've seen others create a working scripthook other ways but this is how I and a few others do it. When using the "ParseOpCodes" scripthook you'll need to skip a frame each time around, meaning you have a switch that toggles itself each time it's executed and the value of the switch will determine if your code is going to get executed or not. This might just be for consoles though because when you don't skip a frame each time around the game lags horribly.

 

Also, when passing arguments through that struct I provided earlier, if the data type is a string you'll need to pass the address of where the string is located instead. Example:

void _0xF42C43C7(char* type){   // _CALL_NATIVE is a function I made that just calls whatever native you pass through it. The first argument being the native hash and the second is the NativeParams.   _CALL_NATIVE(0xF42C43C7, NativeParams(1, &type));}

For other data types such as bytes, floats, etc.. just cast them as an int.

Edited by XeClutch

Share this post


Link to post
Share on other sites
saracoglu

do we have an asi loader for GTA V already?

Alexander, will you make one similar to yours for GTA IV?

Share this post


Link to post
Share on other sites
Alexander Blade

I have asi loader , it's done in another way a bit in order to bypass exe encryption , I have script hook (since x360 actually) , it's ported to PC as well . Currently I'm matching natives between x360 and PC since they use different hashing algo (or even use random values instead) for natives in PC :)

Share this post


Link to post
Share on other sites
XeClutch

I have asi loader , it's done in another way a bit in order to bypass exe encryption , I have script hook (since x360 actually) , it's ported to PC as well . Currently I'm matching natives between x360 and PC since they use different hashing algo (or even use random values instead) for natives in PC :)

Now you've gone and done it Alex!

 

Attention everyone:

Share this post


Link to post
Share on other sites
sjaak327

I have asi loader , it's done in another way a bit in order to bypass exe encryption , I have script hook (since x360 actually) , it's ported to PC as well . Currently I'm matching natives between x360 and PC since they use different hashing algo (or even use random values instead) for natives in PC :)

All I can say is thank you very much sir !

 

Time to replace self radio with something better :D

Share this post


Link to post
Share on other sites
saracoglu

I have asi loader , it's done in another way a bit in order to bypass exe encryption , I have script hook (since x360 actually) , it's ported to PC as well . Currently I'm matching natives between x360 and PC since they use different hashing algo (or even use random values instead) for natives in PC :)

 

you're the man!

 

I am starting the framework then. When will you be sharing the loader with us?

Share this post


Link to post
Share on other sites
Mellnik

I have asi loader , it's done in another way a bit in order to bypass exe encryption , I have script hook (since x360 actually) , it's ported to PC as well . Currently I'm matching natives between x360 and PC since they use different hashing algo (or even use random values instead) for natives in PC :)

When are you going to release the source?

 

 

 

I figure I should give my 2 cents regarding the native hook since I haven't posted anything on here in awhile. Now that PC is released I figure you guys could use some of this information.

 

When calling a native, use the following struct.

 

typedef struct _NativeParams

{

DWORD pdwReturn[5];

DWORD dwParamCount;

DWORD pdwParams[100];

_NativeParams(DWORD _dwParamCount, ...)

{

dwParamCount = _dwParamCount;

va_list params;

va_start(params, dwParamCount);

for (int i = 0; i < dwParamCount; i++)

pdwParams = va_arg(params, DWORD);

va_end(params);

}

} NativeParams, *pNativeParams;

 

You can create a successful script hook by hooking the function that ciphers through the RAGE opcodes (dubbed "ParseOpCodes" by XBLToothpik). I've seen others create a working scripthook other ways but this is how I and a few others do it. When using the "ParseOpCodes" scripthook you'll need to skip a frame each time around, meaning you have a switch that toggles itself each time it's executed and the value of the switch will determine if your code is going to get executed or not. This might just be for consoles though because when you don't skip a frame each time around the game lags horribly.

 

Also, when passing arguments through that struct I provided earlier, if the data type is a string you'll need to pass the address of where the string is located instead. Example:

 

void _0xF42C43C7(char* type)

{

// _CALL_NATIVE is a function I made that just calls whatever native you pass through it. The first argument being the native hash and the second is the NativeParams.

_CALL_NATIVE(0xF42C43C7, NativeParams(1, &type));

}

 

For other data types such as bytes, floats, etc.. just cast them as an int.

So can you show us the _CALL_NATIVE function?

Edited by Mellnik

Share this post


Link to post
Share on other sites
XeClutch

I figure I should give my 2 cents regarding the native hook since I haven't posted anything on here in awhile. Now that PC is released I figure you guys could use some of this information.

 

When calling a native, use the following struct.

 

typedef struct _NativeParams

{

DWORD pdwReturn[5];

DWORD dwParamCount;

DWORD pdwParams[100];

_NativeParams(DWORD _dwParamCount, ...)

{

dwParamCount = _dwParamCount;

va_list params;

va_start(params, dwParamCount);

for (int i = 0; i < dwParamCount; i++)

pdwParams = va_arg(params, DWORD);

va_end(params);

}

} NativeParams, *pNativeParams;

 

You can create a successful script hook by hooking the function that ciphers through the RAGE opcodes (dubbed "ParseOpCodes" by XBLToothpik). I've seen others create a working scripthook other ways but this is how I and a few others do it. When using the "ParseOpCodes" scripthook you'll need to skip a frame each time around, meaning you have a switch that toggles itself each time it's executed and the value of the switch will determine if your code is going to get executed or not. This might just be for consoles though because when you don't skip a frame each time around the game lags horribly.

 

Also, when passing arguments through that struct I provided earlier, if the data type is a string you'll need to pass the address of where the string is located instead. Example:

 

void _0xF42C43C7(char* type)

{

// _CALL_NATIVE is a function I made that just calls whatever native you pass through it. The first argument being the native hash and the second is the NativeParams.

_CALL_NATIVE(0xF42C43C7, NativeParams(1, &type));

}

 

For other data types such as bytes, floats, etc.. just cast them as an int.

So can you show us the _CALL_NATIVE function?

All it does is cipher through the native pool searching for the call address and then passes the address of the NativeParams struct as the only parameter.

Share this post


Link to post
Share on other sites
ClareXoBearrx3R9

I have asi loader , it's done in another way a bit in order to bypass exe encryption , I have script hook (since x360 actually) , it's ported to PC as well . Currently I'm matching natives between x360 and PC since they use different hashing algo (or even use random values instead) for natives in PC :)

Awesome! Can't wait to start writing, hopefully with a C++ (or even C) framework :D

Share this post


Link to post
Share on other sites
stef538

I have asi loader , it's done in another way a bit in order to bypass exe encryption , I have script hook (since x360 actually) , it's ported to PC as well . Currently I'm matching natives between x360 and PC since they use different hashing algo (or even use random values instead) for natives in PC :)

I hope it's also in C# :D

Share this post


Link to post
Share on other sites
Jitnaught

 

I have asi loader , it's done in another way a bit in order to bypass exe encryption , I have script hook (since x360 actually) , it's ported to PC as well . Currently I'm matching natives between x360 and PC since they use different hashing algo (or even use random values instead) for natives in PC :)

I hope it's also in C# :D

 

It is probably in C++, but a .NET Scripthook will be made around it.

Edit: Told ya! XD

Edited by LetsPlayOrDy

Share this post


Link to post
Share on other sites
gta.bullet

I was hoping we will get native names in exe, but unfortunately most strings are meaningless online debug related things, it is stripped well. Sad.

Edited by gta.bullet

Share this post


Link to post
Share on other sites
XeClutch

I was hoping we will get native names in exe, but unfortunately most strings are meaningless online debug related things, it is stripped well. Sad.

They started hashing everything once V came around.

Share this post


Link to post
Share on other sites
MulleDK19

 

I was hoping we will get native names in exe, but unfortunately most strings are meaningless online debug related things, it is stripped well. Sad.

They started hashing everything once V came around.

 

 

And they aren't just hashed; they're salted.

Edited by MulleDK19

Share this post


Link to post
Share on other sites
Alexander Blade

He means not just natives but other stuff as well .

Natives are probably not hashed but replaced with random 64bit values (there are 3 natives that comes under old hashes) , according to the rule that only used in scripts natives go to the executable I may assume that native registration source file is autogenerated , so they could do some stuff like plain replace there .

 

 

 

I was hoping we will get native names in exe, but unfortunately most strings are meaningless online debug related things, it is stripped well. Sad.

They started hashing everything once V came around.

 

 

And they aren't just hashed; they're salted.

 

Edited by Alexander Blade

Share this post


Link to post
Share on other sites
Bucho

Register Native for vm is a GTA5.exe+14013F8?

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.
Note: Your post will require moderator approval before it will be visible.

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.


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

×
×
  • Create New...

Important Information

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