itializationOrderLinks;
PVOID DllBase;
PVOID EntryPoint;
ULONG SizeOfImage;
UNICODE_STRING FullDllName;
UNICODE_STRING BaseDllName;
ULONG Flags;
USHORT LoadCount;
USHORT TlsIndex;
union {
LIST_ENTRY HashLinks;
struct
{
PVOID SectionPointer;
ULONG CheckSum;
};
};
union {
struct
{
ULONG TimeDateStamp;
};
struct
{
PVOID LoadedImports;
};
};
struct _ACTIVATION_CONTEXT * EntryPointActivationContext;
PVOID PatchInformation;
}LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
//===================================================================================
NTKERNELAPI NTSTATUS
ZwQuerySystemInformation(
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
OUT PVOID SystemInformation,
IN ULONG SystemInformationLength,
OUT PULONG ReturnLength OPTIONAL
); //最终是通过遍历EPROCESS获取的
typedef NTSTATUS (*ZWQUERYSYSTEMINFORMATION)(
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
OUT PVOID SystemInformation,
IN ULONG SystemInformationLength,
OUT PULONG ReturnLength OPTIONAL
); //定义结构
NTSYSAPI BOOLEAN NTAPI KeAddSystemServiceTable(
ULONG lpAddressTable,
BOOLEAN bUnknown,
ULONG dwNumEntries,
ULONG lpParameterTable,
ULONG dwTableID
);
//****************************函数声明*************************************
//根据地址查找模块
void FindModuleByAddress( ULONG Address, PVOID buffer);
//根据RVA查找SSDT 文件偏移
ULONG FindFileOffsetByRva( ULONG ModuleAddress,ULONG Rva);
//路径解析出子进程名
void GetModuleName( char *ProcessPath, char *ProcessName);
//根据服务号得到当前的地址
ULONG FindOriAddress( ULONG index );
//得到SSDT Shadow表地址
ULONG GetSSDTShadowAddress2();
ULONG GetWin32Base2( PDRIVER_OBJECT driver);
ULONG FindShadowOriAddress( ULONG index );
/*****************************************************************************************
*
*函数名:FindModuleByAddress
*功能描述:根据函数地址查找所属模块
*
******************************************************************************************/
/*****************************************************************************************
*
* 原理: 利用ZwQuerySystemInformation传入SystemModuleInformation(11)得到系统模块列表
* 得到每个模块的起始和结束地址
* 比对地址,在那个范围就属于哪个模块
* 得到模块名
*
******************************************************************************************/
#include "refresh.h"
voi |