Giter Club home page Giter Club logo

Comments (4)

SergiusTheBest avatar SergiusTheBest commented on August 11, 2024

Thanks for reporting. We are looking into this.

from mhook.

Grivus avatar Grivus commented on August 11, 2024

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.

SergiusTheBest avatar SergiusTheBest commented on August 11, 2024

@rommar The issue should be fixed now. Please check the latest master.

from mhook.

rommar avatar rommar commented on August 11, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.