@@ -169,6 +169,12 @@ PAYLOAD_CODE void install_syscall(uint32_t n, void *func)
169169 p -> sy_thrcnt = 1 ;
170170}
171171
172+ PAYLOAD_CODE void * get_syscall (uint64_t n )
173+ {
174+ struct sysent * p = & SYSENT [n ];
175+ return p -> sy_call ;
176+ }
177+
172178int sys_proc_info_handle (struct proc * p , struct sys_proc_info_args * args )
173179{
174180 args -> pid = p -> pid ;
@@ -307,8 +313,7 @@ PAYLOAD_CODE int sys_dynlib_load_prx_hook(struct thread *td, struct dynlib_load_
307313{
308314 int r = sys_dynlib_load_prx (td , args );
309315 // https://github.com/OpenOrbis/mira-project/blob/d8cc5790f08f93267354c2370eb3879edba0aa98/kernel/src/Plugins/Substitute/Substitute.cpp#L1003
310- const char * ttemp = (const char * )((uint64_t )td -> td_proc + 0x390 );
311- const char * titleid = ttemp ? ttemp : "?" ;
316+ const char * titleid = td -> td_proc -> titleid ;
312317 const char * p = args -> prx_path ? args -> prx_path : "" ;
313318 printf ("%s td_name %s titleid %s prx %s\n" , __FUNCTION__ , td -> td_name , titleid , p );
314319 if (strstr (p , "/app0/sce_module/libc.prx" ))
@@ -340,7 +345,6 @@ PAYLOAD_CODE int sys_dynlib_load_prx_hook(struct thread *td, struct dynlib_load_
340345 // dummy process to load server prx into
341346 else if (strstr (p , "/common/lib/libSceSysmodule.sprx" ) && strstr (td -> td_name , "ScePartyDaemonMain" ))
342347 {
343- const int handle_out = args -> handle_out ? * args -> handle_out : 0 ;
344348 struct dynlib_load_prx_args my_args = {};
345349 int handle = 0 ;
346350 // TODO: Upload this file to disk
@@ -364,7 +368,7 @@ PAYLOAD_CODE int sys_dynlib_load_prx_hook(struct thread *td, struct dynlib_load_
364368 proc_rw_mem (td -> td_proc , (void * )init_env_ptr , sizeof (jmp ), jmp , 0 , 1 );
365369 proc_rw_mem (td -> td_proc , (void * )(init_env_ptr + sizeof (jmp )), sizeof (plugin_load_ptr ), & plugin_load_ptr , 0 , 1 );
366370 }
367- printf ("%s init env 0x%lx plugin load 0x%lx\n" , ttemp , init_env_ptr , plugin_load_ptr );
371+ printf ("%s init env 0x%lx plugin load 0x%lx\n" , titleid , init_env_ptr , plugin_load_ptr );
368372 }
369373 return r ;
370374}
@@ -381,8 +385,6 @@ PAYLOAD_CODE void install_syscall_hooks()
381385 install_syscall (107 , sys_proc_list );
382386 install_syscall (108 , sys_proc_rw );
383387 install_syscall (109 , sys_proc_cmd );
384- printf ("sys_dynlib_load_prx %p\n" , sys_dynlib_load_prx );
385- printf ("sys_dynlib_dlsym %p\n" , sys_dynlib_dlsym );
386388 if (sys_dynlib_load_prx && sys_dynlib_dlsym )
387389 {
388390 install_syscall (594 , sys_dynlib_load_prx_hook );
0 commit comments