首页
社区
课程
招聘
[求助]判断操作系统版本例如XP-2008
发表于: 2010-8-23 01:43 4572

[求助]判断操作系统版本例如XP-2008

2010-8-23 01:43
4572
由于各种系统的偏移不一样,例如XP 0x248, 2K3 0x240, VISTA,2k8 0x260, Win7 0x280
驱动中要用到,目前是想从RING3中判断后再传入RING0,搜了半天也没找到判断操作系统版本比较全面的代码,希望知道的大哥帮下忙。直接用代码说话

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 109
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
请参考最新的MSDN
2010-8-23 08:20
0
雪    币: 7992
活跃值: (2566)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
3
BOOLEAN
  PsGetVersion(
    PULONG  MajorVersion  OPTIONAL,
    PULONG  MinorVersion  OPTIONAL,
    PULONG  BuildNumber  OPTIONAL,
    PUNICODE_STRING  CSDVersion  OPTIONAL
    );
2010-8-23 08:34
0
雪    币: 220
活跃值: (701)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
This function is obsolete in Windows XP and later versions of the operating system. Use RtlGetVersion instead.
PsGetVersion returns caller-selected information about the current version of the NT-based operating system.

BOOLEAN
  PsGetVersion(
    PULONG  MajorVersion  OPTIONAL,
    PULONG  MinorVersion  OPTIONAL,
    PULONG  BuildNumber  OPTIONAL,
    PUNICODE_STRING  CSDVersion  OPTIONAL
    );

Parameters
MajorVersion
Points to a caller-supplied variable that this routine sets to the major version of the operating system. This optional parameter can be NULL.
MinorVersion
Points to a caller-supplied variable that this routine sets to the minor version of the operating system. This optional parameter can be NULL.
BuildNumber
Points to a caller-supplied variable that this routine sets to the current build number of the operating system. This optional parameter can be NULL.
CSDVersion
Points to a caller-allocated buffer in which this routine returns the current service-pack version as a Unicode string only during system driver initialization. This optional parameter can be NULL.

Return Value
PsGetVersion returns whether the system is a checked or free build, as follows:

Value Meaning
TRUE (1) Checked build of the operating system.
FALSE (0) Free build of the operating system.  

Headers
Declared in ntddk.h. Include ntddk.h.

Comments
PsGetVersion returns the requested information, depending on which optional parameter(s) the caller supplies.

To retrieve the current service-pack number, it is easier and more efficient to make an application-level call within the Win32 environment than to call PsGetVersion during system driver initialization, which then must parse the string it returns at CSDVersion. When the registry is initialized, a driver cannot obtain this string from PsGetVersion, but must read the CmCSDVersionString value from the registry.

Callers of PsGetVersion must be running at IRQL = PASSIVE_LEVEL.

太不全了
2010-8-23 10:46
0
雪    币: 636
活跃值: (174)
能力值: ( LV9,RANK:260 )
在线值:
发帖
回帖
粉丝
5
在MSDN中查找OSVERSIONINFO structure,能找到关于MajorVersion、MinorVersion、BuildNumber和CSDVersion的全面信息。
2010-8-25 10:55
0
游客
登录 | 注册 方可回帖
返回
//