[simplified tutorial] Find Natives In default.xex

Coder123 Jul 1, 2014

  1. Coder123

    Coder123 Finnish Modder XPG Developer TeamXPG
    105/188

    Joined:
    Jan 21, 2012
    Messages:
    1,953
    Likes Received:
    717
    Trophy Points:
    105
    Gender:
    Male
    Location:
    Finland
    Console:
    Xbox
    Original tutorial was posted by iMaes but i decided to release much easier and simplified tutorial for this.

    Natives are functions used for variety of different things such as giving weapons, setting weather, setting timescale and you can pretty much do whatever you want with enought research and combination of different natives... mod menus, teleportation, dropping cash and so on.

    Okay so here is extremely simple way to find them, first of all you gotta know how the xex file loads them which is

    Below you can see example on one of the structures, they arent the same for loading each native, but you get the point.
    (r1 = random register 1, r2 = random register 2)

    Code:
    |PPC                            || Hex
    |____________________________________________________
    |lis     r1, loc_nativeFunc     || ?? ?? ????? ?????
    |lis     %r3, HASH1 HASH2       || 3C 60 HASH1 HASH2
    |addi    r1, r2, loc_nativeFunc || ?? ?? ????? ?????
    |ori     %r3, %r3, HASH3 HASH4  || 60 63 HASH3 HASH4
    
    Short explanation on the "HASH1" and so on part..

    HASH = 0x406B4B20

    HASH1 = hex values 1 and 2 of the hash = [40]
    HASH2 = hex values 3 and 4 of the hash = [6B]
    HASH3 = hex values 5 and 6 of the hash = [4B]
    HASH4 = hex values 7 and 9 of the hash = [20]

    1. Find some native you want to find in the executable
    Check the Links section!

    Credits to Alexander Blade for releasing the majority of natives, hashes and args for them!

    2. Search the natives hex value in the .xex
    Im gonna use GET_PLAYER_NAME Hash:0x406B4B20 an as sample.. Now you can either search it by using the first 4 hex values with the 3C 60 HASH1 HASH2 or then the last 4 ones with 60 63 HASH3 HASH4 (as far as im aware it always load the hash to register3, but it could change on some natives so if you dont find then, then you gotta use different approach)

    Im gonna use the first 4 ones in this sample... Press alt+b (find sequence of bytes) in ida and input the following 3C 60 40 6B and after it finds the result you wanna make sure it equals with the correct hash, because some hashes can use the same first 4 hex values on them.

    [​IMG]

    So as you can see there is alot of different hashes in this function, but that doesent matter unless you are interested in them.

    So it isnt any more difficult than that... Offset for the function GET_PLAYER_NAME would be 0x82C95720 on TU15/1.14 which is the loc_offsetHere displayed before and after the hash.

    This isnt anything special, but i just felt like sharing this simple tutorial with everybody. With natives you can do alot of crazy stuff, but it requires either doing research on needed args or then searching online if someone has released how they work.

    Links;
    Natives, hashes, args; https://dl.dropboxusercontent.com/u/1237747/games.gta/native_decl.h

    Good luck.
     
  2. Coder123

    Coder123 Finnish Modder XPG Developer TeamXPG
    105/188

    Joined:
    Jan 21, 2012
    Messages:
    1,953
    Likes Received:
    717
    Trophy Points:
    105
    Gender:
    Male
    Location:
    Finland
    Console:
    Xbox
    Few samples
    Code:
    How to set random weather for user.
    
    Native info : void SET_RANDOM_WEATHER_TYPE();
    Native name : SET_RANDOM_WEATHER_TYPE
    Native hash: 0xE7AA1BC9
    Native offset: 0x82C1F100
    
    As you can see from the natives name it obviously sets random weather and it does not require any args to be used, so its really simple example for this.
    
    uint SET_RANDOM_WEATHER_TYPE = 0x82C1F100;
    
    Coder123.Call(SET_RANDOM_WEATHER_TYPE);
    
    And thats it... Now you can change the weather with a click of a button.
    
    Code:
    How to set slow motion.
    
    Native info : void SET_TIME_SCALE(float timeScale);
    Native name : SET_TIME_SCALE
    Native hash: 0xA7F84694
    Native offset: 0x82C37150
    Info: Cheat CHEAT_SLOW_MO uses this. It uses 3 different values for the cheat itself which are 0.6 , 0.4 and 0.2, but you can use value anywhere from 1 being max and i havent tried lowest value so you can go ahead and check that yourself.
    
    This native uses one arg which is .float value.
    
    uint SET_TIME_SCALE = 0x82C37150;
    Coder123.Call(SET_TIME_SCALE, (float)0.6);
    
     
  3. Coder123

    Coder123 Finnish Modder XPG Developer TeamXPG
    105/188

    Joined:
    Jan 21, 2012
    Messages:
    1,953
    Likes Received:
    717
    Trophy Points:
    105
    Gender:
    Male
    Location:
    Finland
    Console:
    Xbox
    Oh yeah lol incase someone didnt understand this is for GTA V.
     

Share This Page

Close