首页
社区
课程
招聘
[旧帖] [求助]context.eax的位置b0来得没道理啊 0.00雪花
发表于: 2011-10-8 10:22 1409

[旧帖] [求助]context.eax的位置b0来得没道理啊 0.00雪花

2011-10-8 10:22
1409
我看脱壳的艺术,2.4Debugger Interrupts这一节中,示例中对context.eax的定位是mov dword [eax+0xb0],0xffffffff。我查了winnt.h文件的context结构,eax位移根本不是0xb0,我在网上也看了一些示例,全是一个抄一个,没有说明为何0xb0的理由。我查的是vc7的winnt.h。知道的谁来说一下?

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (8)
雪    币: 435
活跃值: (1212)
能力值: ( LV13,RANK:388 )
在线值:
发帖
回帖
粉丝
2
nt!_CONTEXT
   +0x000 ContextFlags     : Uint4B
   +0x004 Dr0              : Uint4B
   +0x008 Dr1              : Uint4B
   +0x00c Dr2              : Uint4B
   +0x010 Dr3              : Uint4B
   +0x014 Dr6              : Uint4B
   +0x018 Dr7              : Uint4B
   +0x01c FloatSave        : _FLOATING_SAVE_AREA
   +0x08c SegGs            : Uint4B
   +0x090 SegFs            : Uint4B
   +0x094 SegEs            : Uint4B
   +0x098 SegDs            : Uint4B
   +0x09c Edi              : Uint4B
   +0x0a0 Esi              : Uint4B
   +0x0a4 Ebx              : Uint4B
   +0x0a8 Edx              : Uint4B
   +0x0ac Ecx              : Uint4B
   +0x0b0 Eax              : Uint4B
   +0x0b4 Ebp              : Uint4B
   +0x0b8 Eip              : Uint4B
   +0x0bc SegCs            : Uint4B
   +0x0c0 EFlags           : Uint4B
   +0x0c4 Esp              : Uint4B
   +0x0c8 SegSs            : Uint4B
   +0x0cc ExtendedRegisters : [512] UChar
2011-10-8 11:22
0
雪    币: 4
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
首先谢谢楼上,请问你这段是出自那个版本的操作系统?我看winnt.h,为何为这个对不上?
2011-10-8 11:25
0
雪    币: 4
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
忘了问你,你这个是用什么工具显示出来的,我也去看下
2011-10-8 11:27
0
雪    币: 435
活跃值: (1212)
能力值: ( LV13,RANK:388 )
在线值:
发帖
回帖
粉丝
5
context是和硬件相关的一个结构 在winnt。h里有两个定义 一个for x86一个for x64 这个是x86的
2011-10-8 11:29
0
雪    币: 4
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
Mitt,你说的对,我看的就是x86的。你上面那个是用什么工具看的?下面贴出来:
typedef struct _CONTEXT {

    //
    // The flags values within this flag control the contents of
    // a CONTEXT record.
    //
    // If the context record is used as an input parameter, then
    // for each portion of the context record controlled by a flag
    // whose value is set, it is assumed that that portion of the
    // context record contains valid context. If the context record
    // is being used to modify a threads context, then only that
    // portion of the threads context will be modified.
    //
    // If the context record is used as an IN OUT parameter to capture
    // the context of a thread, then only those portions of the thread's
    // context corresponding to set flags will be returned.
    //
    // The context record is never used as an OUT only parameter.
    //

    DWORD ContextFlags;

    //
    // This section is specified/returned if CONTEXT_DEBUG_REGISTERS is
    // set in ContextFlags.  Note that CONTEXT_DEBUG_REGISTERS is NOT
    // included in CONTEXT_FULL.
    //

    DWORD   Dr0;
    DWORD   Dr1;
    DWORD   Dr2;
    DWORD   Dr3;
    DWORD   Dr6;
    DWORD   Dr7;

    //
    // This section is specified/returned if the
    // ContextFlags word contians the flag CONTEXT_FLOATING_POINT.
    //

    FLOATING_SAVE_AREA FloatSave;

    //
    // This section is specified/returned if the
    // ContextFlags word contians the flag CONTEXT_SEGMENTS.
    //

    DWORD   SegGs;
    DWORD   SegFs;
    DWORD   SegEs;
    DWORD   SegDs;

    //
    // This section is specified/returned if the
    // ContextFlags word contians the flag CONTEXT_INTEGER.
    //

    DWORD   Edi;
    DWORD   Esi;
    DWORD   Ebx;
    DWORD   Edx;
    DWORD   Ecx;
    DWORD   Eax;

    //
    // This section is specified/returned if the
    // ContextFlags word contians the flag CONTEXT_CONTROL.
    //

    DWORD   Ebp;
    DWORD   Eip;
    DWORD   SegCs;              // MUST BE SANITIZED
    DWORD   EFlags;             // MUST BE SANITIZED
    DWORD   Esp;
    DWORD   SegSs;

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

    BYTE    ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];

} CONTEXT;

typedef CONTEXT *PCONTEXT;
从上面看,怎么数eax位置都不是b0。
2011-10-8 11:39
0
雪    币: 435
活跃值: (1212)
能力值: ( LV13,RANK:388 )
在线值:
发帖
回帖
粉丝
7
WINDBG
EAX 上面一共有16个dword 共64byte
一个FLOATING_SAVE_AREA结构,其中有8个dword和一个80字节数组,共计32+80=112byte
64+112=176=0xb0
2011-10-8 11:47
0
雪    币: 4
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
非常感谢Mitt,我相当然的乎略了那个100多字节的结构,认为它是一个dw.受教了。
2011-10-8 11:53
0
雪    币: 435
活跃值: (1212)
能力值: ( LV13,RANK:388 )
在线值:
发帖
回帖
粉丝
9
不用谢 我也喜欢钻牛角尖 结构体嵌套 确实容易看错成结构体指针
2011-10-8 11:59
0
游客
登录 | 注册 方可回帖
返回
//