Hi all,
I'm new with psp programming so, please be patient if my questions are banal.
In some posts I found some reference to NID.
Seems that NID is used for hooking sce function.
I'm not sure to have understood so, I'm going to post some simple answer:
- What is NID ?
- Where is NID (how I discover it, with wich tools) ?
- Why I shoud hook a sce function ?
- How I coul hook a function ?
Thanks all !
What is NID, how I could get and why
-
- Posts: 91
- Joined: Sun Feb 22, 2009 8:32 am
- Location: Melbourne Australia ZOMG
Q1: Well, a nid is the memory address 0x000000 etc. to a reference to a firmware function
Q2: http://silverspring.lan.st/
Q3: You should hook a function is you want to track the usage, do something before the function executes etc.
Q4: Search this forum "easy hook example"
Q2: http://silverspring.lan.st/
Q3: You should hook a function is you want to track the usage, do something before the function executes etc.
Q4: Search this forum "easy hook example"
Q1: A NID is just a 32-bits function ID for the kernel to recognize it and resolve it on the ELF imports. It's the SHA1 hash for the function name. Each NID is unique (hopefuly) and it's related to an export library, which in turn is related to PRX modules.
Last edited by m0skit0 on Thu Aug 13, 2009 8:50 pm, edited 1 time in total.
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
-
- Posts: 91
- Joined: Sun Feb 22, 2009 8:32 am
- Location: Melbourne Australia ZOMG
-
- Posts: 388
- Joined: Tue Aug 12, 2008 12:46 am
A nid isn't really "unique" for each function since its some of the nids are randomize since 3.71 (or 3.60 i think). Only some of the nids are a 32 bit ID sha-1 (including in the unofficial pspsdk).m0skit0 wrote:Q1: A NID is just a 32-bits function ID for the kernel to recognize it and resolve it on the ELF imports. It's the SHA1 hash for the function name. Each NID is unique (hopefuly) and it's related to an export library, which in turn is related to PRX modules.
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
I think you meant only some functions got their NID randomized. You can try this links to see what i'm saying:
Function name & NID for 5.00 FW:
http://prxlibdocs.dark-alex.org/5.00/index.html
Online SHA1 calculator
http://sha1-hash-online.waraxe.us/
Take any resolved function name (that is, things like sceUsbBus_driver_48CCE3C1 are just library name + NID and not the real function name, so it doesnt work), put it in the text box, click "calculate hash" button and compare first 4 bytes of hash to function's NID in reverse order: compare first byte of hash with last byte of NID and so on.
Let me know when you find one that doesn't coincide.
Function name & NID for 5.00 FW:
http://prxlibdocs.dark-alex.org/5.00/index.html
Online SHA1 calculator
http://sha1-hash-online.waraxe.us/
Take any resolved function name (that is, things like sceUsbBus_driver_48CCE3C1 are just library name + NID and not the real function name, so it doesnt work), put it in the text box, click "calculate hash" button and compare first 4 bytes of hash to function's NID in reverse order: compare first byte of hash with last byte of NID and so on.
Let me know when you find one that doesn't coincide.
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
All NIDs used to be just the SHA1 hash of the function name... emphasis on used to be. User functions still are since Sony clearly can't change the user functions. However, in an effort to defeat custom firmware, Sony started randomizing the kernel function NIDs starting at 3.70. Not all kernel functions either, just many of the ones custom firmware relies on.
So user function NIDs will still match the SHA1 hash of the name, but many of the kernel function NIDs won't.
So user function NIDs will still match the SHA1 hash of the name, but many of the kernel function NIDs won't.
-
- Posts: 388
- Joined: Tue Aug 12, 2008 12:46 am