Script/Native Documentation and Research
This topic is aimed (1) onto describing and researching what actually GTA V scripts do in order to perform %something% (2) as well as describing native (i.e. script api functions) names, parameters and giving them a description.
GTA V has around 700 scripts which are involved almost in every aspect of the game, understanding the scripts is a key to understand the whole thing. All this scripts decompiled to a C-like code are published below, in order to view them we mostly use Notepad++, if you are going to use it then don't forget to select C syntax highlighter.
Included file #1: archive with decompiled scripts 35 MB (450 MB unpacked), last update 22 June 14
Included link #2: web storage with decompiled scripts
GTA V features ~4500 natives and almost all of these functions are in use in the original game scripts, this means that while building game's main executable only the natives required by the scripts are included (IV had ~3000 natives and the scripts were using only 2/3 of them). There is no original native name list in GTA V (IV had one), name hashes were used instead, however during our research we were managed to recover ~2600 native names using bruteforce and manual checking afterwards, the rest should be named in this topic. The good thing is that we know for sure how many parameters and results each one of these ~4500 natives has (because when script calls native it uses this values and all natives are in use). In order to put more understanding in whatever natives do they were grouped the way original developers grouped them (we should have done this for IV though), it makes code more readable and when you see an unknown native you already know which group it belongs to.
Included file #3: found native names list (~2600), (if you see collision with some native from from talkol's gta5hasher then gta5hasher one is incorrect), last update 22 June 14
Included file #4: <todo-link>group::native-hash list</todo-link>
# NATIVE NAMES
Since we are using native groups (namespaces) and a lot of natives require to be named we must stick to the simple native naming convention, which should be applied to any tool that uses natives in a way seen to a user.
Native naming convention
Template: GROUP :: (_)NAME (// 0xHASH)
1. All UPPERCASE letters
2. Starts with a GROUP name followed by ::
3. Custom named natives (name does not match hash) must have _ prefix before the NAME
4. Hash must present when custom name is used, it's optional for real names
PLAYER::GET_PLAYER_PED -- native with real name
PLAYER::PLAYER_ID -- native with real name as well
PLAYER::_PLAYER_ID // 0x8DD5B838 -- native with custom which does the same as PLAYER::PLAYER_ID
How to choose custom native name
1. Always start with _ prefix
2. Look at declarations of the known natives around yours (included file #5)
3. Make it simple and avoid long names
When you are mentioning custom natives please always specify the hash, because custom native names could be changed.
In order to find the names we are using well optimized template based native name bruteforce with multithread support. Description is in the readme.
Included file #6: multithreaded native bruteforce
# NATIVE GROUPS
Native group | native names found / total natives (using native names from included file #3, group order as in included file #5)