1 #ifndef MACH_MEMORY_HPP
 
   2 #define MACH_MEMORY_HPP
 
   4 static kern_return_t cy_vm_allocate(bool broken, vm_map_t target, mach_vm_address_t *address, mach_vm_size_t size, int flags) {
 
   6         return mach_vm_allocate(target, address, size, flags);
 
   7     vm_address_t address32;
 
   8     kern_return_t value(vm_allocate(target, &address32, size, flags));
 
  13 #define mach_vm_allocate(a, b, c, d) \
 
  14     cy_vm_allocate(broken, a, b, c, d)
 
  16 static kern_return_t cy_vm_deallocate(bool broken, vm_map_t target, mach_vm_address_t address, mach_vm_size_t size) {
 
  18         return mach_vm_deallocate(target, address, size);
 
  19     return vm_deallocate(target, address, size);
 
  22 #define mach_vm_deallocate(a, b, c) \
 
  23     cy_vm_deallocate(broken, a, b, c)
 
  25 static kern_return_t cy_vm_protect(bool broken, vm_map_t target_task, mach_vm_address_t address, mach_vm_size_t size, boolean_t set_maximum, vm_prot_t new_protection) {
 
  27         return mach_vm_protect(target_task, address, size, set_maximum, new_protection);
 
  28     return vm_protect(target_task, address, size, set_maximum, new_protection);
 
  31 #define mach_vm_protect(a, b, c, d, e) \
 
  32     cy_vm_protect(broken, a, b, c, d, e)
 
  34 static kern_return_t cy_vm_write(bool broken, vm_map_t target_task, mach_vm_address_t address, vm_offset_t data, mach_msg_type_number_t dataCnt) {
 
  36         return mach_vm_write(target_task, address, data, dataCnt);
 
  37     return vm_write(target_task, address, data, dataCnt);
 
  40 #define mach_vm_write(a, b, c, d) \
 
  41     cy_vm_write(broken, a, b, c, d)
 
  43 #endif//MACH_MEMORY_HPP