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

    1. GTANet.com

    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

      1. GTANet 20th Anniversary
    2. Support

    3. Suggestions

[V] Script/Native Documentation and Research


Alexander Blade

Recommended Posts

Nothing special til the PC release :)

 

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

 

  • Like 1
Link to post
Share on other sites
  • 2 weeks later...

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
  • Like 2
Link to post
Share on other sites

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.

Link to post
Share on other sites

Suggestions are welcome .

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

Link to post
Share on other sites

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
Link to post
Share on other sites

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

Link to post
Share on other sites

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 ?

Link to post
Share on other sites

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
Link to post
Share on other sites
  • 4 weeks later...

 

 

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
Link to post
Share on other sites

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
Link to post
Share on other sites

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
  • Like 2
Link to post
Share on other sites

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 :)

Link to post
Share on other sites

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:

Link to post
Share on other sites

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

Link to post
Share on other sites

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?

Link to post
Share on other sites

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
Link to post
Share on other sites

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.

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

Link to post
Share on other sites

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

Link to post
Share on other sites

 

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
Link to post
Share on other sites

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
Link to post
Share on other sites

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.

Link to post
Share on other sites

 

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
Link to post
Share on other sites

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
Link to post
Share on other sites

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.