-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when calling reentry/original function (latest Yosemite GM, 10.9.5) #6
Comments
Hi Nuno, I've just came across the same issue (I'm on 10.9.5). I guess Apple may have changed something in their latest releases for both 10.9 and 10.10. This x86_64 hack is very old and I really should have fixed it months ago… Anyway, the reason of this hack is that mach_vm_address_t seg_target = *new_location + (seg_source - header);
^^^^^^^^^^^^^^^^^^^
negative value That's what I've added a „leftover hack“ for: to allocate a safety zone before the actual For some reasons One possible solution for the problem is to allocate a separate memory zone for each segment, and use an address of I'm quite sure that your patch is enough to solve the problem with a reentry function you have. But I'm not sure about these unpredictable crashes… It would be great if you could reproduce them. |
@nfgrilo please check if this solution works for you: |
@rodionovd, thank you so much for looking into this so quickly, and for your detailed explanation! Also, I have been playing with your fix from the branch, and so far so good! Applications doesn't crash when calling the reentry function, Quicktime Player doesn't crash when calling Thank you sooooo much! Since I'm relying and playing a lot with your Loving your rd_route project 😋 |
Thank you very much, @nfgrilo! I really appreciate you effort to help the project ✌️ Looking forward for your further feedback. |
* Fix a bug with __DATA segement remapping (#6) * Minor code changes: add asserts, replace #imports with #includes, add extern "C" wrapper for C++ compatibility;
Hi!
Thank you so much for this project! I was previously using mach_override, but since I found rd_route, I have switched!
I noticed that at some point (OS X 10.10 DP5 or DP6), calling the reentry function crashes the application. One quick and dirty workaround I found, was to change the _remap_image() function, changing the existing x86_64 hack:
err = mach_vm_allocate(mach_task_self(), new_location, image_size*3, VM_FLAGS_ANYWHERE); mach_vm_size_t lefover = image_size * 2;
to:
err = mach_vm_allocate(mach_task_self(), new_location, image_size*4, VM_FLAGS_ANYWHERE); mach_vm_size_t lefover = image_size * 3;
That (apparently) fixed, but it looks like apps still crash after some time.
One thing that may or not be related, if I injected myself on Quicktime Player (OSX 10.10 too), app crashes immediately when calling rd_route() (at
_patch_memory + 178 (rd_route.c:306)
).Hope this helps!
Thank you,
Nuno
The text was updated successfully, but these errors were encountered: