Skip to content

Question: Setting "target" to an address #2

Answered by segevfiner
DizzyThermal asked this question in Q&A
Discussion options

You must be logged in to vote

target can indeed just be a Python int pointer, when you pass a ctypes function object, it just casts it into the raw pointer. Note that minhook is built around inline assembly hooks, meaning it needs to be some code address, often the start of a function, if it's a function pointer (data) you are trying to hook, then you can just hook it to a ctypes function directly by getting the appropriate address and writing it yourself. Or just hook GetAsyncKeyState itself in user32.dll, assuming the program isn't doing anything weird, that should hook all calls to GetAsyncKeyState in the process. You can do that by just getting
the GetAsyncKeyState from ctypes and using that as the target.

Also no…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by segevfiner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1 on August 09, 2022 08:34.