Skip to content
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

<BUG>crash on jmp addr? #309

Open
swordno opened this issue Nov 23, 2023 · 1 comment
Open

<BUG>crash on jmp addr? #309

swordno opened this issue Nov 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@swordno
Copy link

swordno commented Nov 23, 2023

I encountered an application crash during the injection process while using the Detours library. The crash occurs consistently, and I am unable to proceed with my use case. I would appreciate any guidance or help in resolving this issue.

To Reproduce Steps to reproduce the behavior:

Set up the Detours library according to the documentation
Attempt to inject a DLL into a target process
Observe the crash during the injection process
Expected behavior I expected the injection process to complete successfully without any crashes or errors, allowing me to proceed with my use case.

OS: Windows 10
Compiler: Visual Studio 2010
Version of Detours library: both 4.0.1 and master
image
crash dmp & pdb
test.zip

@swordno swordno added the bug Something isn't working label Nov 23, 2023
@kweatherman
Copy link

kweatherman commented Feb 14, 2024

Debug it.
Put a break point on your hook function and on the hook target.
Or put a DebugBreak(); at the top of your hook function .

Run your project in VisualStudio, or if you can't setup your HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ for your target executable so your debugger attaches automatically.
Web search on how to do this.

Right after you apply your hook, point your disassembly view to the hook address.
Does it look right?

Also why are you applying a JMP5 hook yourself. Why not use Detours DetourAttach or something and let it do the hooking?

Anyhow my questions are really rhetorical (ones you need to answer for yourself first). you need to figure out what is going on in your code and how you do that is to step through it with a debugger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants