Problem with madexcept + dll injection
Re: Problem with madexcept + dll injection
I've seen your reply, but I'm very busy atm, so it might take a couple of days before I get to this.
Re: Problem with madexcept + dll injection
no problem, i'm just ask for confirmation of receiving this bug report.
Re: Problem with madexcept + dll injection
Ok, I've looked into your test projects. For some reason, the target process always crashes on my PC when trying to inject the dll with your CreateRemoteThread code. FWIW, I've recompiled the sources myself instead of using your binary files. The crash even occurs when injecting kernel32.dll, so it has nothing to do with the dll.
As a test I've replaced your "InjectLib" function with madCodeHook's "InjectLibrary" API. After doing that your test projects work just fine. Doesn't matter if I compile the dll with madExcept or not, injection always succeeds. Well, the dll complains about not having found a window or something, but I suppose that's as designed.
So at this point I can't reproduce the problem, when using madCodeHook's DLL injection APIs. With your injection APIs I always get a crash, so I can't really look into the problem any further.
As a test I've replaced your "InjectLib" function with madCodeHook's "InjectLibrary" API. After doing that your test projects work just fine. Doesn't matter if I compile the dll with madExcept or not, injection always succeeds. Well, the dll complains about not having found a window or something, but I suppose that's as designed.
So at this point I can't reproduce the problem, when using madCodeHook's DLL injection APIs. With your injection APIs I always get a crash, so I can't really look into the problem any further.
Re: Problem with madexcept + dll injection
copy that, will test inject with your function InjectLib and will report about results.
Re: Problem with madexcept + dll injection
if in project2 i'm changing line
to
- all time injecting fails, InjectLibraryW returns false.
madCodeHook 2.
Try also InjectLibraryA, same.
In my main app - same.
What i'm doing incorrect?
Code: Select all
if not InjectLib(pi.dwProcessId, pi.hProcess, 'client_dll.dll') then
Code: Select all
if not InjectLibraryW(pi.hProcess, 'client_dll.dll') then
madCodeHook 2.
Try also InjectLibraryA, same.
In my main app - same.
What i'm doing incorrect?
Re: Problem with madexcept + dll injection
Works for me, using madCodeHook 3, of course.
Re: Problem with madexcept + dll injection
i can't install madCodeHook3, "no license" label in installer.
So, no way for me?
So, no way for me?
Re: Problem with madexcept + dll injection
Well, I think the key problem is the injection. At least on my PC your injection code always crashes, while madCodeHook 3's injection always succeeds. On my PC it doesn't seem to make a difference whether madExcept is enabeld in the dll or not.
The original purpose of this thread was to analyze why madExcept makes problems for a dll that is injected into another process. From what I can see, madExcept does not make a problem. Or at least I can't reproduce it. I'm still willing to analyze further, but I can't do anything if I can't reproduce the problem.
The original purpose of this thread was to analyze why madExcept makes problems for a dll that is injected into another process. From what I can see, madExcept does not make a problem. Or at least I can't reproduce it. I'm still willing to analyze further, but I can't do anything if I can't reproduce the problem.
Re: Problem with madexcept + dll injection
i have no idea, why my injection method always crash on your PC.
You write, that on "madCodeHook 3's injection always succeeds". That's fine, but madCodeHook 3 not available for me.
Can you test it also on madCodeHook 2( which can be used from my side)?
You write, that on "madCodeHook 3's injection always succeeds". That's fine, but madCodeHook 3 not available for me.
Can you test it also on madCodeHook 2( which can be used from my side)?
Re: Problem with madexcept + dll injection
madCodeHook 2 is heavily outdated. It was made for 32bit XP. It still works somewhat on Vista and Windows 7 (32bit), but anything newer than that, and especially 64bit OSs, is simply not supported by madCodeHook 2 at all.
With your injection method, the target process always crashes. Not the process which does the injection. I'm not sure why the target process crashes. I've spent like 30 minutes trying to figure out why it crashes, but didn't find the reason. At that point I stopped. I simply can't justify spending so much time debugging crashes in code that isn't mine.
With your injection method, the target process always crashes. Not the process which does the injection. I'm not sure why the target process crashes. I've spent like 30 minutes trying to figure out why it crashes, but didn't find the reason. At that point I stopped. I simply can't justify spending so much time debugging crashes in code that isn't mine.
Re: Problem with madexcept + dll injection
okey, i'm understood.
Thanks for you spent time.
Thanks for you spent time.