Editing NID

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
= NID generation =
= NID generation =


A way to generate a few sort of NIDs was found in 0.945 PSVita armlibgen.exe, and in 3.00 PS3 ppu-lv2-prx-libgen.exe:
== PS3 NIDs ==


<source lang="C">
=== PS3 exports ===
uint32_t nid = sha1(concat(name, suffix));
</source>
 
Suffixes can be found [https://psdevwiki.com/vita/index.php?title=Keys here], [https://www.psdevwiki.com/ps3/Keys#Modules here] and [https://wiki.henkaku.xyz/vita/NID here].
 
== PSP ==


PSP NIDs had no suffix until a certain System Software version around 3.50.
ps3_nid_suffix: 6759659904250490566427499489741A
 
Since that version, the suffixes are unknown.
 
== PS3 ==
 
=== Regular exports ===


To calculate FNID value of exported/imported symbol from .PRX you need to take SHA-1 hash over concatenation of symbol's name and ps3_nid_suffix and then grab first 4 bytes from it and reverse these bytes (because of little-endian).
To calculate FNID value of exported/imported symbol from .PRX you need to take SHA-1 hash over concatenation of symbol's name and ps3_nid_suffix and then grab first 4 bytes from it and reverse these bytes (because of little-endian).
Line 31: Line 19:
_Mbstatet>, std::_Iosb<int>::_Openmode)')) = FNID('_ZNSt13basic_filebufIwSt11char_traitsIwEE7seekposESt4fposISt9_MbstatetENSt5_IosbIiE9_OpenmodeE') = '''0xB6A4D760'''
_Mbstatet>, std::_Iosb<int>::_Openmode)')) = FNID('_ZNSt13basic_filebufIwSt11char_traitsIwEE7seekposESt4fposISt9_MbstatetENSt5_IosbIiE9_OpenmodeE') = '''0xB6A4D760'''


=== NONAME exports ===
=== PS3 NONAME exports ===
 
ps3_noname_nid_suffix: 0xbc5eba9e042504905b64274994d9c41f


For import stubs with no names, you must use SHA1 over concatenation of symbol's name and ps3_noname_nid_suffix as an ascii string. Some examples of noname imports are module_start, module_info, and module_stop.
For import stubs with no names, you must use SHA1 over concatenation of symbol's name and ps3_noname_nid_suffix as an ascii string. Some examples of noname imports are module_start, module_info, and module_stop.
''SHA1''('module_info' + ps3_noname_nid_suffix) = '''1630f4d7'''0bf3df419db9d481983411fd3130482a = '''0xD7F43016'''
''SHA1''('module_info' + '0xbc5eba9e042504905b64274994d9c41f') = '''1630f4d7'''0bf3df419db9d481983411fd3130482a = '''0xD7F43016'''


== PS Vita ==
== Generation code ==
 
=== Regular exports ===
 
Suffix is per-library. Some old PS Vita modules use suffixless NIDs.
 
=== NONAME exports ===
 
Suffix is known from PS Vita armlibgen.exe executable reverse-engineering.
 
= NID generation code =


Here is some code in C# with the example "sys_crash_dump_get_user_log_area":
Here is some code in C# with the example "sys_crash_dump_get_user_log_area":
Line 64: Line 44:
</source>
</source>


 
{{Development}}<noinclude>[[Category:Main]]</noinclude>
{{Development}}
<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)