C
C#3w ago
Ricky

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?
No description
9 Replies
Ricky
RickyOP3w ago
This is the method need to be replaced.
No description
Ricky
RickyOP3w ago
This is injected code.
No description
Ricky
RickyOP3w ago
This is the DLL to be injected.
No description
Evyr
Evyr3w ago
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
Ricky
RickyOP3w ago
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?
Evyr
Evyr3w ago
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?
Ricky
RickyOP3w ago
Yes
Evyr
Evyr3w ago
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?
Ricky
RickyOP3w ago
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

Did you find this page helpful?