这个函数 把各个系统的 PEPROCESS的部分偏移保存到 g_SysverOff
但是 有几个疑问 哈哈
1,我这个函数里面是不是没有全部列举到 所有的操作系统 比如 WIN7 VISTA WIN2008 WIN98 WIN2000等等 这个怎么办 怎么补齐 WIN98都可以算了 毕竟太老了
2,dwMajorVersion==4 dwMinorVersion==0的系统是什么系统啊 能不能有人把这个系统的DEBUGPORT偏移和pImageName偏移 告诉我下啊
3,dwMajorVersion==5 dwMinorVersion==0的系统是什么系统啊 能不能有人把这个系统的DEBUGPORT偏移和pImageName偏移 告诉我下啊
代码如下
typedef struct _stSysVersion_Offset
{// 这个结构体 表示的是 不同系统的 PEPROCESS 的偏移
ULONG pid; //pid 的偏移量
ULONG pImageName; //进程名字偏移
ULONG pFlink; // ActiveProcessLinks 链表
ULONG debugport; //
}stSysVersion_Offset,*PstSysVersion_Offset;
stSysVersion_Offset g_SysverOff; //系统的 偏移
BOOLEAN __stdcall MyGetSysVersion_Off()
{ //得到系统的偏移 给全局变量 g_SysverOff 赋值
RTL_OSVERSIONINFOEXW osvi;
/*HANDLE hSnapShot;
BOOL status;
int *os_offsets;*/
RtlZeroMemory(&osvi,sizeof(RTL_OSVERSIONINFOEXW));
osvi.dwOSVersionInfoSize=sizeof(RTL_OSVERSIONINFOEXW);
if( STATUS_SUCCESS != RtlGetVersion((PRTL_OSVERSIONINFOW) &osvi) )
{
osvi.dwOSVersionInfoSize = sizeof (RTL_OSVERSIONINFOW);
if ( STATUS_SUCCESS != RtlGetVersion ( (PRTL_OSVERSIONINFOW) &osvi) )
return FALSE;
}
switch (osvi.dwPlatformId)
{
case VER_PLATFORM_WIN32_NT:
if ( osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
{//
g_SysverOff.pid = 148;
g_SysverOff.pFlink = 152;
//authid_offset = 24;
//token_offset = 264;
//privcount_offset = 52;
//privaddr_offset = 80;
//sidcount_offset = 48;
//sidaddr_offset = 72;
KdPrint((" MyGetSysVersion_Off 1111111111111111111 "));
}
else if ( osvi.dwMajorVersion == 5 && \
osvi.dwMinorVersion == 0 )
{
g_SysverOff.pid = 156;
g_SysverOff.pFlink = 160;
//authid_offset = 0x18;
//token_offset = 0x12c;
//privcount_offset = 0x44;
//privaddr_offset = 0x64;
//sidcount_offset = 0x3c;
//sidaddr_offset = 0x58;
KdPrint((" MyGetSysVersion_Off 2222222222222 "));
}
else if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )
{// winxp
g_SysverOff.pid = 132;
g_SysverOff.pFlink = 136;
g_SysverOff.pImageName = 0x174;
g_SysverOff.debugport = 0xBC;
//authid_offset = 24;
//token_offset = 200;
//privcount_offset = 72;
//privaddr_offset = 104;
//sidcount_offset = 64;
//sidaddr_offset = 92;
KdPrint((" MyGetSysVersion_Off 3333333333333 "));
}
else if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
{// WIN2003 32位
g_SysverOff.pid = 132;
g_SysverOff.pFlink = 136;
g_SysverOff.pImageName = 0x164;
g_SysverOff.debugport = 0xCC;
//authid_offset = 24;
//token_offset = 200;
//privcount_offset = 84;
//privaddr_offset = 116;
//sidcount_offset = 76;
//sidaddr_offset = 104;
KdPrint((" MyGetSysVersion_Off 44444444444444 "));
}
break;
default:
KdPrint(("\n 系统版本错误! %d.%d Not Supported!\n", osvi.dwMajorVersion, osvi.dwMinorVersion));
return FALSE;
}
return TRUE;
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!