Can anybody help me with using these syscalls? I'm trying to write an app that redirects /app_home to /dev_usbxxx, the code I'm using for the syscalls is:
The read method I found on a public pastebin, the write one I wrote myself. Through testing using this code:Code:uint64_t lv2Read64(uint64_t address) { register uint64_t p1 __asm__ ("3") = address; register uint64_t n __asm__ ("11") = 6; __asm__ volatile ( "sc" : "=r" (p1) : "r" (p1), "r" (n) : "0", "12", "lr", "ctr", "xer", "cr0", "cr1", "cr5", "cr6", "cr7", "memory"); return p1; } void lv2Write64(uint64_t address, uint64_t data) { register uint64_t p1 __asm__ ("3") = address; register uint64_t p2 __asm__ ("4") = data; register uint64_t n __asm__ ("11") = 7; __asm__ volatile ( "sc" : : "r" (p2), "r" (p1), "r" (n) : "0", "12", "lr", "ctr", "xer", "cr0", "cr1", "cr5", "cr6", "cr7", "memory"); }
I found that the read method doesn't work, it seems to return garbage.Code:uint64_t addr = start; bool found = false; while( addr != end ) { if(lv2Read64(addr) == appHome) { found = true; lv2Write64(addr - 3, devUsb0); lv2Write64(addr, devUsb006); } else if(lv2Read64(addr) == devUsb006) { found = true; lv2Write64(addr - 3, appHomeFull); lv2Write64(addr, appHome); } addr += 0x100; }
The payload I'm using definitely has the syscalls, seeing as LV2Dump works.
Has anybody here tried to use the syscalls and managed to do it successfully? If so can you give me a hand
Many thanks


LinkBack URL
About LinkBacks






