MSVC++ causing crash 0x80000003 on “Attach to Proc

2019-06-12 03:50发布

问题:

I'm injecting a dll into a third party program and debugging that dll with MSVC. I have been doing normally for some time until a recent update to the program now causes MSVC to crash each time I attach the debugger to the process while my dll is injected. My dll still runs normally, I just cannot debug it as attaching MSVC crashes the host program.

Event view shows this:

Faulting application name: SomeApp.exe, version: 1.0.1023.0, time stamp: 0x5109728a
Faulting module name: MyDLL.dll, version: 0.0.0.0, time stamp: 0x5114e8b3
Exception code: 0x80000003
Fault offset: 0x006f3b28
Faulting process id: 0x1b80
Faulting application start time: 0x01ce05f71b9d65a9
Faulting application path: C:\SomeApp.exe
Faulting module path: c:\programming\MyDLL\debug\MyDLL.dll
Report Id: 8762e85d-71ea-11e2-a78e-4495fc99073a

Is it possible the application now crashes itself if it detects a debugger attached? I'd like to note that my DLL is a legitimate serverside mod that does not violate any EULA/TOS or anything like that. It operates by replacing some Virtual Method Table (VMT) pointers for some objects in the host program, if that is relevant.

Update I can debug the OnAttach() portion of my dll with MSVC, however once the execution returns to the host process it crashes.