-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomLoadLibraryS.h
More file actions
26 lines (24 loc) · 975 Bytes
/
CustomLoadLibraryS.h
File metadata and controls
26 lines (24 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//********************************************************************
// filename: F:\mygit\ManageTools_src\GtManage\CustomLoadLibraryS.h
// desc: 自己写的LoadLibrary函数
// CreateFileMapping时使用SEC_IMAGE标记,由系统做段读写属性设置
// 和代码重定位,相对自己处理,代码更简化。
// created: wangdaye 20:7:2023 17:17
//********************************************************************
#ifndef CustomLoadLibraryS_h__
#define CustomLoadLibraryS_h__
#include "CustomLoadLibraryBase.h"
class CustomLoadLibraryS :public CustomLoadLibraryBase
{
public:
static CustomLoadLibraryS* instance();
private:
//按PE格式载入文件到内存
LPVOID MapFile2Mem(HANDLE _hFile);
//初始化输入表
BOOL ResolveImport(LPVOID _baseDll, TMODULE* _pModule);
//根据一个地区找到在哪个段
BOOL Address2Section(LPVOID _baseDll, LPVOID _address, LPVOID& _secBegin, size_t& _secSize);
HMODULE LoadLibraryWrapped(const std::string& _lpFileName);
};
#endif // CustomLoadLibraryS_h__