简单破解.net(C#)程序

本文介绍了一种破解MarkdownPad2软件的方法,通过反编译、修改IL代码并使其始终返回true来解锁软件功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一直在用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:\Users\xxx\Documents\makedown2.res C:\Users\xxx\Documents\makedown2.il

这样程序就编译成功了。

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

转载于:https://www.cnblogs.com/M4ster/p/csharp_makedown2_pojie.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值