36 *module_start_addr = 0;
69 DbgPrint(
"EDX: %.8x EBP: %.8x ESI: %.8x ESP: %.8x\n", pc->
Edx,
72#elif defined(_M_AMD64)
76 DbgPrint(
"RAX: %I64x RBX: %I64x RCX: %I64x RDI: %I64x\n", pc->Rax, pc->Rbx, pc->Rcx, pc->Rdi);
77 DbgPrint(
"RDX: %I64x RBP: %I64x RSI: %I64x RSP: %I64x\n", pc->Rdx, pc->Rbp, pc->Rsi, pc->Rsp);
78 DbgPrint(
"R8: %I64x R9: %I64x R10: %I64x R11: %I64x\n", pc->
R8, pc->
R9, pc->
R10, pc->
R11);
79 DbgPrint(
"R12: %I64x R13: %I64x R14: %I64x R15: %I64x\n", pc->
R12, pc->R13, pc->R14, pc->R15);
82 DbgPrint(
"PC: %08lx LR: %08lx SP: %08lx\n", pc->
Pc);
83 DbgPrint(
"R0: %08lx R1: %08lx R2: %08lx R3: %08lx\n", pc->
R0, pc->
R1, pc->
R2, pc->
R3);
84 DbgPrint(
"R4: %08lx R5: %08lx R6: %08lx R7: %08lx\n", pc->
R4, pc->
R5, pc->
R6, pc->
R7);
85 DbgPrint(
"R8: %08lx R9: %08lx R10: %08lx R11: %08lx\n", pc->
R8, pc->
R9, pc->
R10, pc->
R11);
88 #error "Unknown architecture"
96 CHAR szMod[128] =
"", *szModFile;
119 DbgPrint(
"Address:\n<%s:%x> (%s@%x)\n",
132 for (
i = 0; Frame[1] != 0 && Frame[1] != 0xdeadbeef &&
i < 128;
i++)
136 DbgPrint(
"<%s:%x>\n",
"[invalid address]", Frame[1]);
141 szMod,
sizeof(szMod), &szModFile);
252 ErrMode &= ~SEM_FAILCRITICALERRORS;
285 ULONG DebugResponse, ErrorResponse;
346 DPRINT(
"Passing exception to debugger\n");
355 RetValue = RealFilter(ExceptionInfo);
430 AeDebugAuto = (*(
PWCHAR)PartialInfo->
Data ==
L'1');
456 while ( *AeDebugPath &&
457 ((*AeDebugPath ==
L' ') ||
458 (*AeDebugPath ==
L'\t')) )
500 if (!(AeDebugPath && AeDebugAuto))
512 (!IsSecondChance ? DebugResponse :
OptionOk),
531 IsSecondChance =
TRUE;
576 if ((*AeDebugPath !=
L'"') &&
612 DPRINT1(
"\nStarting debugger: '%S'\n", AeDebugCmdLine);
617 StartupInfo.
cb =
sizeof(StartupInfo);
625 &StartupInfo, &ProcessInfo);
630 WaitHandles[0] = hDebugEvent;
631 WaitHandles[1] = ProcessInfo.
hProcess;
658 IsSecondChance =
TRUE;
676 IsSecondChance =
TRUE;
735 if (dwExceptionCode == 0xeedface || dwExceptionCode == 0xeedfade)
753 UINT PrevErrMode, NewMode;
763 NewMode &= ~SEM_FAILCRITICALERRORS;
792 PVOID EncodedPointer, EncodedOldPointer;
810 volatile CHAR *Current;
814 if (!ucb)
return FALSE;
815 if (!lp)
return TRUE;
821 Current = (
volatile CHAR*)lp;
825 if (Last < Current)
return TRUE;
838 while (Current != Last)
888 volatile CHAR *Current;
892 if (!ucb)
return FALSE;
893 if (!lp)
return TRUE;
899 Current = (
volatile CHAR*)lp;
903 if (Last < Current)
return TRUE;
916 while (Current != Last)
954 volatile WCHAR *Current;
959 if (!ucchMax)
return FALSE;
960 if (!lpsz)
return TRUE;
963 Current = (
volatile WCHAR*)lpsz;
971 while ((Char) && (Current != Last)) Char = *Current++;
993 volatile CHAR *Current;
998 if (!ucchMax)
return FALSE;
999 if (!lpsz)
return TRUE;
1002 Current = (
volatile CHAR*)lpsz;
1010 while ((Char) && (Current != Last)) Char = *Current++;
#define DECLSPEC_HOTPATCH
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
static LPCWSTR LPCWSTR module_name
#define NT_SUCCESS(StatCode)
#define EXCEPTION_MAXIMUM_PARAMETERS
#define RtlImageDirectoryEntryToData
PBASE_STATIC_SERVER_DATA BaseStaticServerData
BOOLEAN BaseRunningInServerProcess
LONG WINAPI BasepCheckForReadOnlyResource(IN PVOID Ptr)
DWORD g_dwLastErrorToBreakOn
LPTOP_LEVEL_EXCEPTION_FILTER GlobalTopLevelExceptionFilter
UINT WINAPI SetErrorMode(IN UINT uMode)
LONG WINAPI UnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
static VOID PrintStackTrace(IN PEXCEPTION_POINTERS ExceptionInfo)
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
static VOID _dump_context(PCONTEXT pc)
BOOL NTAPI IsBadCodePtr(FARPROC lpfn)
BOOL NTAPI IsBadHugeWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
static const char * _module_name_from_addr(const void *addr, void **module_start_addr, char *psz, size_t nChars, char **module_name)
BOOL NTAPI IsBadStringPtrA(IN LPCSTR lpsz, IN UINT_PTR ucchMax)
BOOL NTAPI IsBadHugeReadPtr(LPCVOID lp, UINT_PTR ucb)
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI DECLSPEC_HOTPATCH SetUnhandledExceptionFilter(IN LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
BOOL NTAPI IsBadStringPtrW(IN LPCWSTR lpsz, IN UINT_PTR ucchMax)
UINT WINAPI GetErrorMode(VOID)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
#define InterlockedExchangePointer(Target, Value)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
GLenum const GLvoid * addr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
#define EXCEPTION_EXECUTE_HANDLER
#define EXCEPTION_CONTINUE_SEARCH
#define EXCEPTION_CONTINUE_EXECUTION
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void)
NTSYSAPI PVOID WINAPI RtlEncodePointer(PVOID)
NTSYSAPI void WINAPI DbgBreakPoint(void)
@ ProcessDefaultHardErrorMode
NTSYSAPI PVOID WINAPI RtlDecodePointer(PVOID)
#define InitializeObjectAttributes(p, n, a, r, s)
unsigned __int3264 UINT_PTR
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
#define HARDERROR_OVERRIDE_ERRORMODE
NTSYSAPI RTL_PATH_TYPE NTAPI RtlDetermineDosPathNameType_U(_In_ PCWSTR Path)
NTSYSAPI VOID NTAPI RtlRaiseException(_In_ PEXCEPTION_RECORD ExceptionRecord)
#define SEM_NOALIGNMENTFAULTEXCEPT
#define SEM_FAILCRITICALERRORS
#define SEM_NOGPFAULTERRORBOX
#define RTL_SEM_NOGPFAULTERRORBOX
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
@ KeyValuePartialInformation
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtTerminateProcess(HANDLE ProcessHandle, LONG ExitStatus)
#define NtCurrentProcess()
NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
_IRQL_requires_same_ _In_ PVOID _Inout_ struct _CONTEXT * ContextRecord
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSTATUS NTAPI NtCreateEvent(OUT PHANDLE EventHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN EVENT_TYPE EventType, IN BOOLEAN InitialState)
NTSTATUS NTAPI NtProtectVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UnsafeBaseAddress, IN OUT SIZE_T *UnsafeNumberOfBytesToProtect, IN ULONG NewAccessProtection, OUT PULONG UnsafeOldAccessProtection)
NTSTATUS NTAPI NtQueryVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, IN MEMORY_INFORMATION_CLASS MemoryInformationClass, OUT PVOID MemoryInformation, IN SIZE_T MemoryInformationLength, OUT PSIZE_T ReturnLength)
NTSTATUS NTAPI NtSetInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, IN PVOID ProcessInformation, IN ULONG ProcessInformationLength)
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
#define STATUS_UNHANDLED_EXCEPTION
#define STATUS_ACCESS_VIOLATION
#define STATUS_IN_PAGE_ERROR
NTSTATUS NTAPI NtWaitForMultipleObjects(IN ULONG ObjectCount, IN PHANDLE HandleArray, IN WAIT_TYPE WaitType, IN BOOLEAN Alertable, IN PLARGE_INTEGER TimeOut OPTIONAL)
#define IMAGE_DIRECTORY_ENTRY_RESOURCE
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
DWORD BaseSetLastNTError(IN NTSTATUS Status)
#define REGSTR_PATH_AEDEBUG
#define REGSTR_VAL_AEDEBUG_AUTO
#define REGSTR_VAL_AEDEBUG_DEBUGGER
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define EXCEPTION_WRITE_FAULT
#define EXCEPTION_EXECUTE_FAULT
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
SYSTEM_BASIC_INFORMATION SysInfo
struct _EXCEPTION_RECORD * ExceptionRecord
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
#define EXCEPTION_NONCONTINUABLE
#define RTL_CONSTANT_STRING(s)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define ALIGN_DOWN_POINTER_BY(ptr, align)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
SIZE_T NTAPI VirtualQuery(IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER
DWORD WINAPI GetLastError(void)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Out_ PCLIENT_ID ClientId
#define EXCEPTION_NESTED_CALL