Jump to content

1 post in this topic

Recommended Posts

Posted

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?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines