Giter Site home page Giter Site logo

Wrong ID for SetTexture on d3d9 about kiero HOT 4 CLOSED

rebzzel avatar rebzzel commented on July 3, 2024
Wrong ID for SetTexture on d3d9

from kiero.

Comments (4)

DevCortez avatar DevCortez commented on July 3, 2024 1

This is because DirectX is a C compatible project (look at d3d9.h for example), and in C __thiscall does not exist, so this is passed as a normal function argument.
For normal C++ interfaces, this will always be passed to ecx (unless we take into account some compiler optimization cases).

Living and learning :) Thanks for the explanation, ill close the issue to keep things clean.

from kiero.

Rebzzel avatar Rebzzel commented on July 3, 2024

Hello, @DevCortez.

Hmm, interesting. I don't know what this might be related to. Try to find out what _FP means.
But I think these functions are the same.
Also, I don't think you need to worry about this, because the program will still call 65 when it calls SetTexture.

Have a nice day!

from kiero.

DevCortez avatar DevCortez commented on July 3, 2024

Yeah, it seems the application i'm trying to hook just doesn't call settexture the way i expected it to, there is something very shady going on but i guess you are right, in fact, the vftable seems to be just right (at least the semantic of it).

One peculiar detail i noticed tho and i'm not sure where i could ask you that so ill take the opportunity: You treat functions as _stdcall and set the first parameter as this, in the code i always see a plus 4 in the ret (a function with 2 args rets 0xC for instance), do you know if this is consistent with interface methods? Its a bit of an oddity because i expected it to be on ECX as usual (even prepared myself to inline a correction to set ecx to a variable on detours).

from kiero.

Rebzzel avatar Rebzzel commented on July 3, 2024

This is because DirectX is a C compatible project (look at d3d9.h for example), and in C __thiscall does not exist, so this is passed as a normal function argument.
For normal C++ interfaces, this will always be passed to ecx (unless we take into account some compiler optimization cases).

from kiero.

Related Issues (20)

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.