Comments (4)
Thanks for reporting. We are looking into this.
from mhook.
Hi, @rommar!
Could please anyone comment on this situation? Is this a known behavior?
First of all, it's a known situation, yes.
To hook some function mhook takes first 5 bytes of that function, save them to some memory location, and instead of them, write the jump to our hook (MyXXXFunction).
After our hook execution, (when you do return OriginalFuncPtr()) it jumps first to saved first 5 bytes of function, execute them, and then jumps back to original function code.
The problem with some call and jump instructions is they use address relative to the next statement, and we can't just move that instructions to another place without breaking the logic.
Originally mhook will just fail to hook functions with such instructions in the beggining.
Is there any drawback of such modification?
So the drawback of your modification is that you will call not original USER32.DestroyCaret after your hook, but something else instead. I would not recomend to do this.
I will investigate the case with DestroyCaret, most probably we will add the logic that fix relative addressing for calls.
from mhook.
@rommar The issue should be fixed now. Please check the latest master.
from mhook.
@SergiusTheBest @Grivus Wow, you are so fast! I confirm that it is working now for both x86 and x64 builds. Thank you!
from mhook.
Related Issues (14)
- VirtualAlloc hooking reports anomaly HOT 6
- so many printf logs HOT 1
- How to work with it? HOT 8
- Request: Integration to Ms/vcpkg
- Breaking on unsupported RIP-addressing? HOT 11
- Supporting arm64 architecture HOT 2
- Hooking CopyFileA/W HOT 5
- Potential access NULL pointer in mhook.c HOT 8
- Hooking at one specific address and calling the original function causes a crash. HOT 2
- 2 compiler errors when compiling with MingW on Windows and suggested fixes HOT 3
- Support Windows for Arm64
- Add AppVeyor CI
- Why do I need a DLL to use this? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mhook.