C++ Dll Injection

后端 未结 1 437
鱼传尺愫
鱼传尺愫 2020-12-17 05:36

I would really appreciate your help in this.

I have been trying to get a Dll injected into a remote process and do a few changes inside it, the problem I\'m encounte

相关标签:
1条回答
  • 2020-12-17 06:04

    You don't have to write a DLL to change another process's memory at a fixed address. You can use WriteProcessMemory().

    However... The way to inject a DLL into another process is the following...

    1. Use VirtualAllocEx() to allocate the length of the file path to the DLL inside the target process's memory... This is like remotely doing a malloc.

    2. Use WriteProcessMemory() to copy the file path to the DLL into what was returned from the previous step. This is like remotely doing a strcpy.

    3. Use CreateRemoteThread(). You can point it at LoadLibrary() as the entry point and the file path from steps 1 and 2 as the argument. That's a bit hacky, to be honest, but if you are injecting a DLL you're already being quite hacky. Another technique would be to use steps 1 & 2 to load some machine code into the remote proceess and point it at that.

    Keep in mind that this technique is a great way to destabilize the target process. In particular, this isn't something I'd do in a product that ends up getting shipped to others.

    0 讨论(0)
提交回复
热议问题