TheCruZ / Simple-Manual-Map-Injector

Simple C++ DLL Manual Map Injector For x86 and x64
MIT License
378 stars 82 forks source link

CS:GO crashes when injecting #1

Closed ghost closed 3 years ago

ghost commented 3 years ago

I tried to inject this simple DLL into CS:GO, but CS always crashes.

#include <Windows.h>

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
        case DLL_PROCESS_ATTACH:
            MessageBox(NULL, L"Hello World!", L"Dll says:", MB_OK);
            break;
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
        case DLL_PROCESS_DETACH:
            break;
    }
    return TRUE;
}

I ran it with Injector-x86.exe test.dll csgo.exe

Process pid: 17352
Mapping...
File ok
Data allocated
My shellcode pointer 01151E40
Target point 23700000
Press any key to continue . . .
Thread created at: 23700000, waiting for return...
Process crashed, exit code: -1073741819
Error while mapping.
Press any key to continue . . .
TheCruZ commented 3 years ago

I don't know if CSGO have any protection vs remote thread creation, you should try to compile a simple application and inject the dll there, if it works probably csgo have some protection, if don't work in that compiled application get the sellcode ptr and make a breakpoint with any debugger in the target process at that location and check what's going on

tell us your results

ghost commented 3 years ago

CSGO doesn't have protection for remote thread creation (if you run it with -insecure, without anticheat) because my own simple injector using remotethread works fine. I needed a simple manual map injector to build onto for injecting the dll into CSGO running with anticheat, if I use this injector on a simple program it works fine

TheCruZ commented 3 years ago

Remove this part of code as it can cause some errors with some DLLs https://github.com/TheCruZ/Simple-Manual-Map-Injector/blob/2026d4067cdba09b77ded0c21cf4340a6f838ae4/Manual%20Map%20Injector/injector.cpp#L205 At same time as I told you in the previous post, use for example cheat engine to make a breakpoint in the shell code entry and see what's going on and why it crash, if the crash occurred in the shell code the problem is from the injector if the crash ocurs after call your entry point the problem is in your DLL

Regards

allepicondor commented 3 years ago

have yall figured out a fix for this? I'm having the same problem

TheCruZ commented 3 years ago

Since I never try CSGO I can't help in this case I will close the issue, if anyone gets the issue please fix it and make a pull request