顯示具有 破解 標籤的文章。 顯示所有文章
顯示具有 破解 標籤的文章。 顯示所有文章

2020年12月9日 星期三

Obfuscar, 混淆,保護,反破解 .NET 程式

簡介

.NET 是種很好上手的語言之一,但因為它的特性,使它跟 JAVA 一樣很容易被反編譯,不像 C 、C++開發的語言,.NET 的反編譯工具是可以產出與原版檔案相近的程式碼(含字串,變數,函數名稱等等),甚至反編譯出來的程式碼可以直接再編譯出跟原本功能一樣的程式。為了避免被反編譯後,因為這些名稱而使得被破解或盜取程式碼更加容易,有一些工具被開發出來混淆這些變數名稱,讓原本易讀的名稱通通轉成不相關的名稱 ,增加破解難度 ,Obfuscar 就是一個這樣的工具

相關聯結

官網:https://www.obfuscar.com/ (https://obfuscar2.mystrikingly.com/)

原始碼: https://github.com/obfuscar/obfuscar


平常使用可透過 nuget,直接下載來用:
https://www.nuget.org/packages/Obfuscar/


用法

通常我是直接在 Visual Studio nuget工具中直接下載

然後在專案中新增下面檔案

其中setting.xml 內容如下:
<?xml version='1.0'?>
<Obfuscator>
  <Var name="InPath" value="." />
  <Var name="OutPath" value=".\Obfuscator_Output" />
  <Var name="KeepPublicApi" value="false" />
  <Var name="HidePrivateApi" value="true" />
  <Var name="KeyFile" value=".\key.snk" />

  <Module file="$(InPath)\Imbusy.exe" />
</Obfuscator>

key.snk 內容隨便,要不要特意用密碼(檔)都可

最後在 專案-> project 屬性 -> 建置事件->建置後事件命令列 內加上 

if "$(ConfigurationName)" == "Release" (
"$(Obfuscar)" ..\..\Obfuscator\setting.xml
copy Obfuscator_Output\$(TargetFileName) $(TargetPath)
)

這樣在 build release 版本的時候, release資料夾下的執行檔就是經過混淆過後的檔案了,
copy 那行是將加密後的執行檔拷貝回 release 資料夾,可視需求移除

2018年10月12日 星期五

.Net 免費混淆,反組譯工具(free .Net obfuscator, decompile tool)

混淆工具 obfuscator tools

          文檔: http://docs.obfuscar.com/
          下載: https://github.com/obfuscar/obfuscar/releases
          簡中教學: https://www.cnblogs.com/zhangzhi19861216/p/3937434.html
          下載: https://github.com/yck1509/ConfuserEx/releases

反組譯工具 decompile tool