I tested today,
1. protect a.dll, get a.vmp.dll, with anti-debugger enabled
2. inject a.vmp.dll into another process B, with CreateRemoteThread(...,&LoadLibrary,...), injection succeed and injected code worked good
3. in visual studio - Debug - attach to process B, everything in debug window looks good and process B do not exit or show a dialog says debugger detected.
Is this a expected behavior?
Does anti-debugger work for injected dlls?
Re: Does anti-debugger work for injected dlls?
VMProtect detects the debugger only at the beginning of the program execution. To detect a debugger during the execution of the program, you need to manually call the VMProtectIsDebuggerPresent function.