Skip to content

Commit

Permalink
更新readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mingkuang-Chuyu committed Dec 20, 2019
1 parent 22d8296 commit c32f726
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
13 changes: 13 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ YY::LoadLibraryFormSystem32(L"C:\\Program Files (x86)\\XXXX\\sites.dll");
另外,对于通过导入表直接引入的DLL则可以设置为延迟加载,YY-Guard就能自动免疫此类型的攻击。
## 2. 使用YY-Guard
### 2.1. 通过NuGet引用(推荐)
1. 项目右键 - 管理 NuGet 程序包。
2. 在搜索框中输入YY-Cuard,然后点击安装。
3. 项目属性 - YY-Guard - 启用安全延迟加载 - 『是』
4. 所有代码显式 LoadLibrary 的行为尽可能的替换为 YY::LoadLibraryFormSystem32(需要 #include <YY-Guard.h>)。
5. 重新编译代码。
### 2.2. 传统方式引用
1. 下载[YY-Guard-Binary](https://github.com/Chuyu-Team/YY-Guard/releases),然后解压到你的工程目录。<br/>
2. 【链接器】-【输入】-【附加依赖项】,添加`objs\$(PlatformShortName)\YY_Guard.obj`。<br/>
3. 对于通过导入表直接引用的DLL,并且又能发生劫持的则设置为延迟加载(一般来说exe工程必须设置延迟加载,而dll项目则按自己喜好)。
Expand Down Expand Up @@ -122,3 +131,7 @@ extern "C" const PfnDliHook __pfnDliNotifyHook2 = [](unsigned dliNotify,PDelayLo

### 1.0.0.1 - 第一版(2019-06-24 18:00)
* 第一正式版。


### 1.0.0.2 - 改进体验(2019-12-20 19:30)
* 添加 NuGet 支持。
7 changes: 6 additions & 1 deletion src/Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ goto:eof
mkdir "Out\\%Platform%"
mkdir "Libs\\%Platform%"

del "Out\\%Platform%\\*" /q /s

cl %AdditionalOptions% /D "__YY_GUADD_BUILD_LIBS" /D "__YY_GUARD_MIN_SUPPORT=%2" /Fo"Out\\%Platform%\\delayhlp.obj" "%~dp0delayhlp.cpp"
cl %AdditionalOptions% /D "__YY_GUARD_MIN_SUPPORT=%2" /Fo"Out\\%Platform%\\YY-Guard.obj" "%~dp0YY-Guard.cpp"
cl %AdditionalOptions% /Fo"Out\\%Platform%\\pfnDliFailureHook2.obj" "%~dp0pfnDliFailureHook2.c"
cl %AdditionalOptions% /Fo"Out\\%Platform%\\pfnDliNotifyHook2.obj" "%~dp0pfnDliNotifyHook2.c"

lib "Out\%Platform%\*.obj" /out:"Libs\%Platform%\%1"

cl %AdditionalOptions% /D "__YY_GUARD_MIN_SUPPORT=%2" /Fo"Out\\%Platform%\\YY-Guard.obj" "%~dp0YY-Guard.cpp"

lib "Out\%Platform%\YY-Guard.obj" /out:"Libs\%Platform%\YY-Guard.lib"

echo "Libs\%Platform%\%1"

goto:eof
Expand Down
27 changes: 27 additions & 0 deletions src/BuildAll.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off


setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
call "%~dp0Build.cmd"
endlocal


setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
call "%~dp0Build.cmd"
endlocal


setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat"
call "%~dp0Build.cmd"
endlocal


setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
call "%~dp0Build.cmd"
endlocal

pause

0 comments on commit c32f726

Please sign in to comment.