lightweight ios mach memory utility header
Find the first base:
uintptr_t base = KMEM::scanner::FindFirstBase();Reinterpret cast _dyld_get_image_header(0):
uintptr_t base = KMEM::scanner::ReturnBase();Get the base from a framework name:
uintptr_t base = KMEM::scanner::GetImageBase("UnityFramework");Only works if FindFirstBase is successful:
uintptr_t address = KMEM::io::GetAddress(0x123);uintptr_t address = KMEM::io::GetAddress("framework", 0x123);if (KMEM::io::IsValidPointer(address)) { }int value = KMEM::io::ReadMem<int>(address);KMEM::io::WriteMem<int>(address, 100);std::string text = KMEM::io::ReadString(address, 64);uintptr_t rawValue = KMEM::io::ReadRaw(address);KMEM::io::WriteRaw<int>(address, 100);uint8_t buffer[32]{};
KMEM::io::ReadBytes(address, buffer, sizeof(buffer));const uint8_t bytes[] = { 0x90, 0x90, 0x90 };
KMEM::io::WriteBytes(address, bytes, sizeof(bytes));