Posted: Wed Dec 23, 2015 4:27 am Post subject: [C#] Inject Opcode into game
I'm using C# to inject my ASM code into game to make the bot
My problem here is how to inject by C#?
I researched and my result are:
VirtualAlloc / VirtualAllocEX (I should use VirtualAlloc or VirtualAllocEX?
WriteProcessMemory
CreateRemoteTheard
WaitForSingleObject / WaitForMultipleObjects ( I should use WaitForSingleObject or WaitForMultipleObjects ?)
VirtualFree/ VirtualFreeEX
CloseHandle(Thread)
Is it right? Please help me, sorry if my english is not good
Afterward you may need the following API imports:
- VirtualAllocEx
- VirtualFreeEx
- VirtualProtectEx
- CreateRemoteThread
- WaitForSingleObject
- GetExitCodeThread
- WriteProcessMemory
In C# you don't need to use CloseHandle since the process namespace will handle that for you if you use the handle from that. You also don't need things like VirtualAlloc / VirtualFree since those are meant for the current process and not remote processes. (The Ex versions are meant for remote processes.)
If you are just looking to write things like nops or other simple patches you wont need CreateRemoteThread either.
As for WaitForSingleObject or WaitForMultipleObjects, you only need WaitForSingleObject since you are only creating a single handle (the thread if needed) and are waiting for that alone. _________________
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
Posted: Sat Dec 26, 2015 9:45 pm Post subject:
What do you mean by serialize? Since the API you listed is the common API for DLL injection, but nothing to do with any type of serialization. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum