refactor: Update SceInit stub with the discovered names for functions#351
refactor: Update SceInit stub with the discovered names for functions#351sharkwouter merged 2 commits intopspdev:masterfrom
SceInit stub with the discovered names for functions#351Conversation
sharkwouter
left a comment
There was a problem hiding this comment.
Looks good, thanks @GrayJack!
| * | ||
| * @return System call number if `>= 0`, `< 0` on error. | ||
| */ | ||
| int sceKernelQuerySystemCall(void *function); |
There was a problem hiding this comment.
if a function pointer is expected, shouldn't we use a proper function prototype for the callback?
either using a typedef or fully inline as in e.g. qsort: void qsort(void *base, size_t nel, size_t width, int (*compar)(const void *, const void *));
There was a problem hiding this comment.
unless this works like e.g. scnum = sceKernelQuerySystemCall(sceKernelQuerySystemCall); in which case the function documentation is kinda lacking/misleading. if so it would also be interesting to know what the result is good for and how it can be used.
There was a problem hiding this comment.
The thing is, there is no way do descrive a system call function "shape" (case in point: sceIoRead and sceKernelRegisterExitCallback are both syscalls, but they don't share the same number of arguments, these arguments don't have the same types, in this case the return type is the same, but could be different)
There was a problem hiding this comment.
if so it would also be interesting to know what the result is good for and how it can be used
It can be used to know if a given function is exported as syscall, it also can be used to create a system call instruction to insert in a module to patch it. You can give a look into the ARK or Adrenaline implementation of sctrlHookImportByNID to see it being used to both check the function is exported as syscall and to create and patch a syscall instruction
No description provided.