阅读:1328回复:3
windows2000 怎样定位系统驱动程序的基地值?
在windows2000中怎样定位系统驱动程序的基地值?
如,在 Softice 中用mod命令可看到 :mod NDIS hMod Base PEHeader Module Name File Name BFF25000 BFF250C8 NDIS NDIS.sys ED48C000 ED48C0C8 ndistapi \\SystemRoot\\System32\\DRIVERS\\ndistapi.sy BFBEF000 BFBEF0D8 ndiswan \\SystemRoot\\System32\\DRIVERS\\ndiswan.sys 这些驱动程序的地址,自己编程怎样获得呢 ? |
|
最新喜欢:![]()
|
沙发#
发布于:2003-05-10 02:44
这里有一例
http://ntdev.h1.ru/sysmod.html This simple utility shows list of system modules like mod command in SoftICE. You can use this information to get list of drivers loaded and order of their loading. This is also example of using Native API from user mode. [编辑 - 5/10/03 by KMK] |
|
板凳#
发布于:2003-05-10 22:49
谢了,不过为了调通要做一些小的改动。我的已经调通的源码如下
// w32test.cpp : Defines the entry point for the console application. // #include \"stdafx.h\" #include <windows.h> #include <stdio.h> #include <malloc.h> /* * Native API definitions */ #pragma pack(1) #define SystemModuleInformation 11 typedef struct _SYSTEM_MODULE_INFORMATION { 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 LONG NTSTATUS, *PNTSTATUS; extern \"C\" { NTSYSAPI NTSTATUS NTAPI ZwQuerySystemInformation( IN ULONG SystemInformationClass, IN PVOID SystemInformation, IN ULONG SystemInformationLength, OUT PULONG ReturnLength); } #pragma pack() /* * View list of system modules */ int main(int argc, char* argv[]) { NTSTATUS status; ULONG i, n, *q; PSYSTEM_MODULE_INFORMATION p; void *base; status = ZwQuerySystemInformation(SystemModuleInformation, &n, 0, &n); q = (ULONG *)malloc(n * sizeof(*q)); if (q == NULL) { perror(\"malloc\"); return -1; } status = ZwQuerySystemInformation(SystemModuleInformation, q, n * sizeof(*q), NULL); p = (PSYSTEM_MODULE_INFORMATION)(q + 1); base = NULL; for (i = 0; i < *q; i++) { printf(\"base: 0x%x size: %u\\t%s\\n\", p.Base, p.Size, p.ImageName); } free(q); return 0; } |
|
|
地板#
发布于:2003-05-26 14:42
基地址是在驱动程序加载时指定的
|
|
|