rdbo / DX11-BaseHook

DX11 BaseHook with Dear ImGUI Implementation through rdbo/libmem
96 stars 19 forks source link

Crashes on injection #1

Open damix69420 opened 3 years ago

rdbo commented 3 years ago

Please, offer more details on your question. I can't do anything here, the only information you gave me is that it crashes. What game are you using this in, which line does it crash, what are the errors that show up, etc.

damix69420 commented 3 years ago

GTA 5, no errors, the second i click inject the game crashes.

rdbo commented 3 years ago

Make sure you have the DirectX11 renderer enabled on GTA. Try debugging the code and gathering information, such as the line where it crashed so I can help you. I don't own GTA5 and I'm not going to buy the game just to debug this.

damix69420 commented 3 years ago

Hmm i only found a warning The enum type 'mem::detour_t' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).

rdbo commented 3 years ago

This is just a compile warning and it's unrelated to the crash. You have to attach Visual Studio to the game process, inject the DLL (preferably using LoadLibrary) and then tell me what line does it crash so I can perhaps see the issue.

damix69420 commented 3 years ago

Exception thrown at 0x0000010B7184BF93 in GTA5.exe: 0xC0000005: Access violation executing location 0x0000010B7184BF93.

Line 50, present.cpp

rdbo commented 3 years ago

The line 50 on Present.cpp is ImGui::End();, so there are a few possible problems that I can think of (without deep analysis):

  1. The present function has not been hooked properly (probably not this one)
  2. Game-specific rendering problem (you'd have to fix yourself)
  3. Problem in the ImGUI code (I don't develop ImGUI, so I couldn't fix this one if it is the issue).

To check the first one, you'd have to find the Present function on the SwapChain VMT and check if it points to the function Base::Hooks::Present.

To check the second one, you'd have to reverse engineer the game rendering functions. Try drawing something more simple, such as a triangle or a rectangle instead of ImGUI. If it works, then the problem might be ImGUI (3rd possible problem).

You can use tools, such as Cheat Engine, Ghidra, IDA Pro, etc to verify each problem. As I said, I don't own the game, so I'm not sure if I can offer much more help than this. This code has been tested on rdbo/DirectX11-Application (x86 and x64) and it worked fine, so it's likely a game-specific problem rather than a problem in this basehook. In any case, I'll see if I can find anything once I have time.

damix69420 commented 3 years ago

Ahh my bad, I meant line 60, sorry

2bite commented 3 years ago

Same issue "Access violation". Game - ARK: Survival Evolved. ImGui-DirectX-11-Kiero-Hook worked without any problem line60

Tiffany-Senpai commented 3 years ago

this might be a bit late but i also get this issue

Hi-ImKyle commented 2 years ago

same here on ets2