zoukankan      html  css  js  c++  java
  • 简单破解.net(C#)程序

    一直在用makedown2(free版),每当打开多个页面,就会提示升级为pro,还要注册码激活什么的。就有了破解的想法。以前也弄过一个小程序的破解,所以还算有些经验。

    1. ildasm 用来将makedown2.exe转存为 il文件和res资源

    2.修改il代码。通过分析得知新建文件、到处pdf和 自动保存都调用了 ValidateLicense 函数(返回值bool) 开来有重大嫌疑,试试直接返回true;

    return true : 在il文件中如何表示呢!我用c# 写了个函数,用来提取return true代码

    //000017: 
    //000018:         static bool test(string str)
    //000019:         {
    //000020:             if (str.Length > 0)
        IL_0000:  /* 02   |                  */ ldarg.0
        IL_0001:  /* 6F   | (0A)000011       */ callvirt   instance int32 [mscorlib/*23000001*/]System.String/*01000013*/::get_Length() /* 0A000011 */
        IL_0006:  /* 16   |                  */ ldc.i4.0
        IL_0007:  /* 31   | 02               */ ble.s      IL_000b
    
        .line 22,22 : 17,29 ''
    //000021:             {
    //000022:                 return true;
        IL_0009:  /* 17   |                  */ ldc.i4.1
        IL_000a:  /* 2A   |                  */ ret
    
        .line 26,26 : 17,30 ''
    //000023:             }
    //000024:             else
    //000025:             {
    //000026:                 return false;
        IL_000b:  /* 16   |                  */ ldc.i4.0
        IL_000c:  /* 2A   |                  */ ret
      } // end of method Program::test
    
      .method /*06000003*/ public hidebysig specialname rtspecialname 
              instance void  .ctor() cil managed
      // SIG: 20 00 01
      {
        // Method begins at RVA 0x2069
        // Code size       7 (0x7)
        .maxstack  8
        IL_0000:  /* 02   |                  */ ldarg.0
        IL_0001:  /* 28   | (0A)000012       */ call       instance void [mscorlib/*23000001*/]System.Object/*01000001*/::.ctor() /* 0A000012 */
        IL_0006:  /* 2A   |                  */ ret
      } // end of method Program::.ctor

    所以要将函数开头位置修改成红色字体代码这样就ok 了

     .maxstack  6
        .locals /*1100000B*/ init (class MarkdownPad2.Properties.Settings/*02000072*/ V_0,
                 class MarkdownPad2.Core.StartupHelper/*02000006*/ V_1,
                 valuetype MarkdownPad2.Core.StartupResult/*02000007*/ V_2,
                 string V_3,
                 string V_4,
                 string V_5,
                 valuetype [PresentationFramework/*23000002*/]System.Windows.MessageBoxResult/*01000091*/ V_6,
                 class MarkdownPad2.Licensing.UpgradeProWindow/*0200006A*/ V_7,
                 class MarkdownPad2.Licensing.UpgradeProWindow/*0200006A*/ V_8,
                 string[] V_9)
        IL_0000:  /* 17   |                  */ ldc.i4.1
        IL_0001:  /* 2A   |                  */ ret
        IL_0006:  /* 73   | (06)000011       */ newobj     instance void MarkdownPad2.Core.StartupHelper/*02000006*/::.ctor() /* 06000011 */
        IL_000b:  /* 0B   |                  */ stloc.1

    直接修改了函数入口,进去就return true 了

    保存好文件

    3.利用ilasm.exe 将il文件重新编译为exe

    使用资源管理器搜索ilasm.exe 一般在.net 框架目录下。在ilasm所在目录下打开cmd,输入以下代码。(自己根据自己的情况修改下)

    ilasm /RESOURCE=C:UsersxxxDocumentsmakedown2.res C:UsersxxxDocumentsmakedown2.il

    这样程序就编译成功了。

    这样就解禁了很多功能。不过开始启动很慢,点击注册什么的还提示错误!

    签名档: 从事网络安全和编程的我,很希望能找到志同道合的朋友交流。 欢迎cn博客的好友拍砖,留言。
  • 相关阅读:
    JSP自定义标签
    Java集合之Arrays 剖析
    关于Java8中的Comparator那些事
    关于Comparable和Comparator那些事
    浅析Thread的join() 方法
    多线程的具体实现
    如何实现 List 集合的线程安全
    集合使用 Iterator 删除元素
    Tomcat目录详解
    一文读懂微服务架构
  • 原文地址:https://www.cnblogs.com/M4ster/p/csharp_makedown2_pojie.html
Copyright © 2011-2022 走看看