Hello everyone,
I have a tweak that patches some memory in an app. On my iPhone 7 with iOS 14 and checkra1n it works perfectly. The code looks like this
void (*_mySymbol)();
MSHookSymbol(_mySymbol ,"_mySymbol",NULL);
const uint8_t data[] = {
0x1,0x0,0x0,0x0
};
kern_return_t err = KERN_SUCCESS;
mach_port_t port = mach_task_self();
vm_address_t address = (uintptr_t) _mySymbol;
err = vm_protect(port,(vm_address_t)address, sizeof(data),false,VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY);
if (err != KERN_SUCCESS)
{
NSLog(@"false");
return;
}
err = vm_write(port,address,(vm_address_t) &data,sizeof(data));
When I now want to run this tweak on my A12 device (with unc0ver), MSHookSymbol just returns an address that is out of region. So I guess I have to calculate a different offset, but I don't really know what I'm missing and what I should do. Anyone knows what I have to do differently here for the A12 device?