EasyHook issue
Has anyone here used EasyHook?
I have a scenario:
Computer A runs a program ProcessA and keeps calling a method MethodA. However, for some reason, MethodA cannot take effect.
But I have another computer B that can run a program and call MethodB and send the result back to A through TCP.
But it is necessary to replace MethodA on computer A. After looking up some information, I found that it can be implemented by using Hook.
So, I write a dll on computer A to communicate with computer B and call MethodB. Then I use EasyHook to write an injection tool to inject this dll into the process ProcessA and replace MethodA of ProcessA with HarmonyLib.
But there is a problem during injection: I also checked StackOverflow but didn't find an answer. Can any expert help take a look?
9 Replies
This is the method need to be replaced.
This is injected code.
This is the DLL to be injected.
I struggle to come up with any reason why you'd need to go to these lengths other than to try and bypass an anticheat
Because there is a problem that a equipment lacks an instrument, I want to use a another instrument to replace it.
But I don't have the source code for this equipment, I know the method for that device through decompilation, but I want to replace the instrument with another instrumnet.
How should I make this work or is there any way to achieve this goal?
So just in case I'm misinterpreting this, you're running a process on computer A to inject code into another process, where that code is fetched from another machine?
Yes
why do you need to fetch that code from another computer, instead of including it with the process that'll already run on computer A?
Because the replacement instrument and the another computer are one machine, I can't separate that.
And the problem now lies in the injection failure
The TCP can work normally