zgyknight
驱动牛犊
驱动牛犊
  • 注册日期2010-02-07
  • 最后登录2011-08-06
  • 粉丝0
  • 关注0
  • 积分12分
  • 威望91点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:2722回复:1

为什么相同的标识符两次取地址 结果不同呢?

楼主#
更多 发布于:2010-12-06 13:32
有如下声明:

#include "ntddk.h"

#pragma pack(1)
typedef struct ServiceDescriptorEntry
{
    unsigned int *ServiceTableBase;
    unsigned int *ServiceCounterTableBase; //Used only in checked build
    unsigned int NumberOfServices;
    unsigned char *ParamTableBase;
} SSDTEntry;
__declspec(dllimport)  SSDTEntry KeServiceDescriptorTable;

#pragma pack()

然后在入口函数里两次取他的值

    ULONG pointer = 0 ;
    __asm int 3
    DbgPrint("KeServiceDescriptorTable:%x\r\n",KeServiceDescriptorTable);
        __asm
        {
                pushad
                   mov  eax , KeServiceDescriptorTable
                   mov  pointer,eax
                popad
        }
       DbgPrint("second:%x\r\n",pointer);

----------------------------------------------------------------
output:

KeServiceDescriptorTable:80505450
second:8055d700

补充一下: 8055d700这个地址里面保存的是80505450这个数字

为什么?
这个人很勤快 什么都没有留下
游客

返回顶部