64,685
社区成员
发帖
与我相关
我的任务
分享
//ZwUnmapViewOfSection(,);
HMODULE hNtDll = GetModuleHandle(TEXT("ntdll.dll"));
if (!hNtDll)
{
print("get dll handle is file\n");
return -1;
}
ZWUNMAPVIEWOFSECTION ZwUnmapViewOfSection = (ZWUNMAPVIEWOFSECTION)GetProcAddress(
hNtDll, "ZwUnmapViewOfSection");
int ret = ZwUnmapViewOfSection(shell_pi.hProcess, (void*)(this->shell_image_base)); //此处调用
//是想卸载掉外壳程序的镜像 第二个参数应该填 image_base 对应的地方
//但是这样写的话 一直出错 个人又想不通到底该写什么
print("ret -- %x\n", ret);
DWORD proc_image_base = this->des_sec->out_optional_head()->ImageBase;
int buf_size = Tool::get_newbuf_size(this->des_sec);
print(" (void*)proc_image_base-- %x", (void*)(&proc_image_base));
while (i < 100)
{
start = VirtualAllocEx(this->shell_pi.hProcess, (void*)(&proc_image_base),
buf_size,MEM_COMMIT, PAGE_EXECUTE_READWRITE);
//第二个参数是想在指定位置 分配内存 想在进程空间中 处于image_Base 的地方申请空间
//但是写成这样一直出错 proc_image_base 就是一个pe 文件的 image_base
if (0 != start)
{
break;
}
proc_image_base += this->des_sec->out_optional_head()->SectionAlignment;
}