@@ -39,8 +39,7 @@ int snprintfHook(char *str, size_t size, const char *format, ...)
3939 va_list args ;
4040
4141 ps4KernelThreadGetCurrent (& td );
42- // !!! do not use format => strlen inf. loop => crash !!!
43- ps4KernelSocketPrint (td , sock , "%p %zu " , str , size );
42+ //ps4KernelSocketPrint(td, sock, "%p %zu ", str, size);
4443 va_start (args , format );
4544 ps4KernelSocketPrintSizedWithArgumentList (td , sock , size , format , args );
4645 va_end (args );
@@ -75,7 +74,13 @@ int printfHook(const char *format, ...)
7574
7675int kern_closeHook (struct thread * td , int fd )
7776{
78- ps4KernelSocketPrint (td , sock , "%p %i\n" , td , fd );
77+ Ps4KernelFunctionHookArgument * arg ;
78+ // hidden-argument-jutsu - do this as the first call thou!
79+ // also allows you to interrupt via return and set a return via arg
80+ // maybe that should switch around ... ? -> issue
81+ ps4KernelThreadGetSecondaryReturn (td , (register_t * )& arg );
82+
83+ ps4KernelSocketPrint (td , sock , "%p %p %i\n" , td , arg -> function , fd );
7984 return PS4_KERNEL_FUNCTION_HOOK_CONTROL_CONTINUE ;
8085}
8186
@@ -91,6 +96,8 @@ int indexHook(const char *s, int c)
9196
9297int genericHook (struct thread * td , Ps4KernelFunctionHookArgument * arg )
9398{
99+ // The current type returns 0,1 for now.
100+ // This will be changed to the same control values observed in function hooks (need to do it in asm ...)
94101 ps4KernelSocketPrint (td , sock , "Type %p:\n" , arg -> hookTypeCurrent );
95102
96103 ps4KernelSocketPrint (td , sock , "%p(%p, %p, %p, %p, %p, %p) %p\n\t => %p %p %p %p %p %p\n" ,
@@ -150,7 +157,7 @@ void socketPrintHook(struct thread *td, Ps4KernelSocket *s, Ps4KernelFunctionHoo
150157 "\tfree: %p\n"
151158 "\tmt: %p\n"
152159 "\tuserArgument: %p\n"
153- "}\n" ,
160+ "}\n"
154161 "* = This is will not show per-hook runtime values due to the lock-less design.\n" ,
155162 arg ,
156163 arg -> function ,
0 commit comments