3

I am trying to inject a C++ detour dll using a C# application using Syringe. Here is what I have so far:

-A dll to inject which hook both recv/send from wsock32.dll and log the communication (http://pastebin.com/JvnmYuz0)

-A C++ loader which start the target application then load the dll to it ( pastebin . com/mX68nTnx) //Sorry, I cant post more than 2 links

-A C# app that inject the dll in any process (http://pastebin.com/FLRj45YF)

But I am having some problems:

1- I do not want to use the c++ loader to start the application then inject the dll, I use it only to test the dll hooking, and it is working well, it does hook and log to file the communication

2- I want to inject the c++ dll (in any process I want) using a c# application (using Syringe). I can inject it with no problems, but it does not hook the recv/send functions as it does when started with the c++ loader, however, it says that everything was attached successfully, but it does not log anything to the file, not even call MyRecv/MySend. I once received error 8 (ERROR_NOT_ENOUGH_MEMORY) from DetourTransactionCommit() while detouring send/recv functions, but now it says there is no error

3- After being able to handle the communication using MySend/MyRecv, I want to send the communication back to the C# application then do the work there.

I am very new at c++ and dll injecting but I have some experience with c#. It does not need to necessary use the syringe method to inject. I have tried to use EasyHook without success. Any injecting method will be great, as long as I can inject the dll to any process then work the communication on a C# application. I do not want to do the work on the C++ dll because I am very new to C++ and it seems to be very very hard to do simple things, the learning curve is not very friendly

thanks

PS: I do not want to hack anything/anyone, I just want to create a Ultima Online tool

Feeh
  • 33
  • 1
  • 5

0 Answers0