Skip to content

refactor: Update SceInit stub with the discovered names for functions#351

Merged
sharkwouter merged 2 commits intopspdev:masterfrom
GrayJack:update/init2
Jan 20, 2026
Merged

refactor: Update SceInit stub with the discovered names for functions#351
sharkwouter merged 2 commits intopspdev:masterfrom
GrayJack:update/init2

Conversation

@GrayJack
Copy link
Contributor

No description provided.

Copy link
Member

@sharkwouter sharkwouter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @GrayJack!

@sharkwouter sharkwouter merged commit 31f2574 into pspdev:master Jan 20, 2026
1 check passed
*
* @return System call number if `>= 0`, `< 0` on error.
*/
int sceKernelQuerySystemCall(void *function);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 *));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Contributor Author

@GrayJack GrayJack Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants