[TUTORIAL] Create Your Own Natives [XEX/SPRX]

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

sockstress

Member
May 8, 2016
20
18
13
Today, I figured I would release how to create your own natives. It requires RGH or CFW. Could​
be done on PC no idea how though. What you will need to do is do some research or reversing to figure out what kind of native you want to do. I will be creating a native to show if a player has godmode and if he doesn't. You will need these offsets first:
One of the Large Importing Native Functions
Xex: 0x8257D0B8
BLES: 0x6F0838
BLUS: 0x6F0668​

Function To Import Natives Into the Native Hash Table
Xex: 0x82845600
BLES: 0xA389B8
BLUS: 0xA387E8
Now, in the xex/sprx you will need to create a HookFunctionStart so we can import our natives like so.​
C:
HookFunctionStart((PDWORD)0x8257D0B8, (PDWORD)SetNativeStub, (DWORD)SetNative);
What this will be doing is hooking the large import table, so before the large import table is called we can import our native with the rest of the natives. Your stub can just be the same as any other stub you would call from CoD. And the last parameter will be your function you created like below.
After that you will need to create a SetNative function like so.
C:
HRESULT SetNative()
{
    PushNative("IS_PLAYER_INVINCIBLE", (DWORD)IS_PLAYER_INVINCIBLE);
    DbgPrint("Custom Native Entered!\n");
    return SetNativeStub();
}
I called the function to import natives into the game PushNative. The parameters for the
function go as PushNative(const char *NativeName, DWORD NativeAddress); The first parameter being what you want to call the native and that will be the native name the game hashes and imports into the native table. The next parameter being your function address we are going to import this will be the function you are going to create.
Code:
void IS_PLAYER_INVINCIBLE(DWORD native)
{
    DWORD dwReturn = *(DWORD*)(native);
    int Params = *(int*)(native + 0x04);
    DWORD dwNative = *(DWORD*)(native + 0x08);
}
Your function will only take one parameter and will only be a void, this goes for any function you
make even if it is returning a value. The reason for this is because GTA will send a pointer to your function as the first parameter. That pointer will go somewhere in memory and will store the return address for you function, how many parameters were sent to the native, and the address of those parameters.
Once you finish creating your native and the xex/sprx builds fine you will then need to import
your native into the sco compiler and import the native how you want in your script.

If all goes well you should be able to do something like this.
PM if you need help or need more explaining done.​
 

Itzchronicz

Member
Feb 18, 2016
20
8
13
nice tut..to do this on ps3, you need sdk plugins and visuale studio 10 not lower not higer just 10 to make sprx menu's

And make bypass eboot that call the menu

For pc visuale studio and scriptvhook and scriptvhookdotnet to make script menu.
 
Last edited:
General chit-chat
Help Users
    Chat Bot: damario has joined the room.