Code Monkey home page Code Monkey logo

Comments (5)

nblog avatar nblog commented on June 26, 2024

ZyrexCalculateRelativeOffset(length, (ZyanUPointer)address,
address value error.

maybe like this.
#L568

        // Write opcode
        ZyanU8* address = (ZyanU8*)context->destination + context->bytes_written;
        ZyanUPointer ptr = (ZyanUPointer)address;
        if (opcode == 0xE9)
        {
            *address++ = 0xE9;
        } else
        {
            *address++ = 0x0F;
            *address++ = opcode;
        }

        // Write relative offset
        *(ZyanI32*)(address) = 
            ZyrexCalculateRelativeOffset(length, ptr,
                instruction->absolute_target_address);

from zyan-hook-engine.

flobernd avatar flobernd commented on June 26, 2024

Thanks for reporting. I will have a look later. It’s very possible that the 32-bit hooking is still off a bit because I mainly tested on 64-bit for now.

A first stable version is expected to be released in the next two weeks.

from zyan-hook-engine.

flobernd avatar flobernd commented on June 26, 2024

@nblog
I was not able to reproduce the problem on my local branch - but I already made some changes, so it might have been fixed in the meantime.

Probably going to push my local changes on the weekend after some cleaning.

from zyan-hook-engine.

nblog avatar nblog commented on June 26, 2024

I have tested the error still exists
The reason for the error is when you calculate the relative address
#L581 ZyrexCalculateRelativeOffset source_address = address
And you were address ++ at #L572, and #L575 #L576.
The calculated relative offset is also wrong
The correct approach should be to save the address once after #L569

        // Write opcode
        ZyanU8* address = (ZyanU8*)context->destination + context->bytes_written;
        ZyanUPointer ptr = (ZyanUPointer)address;
        if (opcode == 0xE9)
        {
            *address++ = 0xE9;
        } else
        {
            *address++ = 0x0F;
            *address++ = opcode;
        }

        // Write relative offset
        *(ZyanI32*)(address) = 
            ZyrexCalculateRelativeOffset(length, ptr,
                instruction->absolute_target_address);

from zyan-hook-engine.

flobernd avatar flobernd commented on June 26, 2024

Sorry I am busy with work at the moment and had no time to finish my changes. I just pushed my local progress which definitely does not have the problem you describe. Might have other issues tho .. still work in progress.

from zyan-hook-engine.

Related Issues (5)

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.