Xoff
Xoff

Reputation: 366

vm_region not found

On osx, I made a small program to edit the memory of my process (mainly to cheat in flash games). I tried to recompile this program after a long time, and I realized I upgraded my os (and changed my laptop) and something changed. Now I am on 10.7.5

I have a link error :

Undefined symbols for architecture x86_64:
   "_vm_region", referenced from:
...

But I did not find any linkable library to get the vm_region function. And I don't have any man page installed for vm_region and most of the /usr/include/mach section !

Any advice to be able to recompile that program ? And where can I find those man pages ?

Upvotes: 2

Views: 1550

Answers (2)

Codi Marker
Codi Marker

Reputation: 49

I had this error message pop up when I was trying to use 'vm_region' on a 64bit process and should have been using 'vm_region_64' with the appropriate params

mach_msg_type_number_t info_count = VM_REGION_BASIC_INFO_COUNT_64;

Upvotes: 1

Technologeeks
Technologeeks

Reputation: 7907

That'd be mach_vm_region you are looking for, Xoff. The APIs have been renamed in 10.5. so vm_* APIs become mach_vm_*. The "_" is just the linker symbol prefix. do a search/replace, and it should work. You might also need to tweak the header to . The APIs themselves are (intentionally) undocumented, save for a few HTML man pages packaged along with the kernel source (the XNU package from opensource.apple.com).

Upvotes: 3

Related Questions