Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.5 KiB

  1. #ifndef __APPVERIFIER_DEBUGGER_H_
  2. #define __APPVERIFIER_DEBUGGER_H_
  3. #define MAX_BREAKPOINTS 32
  4. #ifdef _X86_
  5. #define BP_INSTR 0xcc
  6. #define BP_SIZE 1
  7. #else
  8. #pragma message("Debugger Breakpoint support needed for this architecture")
  9. #endif
  10. typedef struct tagBP_INFO *PBP_INFO;
  11. typedef struct tagTHREAD_INFO *PTHREAD_INFO;
  12. typedef struct tagPROCESS_INFO *PPROCESS_INFO;
  13. typedef DWORD (*PBP_HANDLER)(PPROCESS_INFO,
  14. PTHREAD_INFO,
  15. PEXCEPTION_RECORD,
  16. PBP_INFO);
  17. typedef struct tagBP_INFO {
  18. LPVOID Address;
  19. ULONG OriginalInstr;
  20. PBP_HANDLER Handler;
  21. } BP_INFO, *PBP_INFO;
  22. typedef struct tagTHREAD_INFO {
  23. PTHREAD_INFO pNext;
  24. HANDLE hProcess;
  25. HANDLE hThread;
  26. ULONG dwThreadId;
  27. CONTEXT Context;
  28. } THREAD_INFO, *PTHREAD_INFO;
  29. typedef struct tagPROCESS_INFO {
  30. PPROCESS_INFO pNext;
  31. HANDLE hProcess;
  32. DWORD dwProcessId;
  33. BOOL bSeenLdrBp;
  34. LPVOID EntryPoint;
  35. DEBUG_EVENT DebugEvent;
  36. PTHREAD_INFO pFirstThreadInfo;
  37. BP_INFO bp[MAX_BREAKPOINTS];
  38. } PROCESS_INFO, *PPROCESS_INFO;
  39. SIZE_T
  40. ReadMemoryDbg(
  41. HANDLE hProcess,
  42. LPVOID Address,
  43. LPVOID Buffer,
  44. SIZE_T Length
  45. );
  46. BOOL
  47. WriteMemoryDbg(
  48. HANDLE hProcess,
  49. PVOID Address,
  50. PVOID Buffer,
  51. SIZE_T Length
  52. );
  53. DWORD WINAPI
  54. DebugApp(
  55. LPTSTR pszAppName
  56. );
  57. #endif // __APPVERIFIER_DEBUGGER_H_