设为首页收藏本站喵玉殿官方微博

 找回密码
 少女注册中
搜索
查看: 4122|回复: 0

[编程算法] SEH结构化异常

[复制链接]
发表于 2010-12-18 11:39:22 | 显示全部楼层 |阅读模式
本帖最后由 十二 于 2011-2-20 14:48 编辑
  1. EXCEPTION_POINTERS结构
  2. typedef strut_EXCEPTION_POINTERS{ 
  3. DWORD pEXCEPTION_RECORD ExceptionRecord
  4. DWORD pCONTEXT ContextRecord            }_EXCEPTION_POINTERS ends

  5. EXCEPTION_RECORD结构
  6. typedef struct _EXCEPTION_RECORD{
  7.     DWORD    ExceptionCode;
  8.     DWORD ExceptionFlags;
  9.     struct _EXCEPTION_RECORD *ExceptionRecord;
  10.     PVOID ExceptionAddress;
  11.     DWORD NumberParameters;
  12.     UINT_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
  13.     } EXCEPTION_RECORD;

  14. typedef EXCEPTION_RECORD *PEXCEPTION_RECORD;


  15. CONTEXT结构

  16. typedef struct _CONTEXT {

  17.     //
  18.     // The flags values within this flag control the contents of
  19.     // a CONTEXT record.
  20.     //
  21.     // If the context record is used as an input parameter, then
  22.     // for each portion of the context record controlled by a flag
  23.     // whose value is set, it is assumed that that portion of the
  24.     // context record contains valid context. If the context record
  25.     // is being used to modify a threads context, then only that
  26.     // portion of the threads context will be modified.
  27.     //
  28.     // If the context record is used as an IN OUT parameter to capture
  29.     // the context of a thread, then only those portions of the thread's
  30.     // context corresponding to set flags will be returned.
  31.     //
  32.     // The context record is never used as an OUT only parameter.
  33.     //

  34.     DWORD ContextFlags;

  35.     //
  36.     // This section is specified/returned if CONTEXT_DEBUG_REGISTERS is
  37.     // set in ContextFlags.  Note that CONTEXT_DEBUG_REGISTERS is NOT
  38.     // included in CONTEXT_FULL.
  39.     //

  40.     DWORD   Dr0;
  41.     DWORD   Dr1;
  42.     DWORD   Dr2;
  43.     DWORD   Dr3;
  44.     DWORD   Dr6;
  45.     DWORD   Dr7;

  46.     //
  47.     // This section is specified/returned if the
  48.     // ContextFlags word contians the flag CONTEXT_FLOATING_POINT.
  49.     //

  50.     FLOATING_SAVE_AREA FloatSave;

  51.     //
  52.     // This section is specified/returned if the
  53.     // ContextFlags word contians the flag CONTEXT_SEGMENTS.
  54.     //

  55.     DWORD   SegGs;     +8C
  56.     DWORD   SegFs;      +90
  57.     DWORD   SegEs;      +94
  58.     DWORD   SegDs;     +98

  59.     //
  60.     // This section is specified/returned if the
  61.     // ContextFlags word contians the flag CONTEXT_INTEGER.
  62.     //

  63.     DWORD   Edi;      +9C
  64.     DWORD   Esi;      +A0
  65.     DWORD   Ebx;      +A4     
  66.     DWORD   Edx;      +A8
  67.     DWORD   Ecx;      +AC
  68.     DWORD   Eax;      +B0

  69.     //
  70.     // This section is specified/returned if the
  71.     // ContextFlags word contians the flag CONTEXT_CONTROL.
  72.     //

  73.     DWORD   Ebp;      +B4
  74.     DWORD   Eip;      +B8
  75.     DWORD   SegCs;      +BC              // MUST BE SANITIZED      
  76.     DWORD   EFlags;      +C0             // MUST BE SANITIZED
  77.     DWORD   Esp;      +C4
  78.     DWORD   SegSs;      +C8

  79.     //
  80.     // This section is specified/returned if the ContextFlags word
  81.     // contains the flag CONTEXT_EXTENDED_REGISTERS.
  82.     // The format and contexts are processor specific
  83.     //

  84.     BYTE    ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];

  85. } CONTEXT;
  86. 转自WINNT.H
复制代码


例子下载
您需要登录后才可以回帖 登录 | 少女注册中

本版积分规则

合作与事务联系|无图版|手机版|小黑屋|喵玉殿

GMT+8, 2025-10-31 03:40

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表