JohnTitor / mach2

Apache License 2.0
32 stars 12 forks source link

define arm64_thread_state64_t and constants #15

Closed StephanvanSchaik closed 1 year ago

StephanvanSchaik commented 1 year ago

This PR adds the constants from mach/arm/thread_status.h and the arm64_thread_state64_t struct, and puts the code specific to x86_64 behind a x86_64 architecture gate. This also updates the example to dump process registers.

This also fixes a bug in the example where it calls free on the thread_list instead of mach_vm_deallocate. Finally, this also updates the README to explain how to run the example on MacOS 12.4 since the current example makes use of task_for_pid() which requires SIP to be disabled.

I have tested this on a Mac Mini (Apple M1) with MacOS 12.4.

JohnTitor commented 1 year ago

Could you resolve merge conflicts?

StephanvanSchaik commented 1 year ago

@JohnTitor should be ready for review now. I originally messed up the merge a bit, sorry about that.