Jump to content

[V] Script/Native Documentation and Research


Alexander Blade

Recommended Posts

Alexander Blade

Nothing special til the PC release :)

 

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

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
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
  • Like 2
Link to comment
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.

Link to comment
Share on other sites

sasuke78200

I'm a lazy boy, haha.

 

 

(I made some minor changes)

Link to comment
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?

Link to comment
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 comment
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

Link to comment
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 ?

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

sasuke78200

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

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

do we have an asi loader for GTA V already?

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

Link to comment
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 :)

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

ClareXoBearrx3

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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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
Link to comment
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.