aguml |
30-05-2020 02:10:40 |
Implementar truco para antidebug en mi clase debugger
Buenas, estoy intentando que mi debugger se salte el nuevo truco que usan en Windows 10 para detectar al debugger. El código que usan es este:
Código PHP:
void __stdcall _OutputDebugStringW(LPCWSTR lpOutputString)
{
char outputDebugStringBuffer[1000] = {0};
WideCharToMultiByte(CP_ACP, 0, lpOutputString, -1, outputDebugStringBuffer, sizeof(outputDebugStringBuffer), 0, 0);
ULONG_PTR args[4];
//unicode
args[0] = (ULONG_PTR)wcslen(lpOutputString) + 1;
args[1] = (ULONG_PTR)lpOutputString;
//ansi for compatibility
args[2] = (ULONG_PTR)wcslen(lpOutputString) + 1;
args[3] = (ULONG_PTR)outputDebugStringBuffer;
__try
{
RaiseException(0x4001000A, 0, 4, args);//DBG_PRINTEXCEPTION_WIDE_C
ShowMessageBox("DBG_PRINTEXCEPTION_WIDE_C -> Debugger detected");
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
ShowMessageBox("DBG_PRINTEXCEPTION_WIDE_C -> Debugger NOT detected");
}
}
Si hay un debugger no hay excepción y si no hay debugger si la hay y así es como detecta al debugger. La cosa es que necesito enviarle esa excepción para que vaya al lugar que me interesa pero no sé qué debo hacer para eso. Para en el evento de depuración OutputDebugString ¿Le envío la excepción EXCEPTION_EXECUTE_HANDLER? ¿Eso funcionaria? ¿Como hago que la aplicación reciba esa excepción y la maneje el?
|