-
Notifications
You must be signed in to change notification settings - Fork 22
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
RawDetours not working on Windows #59
Comments
Sounds like that may be UB in the source code. I know I was testing MIRI on one of the dependencies (I think it was slice-pool, but I'd have to go back and double check) I forked and it flagged a couple things, so it may be that. I've been wanting to use MIRI on this repo, but I'd need to override all FFI with some sort of mocks to actually run it. I'll try to look into it this week if I have time. If I can't catch it with MIRI, I may have to objdump debug vs release builds. |
Alright, if you make any progress, lmk. I tried to compile and run with the GNU toolchain for x64 and that seems to work, but has its own set of issues which make opt-level = 0 a better workaround. |
Well I found 1 workaround: Store the hook in a structure with other data if you need that, or leak it to a |
I looked at this a bit back in Sept, but got busy. Had some time and am looking into this again. I can't seem get Also spent a fair bit of time trying to get MIRI to work too, but because functions aren't directly allocated by the rust allocator, it's treated as unallocated memory by MIRI (and it can't know the size of the actual function either). May be able to get around it with a custom allocator that I can "fake" allocate functions before using function pointers, but that may not fully work with MIRI either. |
Creating a new standard .exe project on Windows with the
RawDetour
example from the docs and running it in release-mode fails.The only mitigation for this that I have found, is to use
opt-level = 0
- which for obvious reasons, is not exactly the best approach.StaticDetours seem to be unaffected, GenericDetours share the same issue.
@Hpmason
The text was updated successfully, but these errors were encountered: