ZwQuerySystemInformation函数查询SystemModuleInformation
2011-04-13 19:30
639 查看
使用ZwQuerySystemInformation函数查询SystemModuleInformation
在看到两种用法
第一种:
ZwQuerySystemInformation(SystemModuleInformation,&n,0,&n);
PULONG p=new ULONG
;
ZwQuerySystemInformation(SystemModuleInformation,p,n*sizeof*p,0);
第二种:
ZwQuerySystemInformation(SystemModuleInformation,&n,0,&n);
buf = (PULONG)ExAllocatePool(PagedPool,n);
ZwQuerySystemInformation(SystemModuleInformation,buf, n , 0);
如果n表示返回信息的字节数的话,
那么在第一种中分配的是n*4个字节的空间
PSYSTEM_MODULE_INFORMATION头4个字节dwNumberOfModules指示有多少个模块
( PULONG )buf + 1也没有指向第二个模块,只不过是指针向后移了4个字节
typedef struct _SYSTEM_MODULE_INFORMATION {//Information Class 11
ULONG Reserved [2];
PVOID Base;
ULONG Size;
ULONG Flags;
USHORT Index;
USHORT Unknown;
USHORT LoadCount;
USHORT ModuleNameOffset;
CHAR ImageName [256 ];
} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
typedef struct {
ULONG dwNumberOfModules;
SYSTEM_MODULE_INFORMATION smi;
} MODULES, *PMODULES;
这里的PMODULES就是代码中的PSYSTEM_MODULE_INFORMATION
在看到两种用法
第一种:
ZwQuerySystemInformation(SystemModuleInformation,&n,0,&n);
PULONG p=new ULONG
;
ZwQuerySystemInformation(SystemModuleInformation,p,n*sizeof*p,0);
第二种:
ZwQuerySystemInformation(SystemModuleInformation,&n,0,&n);
buf = (PULONG)ExAllocatePool(PagedPool,n);
ZwQuerySystemInformation(SystemModuleInformation,buf, n , 0);
如果n表示返回信息的字节数的话,
那么在第一种中分配的是n*4个字节的空间
PSYSTEM_MODULE_INFORMATION头4个字节dwNumberOfModules指示有多少个模块
( PULONG )buf + 1也没有指向第二个模块,只不过是指针向后移了4个字节
typedef struct _SYSTEM_MODULE_INFORMATION {//Information Class 11
ULONG Reserved [2];
PVOID Base;
ULONG Size;
ULONG Flags;
USHORT Index;
USHORT Unknown;
USHORT LoadCount;
USHORT ModuleNameOffset;
CHAR ImageName [256 ];
} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
typedef struct {
ULONG dwNumberOfModules;
SYSTEM_MODULE_INFORMATION smi;
} MODULES, *PMODULES;
这里的PMODULES就是代码中的PSYSTEM_MODULE_INFORMATION
相关文章推荐
- ZwQuerySystemInformation 函数查看进程列表
- 函数ZwQuerySystemInformation小结
- 函数ZwQuerySystemInformation小结
- //关于函数ZwQuerySystemInformation的第一个参数 SystemInformationClass
- ZwQuerySystemInformation枚举内核模块及简单应用
- PHP - Manual手册 - 函数参考 - PHP Options&Information - PHP选项与信息 - extension_loaded查询是否加载指定的扩展
- hook zwQuerySysteminformation 隐藏进程
- ZwQuerySystemInformation
- ZwQueryInformationFile 函数
- PHP - Manual手册 - 函数参考 - PHP Options&Information - PHP选项与信息 - extension_loaded查询是否加载指定的扩展
- hook ZwQuerySystemInformation 隐藏进程
- ZwQuerySystemInformation用法示例
- ZwQuerySystemInformation 查看系统进程信息
- ZwQuerySystemInformation 安全使用心得 Delphi 版
- hook zwQuerySysteminformation 隐藏进程
- n unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module.Additional information: 未能加载文件或程序集“..
- ZwQuerySystemInformation中的结构体和例子
- 利用NtQuerySystemInformation函数遍历进程,遍历线程,获取线程挂起或运行状态
- Hook ZwQuerySystemInformation 隐藏qq程序
- ZwQuerySystemInformation枚举内核模块及简单应用