注入DLL - InjectDll
函数简介
向目标进程注入 DLL,支持多种注入模式。
注入模式:
- 0:R3 远程注入
- 1:驱动 shellcode 注入
- 2:驱动远程注入
接口名称
InjectDll
DLL调用
int32_t InjectDll(int64_t instance, int64_t pid, char* dll_path, int32_t mode);
参数说明
参数名 | 类型 | 说明 |
---|---|---|
instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
pid | 长整数型 | 目标进程ID。 |
dll_path | 字符串 | DLL 文件路径。 |
mode | 整数型 | 注入模式(0/1/2)。 |
示例
int64_t instance = CreateCOLAPlugInterFace();
int32_t ok = InjectDll(instance, 4567, "C:/temp/test.dll", 0);
printf("InjectDll: %d\n", ok);
DestroyCOLAPlugInterFace(instance);
返回值
1 成功,其他失败。
注意事项
- 需要管理员权限,驱动模式需要驱动已加载。
- 目标进程需与 DLL 架构匹配(x86/x64)。