I've got a whole bunch of lowlevel WiFi Hooks setup...
Just this one deals me trouble...
Code: Select all
// sceNetSendIfEvent - Equals if(arg1) sceKernelSignalSema(arg1 + 256, 1); return;
// Called 19. on Adhoc Search (Unknown... No Call Record)
result = hookAPI("sceNetInterface_Service", "sceNetIfhandle_driver", 0xF94BAF52, PSPNet_F94BAF52, 1);
I'm pretty much trying to analyse the low level WiFi stuff to get more into the whole reversal...
From what I can tell from its disassembly...
Code: Select all
; ======================================================
; Subroutine sceNetIfhandle_driver_F94BAF52 - Address 0x00001088
; Exported in sceNetIfhandle_driver
sceNetIfhandle_driver_F94BAF52:
0x00001088: 0x27BDFFF0 '...'' - addiu $sp, $sp, -16
0x0000108C: 0xAFBF0000 '....' - sw $ra, 0($sp)
0x00001090: 0x10800005 '....' - beqz $a0, loc_000010A8
0x00001094: 0x24050001 '...$' - li $a1, 1
0x00001098: 0x8C830000 '....' - lw $v1, 0($a0)
0x0000109C: 0xAC66010C '..f.' - sw $a2, 268($v1)
0x000010A0: 0x0C000C53 'S...' - jal ThreadManForKernel_3F53E640
0x000010A4: 0x8C640100 '..d.' - lw $a0, 256($v1)
loc_000010A8: ; Refs: 0x00001090
0x000010A8: 0x8FBF0000 '....' - lw $ra, 0($sp)
0x000010AC: 0x03E00008 '....' - jr $ra
0x000010B0: 0x27BD0010 '...'' - addiu $sp, $sp, 16
And last but not least... this is the function I'm hooking it to...
I do the hook via MIPS ASM Jumping... as the function gets called from a kernel context, thus syscalls aren't used...
Code: Select all
void PSPNet_F94BAF52(unsigned int semaid)
{
// Result
//int result = 0;
// Extend Access
// int k1 = pspSdkSetK1(0);
// Log Arguments
char log[256];
sprintf(log, "F94BAF52 (sceNetSendIfEvent): semaid: %u\n", semaid);
debuglog(log);
// Switch Semaphore
sceKernelSignalSema(semaid + 256, 1);
// Restore Access
// pspSdkSetK1(k1);
// Return Result
//return result;
}
Everytime the function is "executed" - pretty much nothing happens...
The game ends in some kind of endless loop... animations all run fine... just that it will never stop the Adhoc Game Scan... (It doesn't scan... just keeps looping there...)
The logs aren't executed aswell... or if they are... they aren't written to my debuglog...
I know setting the K1 register in kernel is nonsense, but I copied the template a whole lot of times for every hook I'm doing... so I just commented it out.
I'm looking forward to possible solutions or tips.
PS. I know the if(arg1 != NULL) check isn't in the hook function, but as the debuglog ain't executed... it shouldn't reach the later instruction anyway... so I didn't implement it yet.