由于公司业务需要简单的把代码加密混淆,于是了解了一下相关的工具然后打算用ConfuserEx试试。

开源地址:https://github.com/yck1509/ConfuserEx/

下载地址:https://github.com/yck1509/ConfuserEx/releases

开始工作

1.简单编写一个产生随机数的Winform窗口程序

代码如下

using System;
using System.Windows.Forms; namespace ConfuserEx_Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
var max = (double)numericUpDown1.Value;
var min = (double)numericUpDown2.Value;
Random random = new Random();
double v = random.NextDouble() * (max -min) + min;
label1.Text = v.ToString();
textBox1.AppendText(v.ToString() + "\r\n"); }
}
}

Form1.cs

namespace ConfuserEx_Test
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region Windows 窗体设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(, );
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(, );
this.button1.TabIndex = ;
this.button1.Text = "生成随机数";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(, );
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(, );
this.label1.TabIndex = ;
this.label1.Text = "label1";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(, );
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox1.Size = new System.Drawing.Size(, );
this.textBox1.TabIndex = ;
//
// numericUpDown1
//
this.numericUpDown1.Location = new System.Drawing.Point(, );
this.numericUpDown1.Maximum = new decimal(new int[] {
,
,
,
});
this.numericUpDown1.Minimum = new decimal(new int[] {
,
,
,
-});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(, );
this.numericUpDown1.TabIndex = ;
this.numericUpDown1.Value = new decimal(new int[] {
,
,
,
});
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(, );
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(, );
this.label2.TabIndex = ;
this.label2.Text = "最大值";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(, );
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(, );
this.label3.TabIndex = ;
this.label3.Text = "最小值";
//
// numericUpDown2
//
this.numericUpDown2.Location = new System.Drawing.Point(, );
this.numericUpDown2.Maximum = new decimal(new int[] {
,
,
,
});
this.numericUpDown2.Minimum = new decimal(new int[] {
,
,
,
-});
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Size = new System.Drawing.Size(, );
this.numericUpDown2.TabIndex = ;
this.numericUpDown2.Value = new decimal(new int[] {
,
,
,
-});
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(, );
this.Controls.Add(this.numericUpDown2);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.numericUpDown1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "ConfuserEx加密混淆测试";
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
this.ResumeLayout(false);
this.PerformLayout(); } #endregion private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.NumericUpDown numericUpDown2;
}
}

Form1.Designer.cs

其功能如图:

2.下载打开ConfuserEx使用

2.1 将生成的exe文件拖拽到ConfuserEx的Project中

2.2在Settings中选中Packer(据说dll文件不是这样的),再点击exe文件,添加一个True。

2.3点击Protect!看到Finished at xx:xx, xx:xx elapsed.表示完成

3.测试加密混淆结果

3.1下载ILSpy--(百度百科:ILspy是一个开源的.net反编译软件,使用十分方便。)

3.2将保护前编译出的exe文件拖拉到ILSpy中

很方便就能够看到源码

3.2 将保护后的exe文件拖拉到ILSpy中与之前的做对比

4.结论

简单的测试了一下,这种保护便于操作,有明显的保护效果,能够防止只会下载反编译软件来获得源码的人,但是可能不是所有反编译软件都能防止。只是做个简单保护。

后面我会做一个Reflector反编译实验以及脱壳后再来反编译。

附加1

Reflector反编译实验结果,保护后的直接打不开

测试开源.net 混淆器ConfuserEx的更多相关文章

  1. 开源.net 混淆器ConfuserEx介绍

    今天给大家介绍一个开源.net混淆器——ConfuserEx http://yck1509.github.io/ConfuserEx/ 由于项目中要用到.net 混淆器,网上搜寻了很多款,比如Dotf ...

  2. [转]开源.net 混淆器ConfuserEx介绍

    今天给大家介绍一个开源.net混淆器——ConfuserEx http://yck1509.github.io/ConfuserEx/ 由于项目中要用到.net 混淆器,网上搜寻了很多款,比如Dotf ...

  3. 开源.net 混淆器ConfuserEx介绍 [转]

    今天给大家介绍一个开源.net混淆器——ConfuserEx http://yck1509.github.io/ConfuserEx/ 由于项目中要用到.net 混淆器,网上搜寻了很多款,比如Dotf ...

  4. 一个开源.net混淆器——ConfuserEx (收藏)

    一个开源.net混淆器——ConfuserEx http://yck1509.github.io/ConfuserEx/ 由于项目中要用到.net 混淆器,网上搜寻了很多款,比如Dotfuscator ...

  5. .NET代码混淆——开源.net 混淆器ConfuserEx介绍

    转载:https://blog.csdn.net/xiaoyong_net/article/details/78988264

  6. Python:渗透测试开源项目

    Python:渗透测试开源项目[源码值得精读] sql注入工具:sqlmap DNS安全监测:DNSRecon 暴力破解测试工具:patator XSS漏洞利用工具:XSSer Web服务器压力测试工 ...

  7. jocky1.0.3 (原joc) java混淆器 去除jdk版本限制

    昨晚下班回去,研究了下jocky1.0.3的使用,发现编译时提示引用类库版本不对,捣弄了半个小时后终于理解,原来是我的jdk1.7版本过高,这货是06年的版本,到现在都没更新过,支持(限制)的最高版本 ...

  8. 11大Java开源中文分词器的使用方法和分词效果对比,当前几个主要的Lucene中文分词器的比较

    本文的目标有两个: 1.学会使用11大Java开源中文分词器 2.对比分析11大Java开源中文分词器的分词效果 本文给出了11大Java开源中文分词的使用方法以及分词结果对比代码,至于效果哪个好,那 ...

  9. 11大Java开源中文分词器的使用方法和分词效果对比

    本文的目标有两个: 1.学会使用11大Java开源中文分词器 2.对比分析11大Java开源中文分词器的分词效果 本文给出了11大Java开源中文分词的使用方法以及分词结果对比代码,至于效果哪个好,那 ...

随机推荐

  1. opencv 2 Opencv数据结构与基本绘图

    基础图像容器Mat Mat 是一个类,又两个数据部分组成:矩阵头(包含矩阵尺寸,存储方法,存储地址等信息)和一个指向存储所有像素值的矩阵(根据所选存储方法不同,矩阵可以是不同的维数)的指针.矩阵头的尺 ...

  2. keypress 和 blur 事件冲突的问题

    需求:点击需求:点击添加标签,出来input框,内容输入完成后点击enter键和blur时都可以执行提交标签的效果,提交时对内容进行判断,执行完成后清除input内的内容.如下图 问题:内容输入完成后 ...

  3. 甲小蛙战记:PHP2Java 排雷指南

    (马蜂窝技术原创内容,申请转载请在公众后后台留言,ID:mfwtech ) 大家好,我是来自马蜂窝电商旅游平台的甲小蛙,从前是一名 PHP 工程师,现在可能是一名 PHJ 工程师,以后...... 前 ...

  4. 极化码之tal-vardy算法(1)

    继前两节我们分别探讨了极化码的编码,以及深入到高斯信道探讨高斯近似法之后,我们来关注一个非常重要的极化码构造算法.这个算法并没有一个明确的名词,因此我们以两位发明者的名字将其命名为“Tal-Vardy ...

  5. JDK官方下载

    平时进行java开发时避免不了使用jdk,而现在jdk版本已经到1.9了,但是之前版本下载在官方网站就不好找了(主要还是因为网站是英文的): 进入官网下载jdk的前提是进入官网,直接百度搜jdk下载也 ...

  6. spring boot 中@Mapper和@Repository的区别

    0--前言 @Mapper和@Repository是常用的两个注解,两者都是用在dao上,两者功能差不多,容易混淆,有必要清楚其细微区别: 1--区别 @Repository需要在Spring中配置扫 ...

  7. 第三章 学习Shader所需的数学基础(3)

    @[TOC] 1. 顶点的坐标空间变换过程 我们知道,在渲染流水线中,一个顶点要经过多个坐标空间的变换才能最终被画在屏幕上.一个顶点最开始是在模型空间中定义的,它最后会被变换到屏幕空间中,得到真正的屏 ...

  8. 8. SOFAJRaft源码分析— 如何实现日志复制的pipeline机制?

    前言 前几天和腾讯的大佬一起吃饭聊天,说起我对SOFAJRaft的理解,我自然以为我是很懂了的,但是大佬问起了我那SOFAJRaft集群之间的日志是怎么复制的? 我当时哑口无言,说不出是怎么实现的,所 ...

  9. 微信小程序——动态修改页面数据(和样式)及参数传递

    1.1.1动态修改页面数据 在小程序中我们经常要动态渲染数据,对于新手而言我们常常遇到修改的数据在控制台显示和页面显示不一致,因为我们用“=”修改数据的,这种是可以修改,但无法改变页面的状态的,还会造 ...

  10. 使用Python编写打字训练小程序【华为云技术分享】

    版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/devcloud/article/detail ...