DotNET也谈组合强命名破解FlyGrid 1.5.0.31963 for VS2003

DotNET也谈组合强命名破解-FlyGrid 1.5.0.31963 for VS2003 破解手记 14:51 2007-9-28 WUQING

    这两天手上的项目忙得一直没空,到今天总算有点空闲,把FlyGrid.NET破解过程整理出来,与大家交流
    试用特点:
    未破解前,在控件设计打开时和运行会显示9Rays的一个logo对话框,对话框显示的主要文字如下:
      9Rays.FlyGrid.Net Evaluation
      9Rays.Net (с) 2006
      Ver.1.5.0.31936
      EVALUATION VERSION

    作    者:wuqing0312
    破解工具:ildasm,ilasm,StrongNameRemove20, UEDIT

    破解目的:仅限于技术交流,没有其他目的。失误之处敬请诸位大侠赐教!

    版权声明:本文原创于『 一蓑烟雨 』论坛, 转载请注明作者并保持文章的完整, 谢谢!

   

    1. 用ildasm打开NineRays.FlyGrid.dll,转存为aaa.il;

    2. 找到用UEdit打开aaa.il,先把它的publickey干掉

  .publickey = (00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00   // .$..............
                00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00   // .$..RSA1........
                15 B1 C3 50 68 D2 A2 BD 46 F4 9B E1 F1 78 C4 A5   // ...Ph...F....x..
                CC 25 4C B0 C3 CF 01 04 05 20 42 2C 52 61 12 F7   // .%L...... B,Ra..
                64 E8 0C 1A 0D C4 1D 69 1B 93 78 07 60 08 6F 9F   // d......i..x.`.o.
                6F 86 EE 45 47 EA BD 59 A8 00 B8 3E 2D 4E 3F C9   // o..EG..Y...>-N?.
                81 D9 BE 9E 7C B3 3E E9 CD 0B C9 42 0B 61 C3 24   // ....|.>....B.a.$
                E9 30 0E EC 4B EF 19 1B F6 CA 4F 9C 58 A0 7E 6F   // .0..K.....O.X.~o
                E7 96 5F 1F D3 36 69 A4 76 B8 7C 3D DB 87 4F 49   // .._..6i.v.|=..OI
                D1 3B 16 52 D0 44 FC E7 52 F9 2C 71 A6 12 E0 D0 ) // .;.R.D..R.,q....
  .hash algorithm 0x00008004
    直接删除

    3. 查找EVALUATION我们来到
  .method private hidebysig specialname rtspecialname static
          void  .cctor() cil managed
  {
    // 代码大小       105 (0x69)
    .maxstack  4
    .locals init (class ''.'1' V_0)
    IL_0000:  ldsfld     valuetype [System.Drawing]System.Drawing.Point [System.Drawing]System.Drawing.Point::Empty
    IL_0005:  stsfld     valuetype [System.Drawing]System.Drawing.Point NineRays.Windows.Forms.FlyGrid::''
    IL_000a:  ldc.i4.3
    IL_000b:  stsfld     int32 NineRays.Windows.Forms.FlyGrid::''
    IL_0010:  ldc.i4.m1
    IL_0011:  ldc.i4.m1
    IL_0012:  newobj     instance void [System.Drawing]System.Drawing.Point::.ctor(int32,
                                                                                   int32)
    IL_0017:  stsfld     valuetype [System.Drawing]System.Drawing.Point NineRays.Windows.Forms.FlyGrid::''
    IL_001c:  ldnull
    IL_001d:  stsfld     class NineRays.Windows.Forms.Grids.FlyGridViewPort NineRays.Windows.Forms.FlyGrid::''
    IL_0022:  ldnull
    IL_0023:  stsfld     class NineRays.Windows.Forms.Grids.FlyGridViewPort NineRays.Windows.Forms.FlyGrid::''
    IL_0028:  ldc.i4.0
    IL_0029:  stsfld     valuetype NineRays.Windows.Forms.FlyGrid/'' NineRays.Windows.Forms.FlyGrid::''
    IL_002e:  ldnull
    IL_002f:  stsfld     class [System.Drawing]System.Drawing.Bitmap NineRays.Windows.Forms.FlyGrid::''
    IL_0034:  ldnull
    IL_0035:  stsfld     class [System.Drawing]System.Drawing.Bitmap NineRays.Windows.Forms.FlyGrid::''
    IL_003a:  ldnull
    IL_003b:  stsfld     class [System.Drawing]System.Drawing.Bitmap NineRays.Windows.Forms.FlyGrid::''
    IL_0040:  ldnull
    IL_0041:  stsfld     class [System.Drawing]System.Drawing.Bitmap NineRays.Windows.Forms.FlyGrid::''
    IL_0046:  ldc.i4.0
    IL_0047:  stsfld     valuetype NineRays.Windows.Forms.FlyGrid/'' NineRays.Windows.Forms.FlyGrid::''

    // 我们找到这里了
    IL_004c:  ldstr      "Evaluation"
    IL_0051:  ldsfld     string [mscorlib]System.String::Empty
    IL_0056:  ldsfld     string [mscorlib]System.String::Empty

    // 这是什么呀,创建一个混淆过的对象呀,值得我们注意
    IL_005b:  newobj     instance void ''.'1'::.ctor(string,
                                                       string,
                                                       string)
    IL_0060:  stloc.0

    //*** 这是什么呀,弹出一个模式窗口,会不会是那上窗口呢?再看一下后面end of method FlyGrid::.cctor,明显是构造函数,在构造

函数里显示模式窗口,肯定不会是正常的窗口,干掉再说
    //IL_0061:  ldloc.0
    //IL_0062:  callvirt   instance valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult [System.Windows.Forms]

System.Windows.Forms.Form::ShowDialog()
    //IL_0067:  pop
    IL_0068:  ret
  } // end of method FlyGrid::.cctor

    4. 我们继续查找,不过这次,不找[ Evaluation ]这个了,我们找[ '1'::.ctor( ]这个,看看还有没有类似的代码,找了几次后,我们

来到
  .method public hidebysig virtual instance object
          EditValue(class [System]System.ComponentModel.ITypeDescriptorContext context,
                    class [mscorlib]System.IServiceProvider provider,
                    object 'value') cil managed
  {
    // 代码大小       20 (0x14)
    .maxstack  1
    .locals init (class ''.'1' V_0)
    IL_0000:  ldnull
    IL_0001:  stloc.0
    IL_0002:  ldloc.0
    // 别忘了修改下面这个地方哦,要不然,会编译失败的哦:)
    IL_0003:  brtrue.s   IL_0012 // 修改前 IL_0003:  brtrue.s   IL_000b

    // 我们找到的地方 有没有发现这段代码跟上面的代码很相似的呀?尤其是下面的显示对话框的过程,不管了,先把对话框拿掉再说
    // 在这里,别忘了上面的一个跳转语句哦,发现什么了?原来那个跳转的位置被我们干掉了,那就把跳改一下吧,呵呵:)
    IL_0005:  newobj     instance void ''.'1'::.ctor()
    IL_000a:  stloc.0
    //IL_000b:  ldloc.0
    //IL_000c:  callvirt   instance valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult [System.Windows.Forms]

System.Windows.Forms.Form::ShowDialog()
    //IL_0011:  pop
    IL_0012:  ldnull
    IL_0013:  ret
  } // end of method ''::EditValue

  5. 好了,可以先编译一下看看是不是破解成功了...
  ilasm /dll /resource=aaa.res aaa.il

  6. 看来运气不错,成功编译了,那我们就可以试试那个限制是不是被去掉了呢?
  7. 原来建的程序是可以运行了,不过发现个问题,在设计模式的时候,不正常呀,添加新列的时候,会异常

  8. 怎么办呢?看来按常规简单地把强命去掉,还是不够完美呀,这时候,在看雪的论坛上看到了“破解Spices.net v5.1 --- 试谈.net程序

的破解”这篇文章,参考前辈的文章,换个思路吧,我们不去掉强命,而是修改强命名。

  9. 先来生成一个snk文件吧,嘿嘿,命令是sn -k sn.snk
  
  10. 下在来替换强命名吧

去强名,用snr 替换吧(引自原来的)
/SC 原强命名 新强命名
/UC 原强命名 新强命名
/B 原强命名 新强命名
/SC 原强命名标识 新强命名标识
/UC 原强命名标识 新强命名标识
/B 原强命名标识 新强命名标识

   用一个snr.exe的小程序执行,其实就是二进制替换,前三个是替换强名称公钥,后三个是替换强名称公钥的,可以参考“破解Spices.net

v5.1 --- 试谈.net程序的破解”,这篇文章,这一步可以在得到IL文件前,也可以放到编译完成后。
  组件文件列表:
      NineRays.FlyGrid.Styles.dll
      NineRays.FlyGrid.Design.dll
      NineRays.FlyGrid.Columns.DLL
      NineRays.FlyGrid.DLL
  11. 用StrongNameRemove20可以查看到三个文件的引用关系,而我们要修改的地方只在NineRays.FlyGrid.DLL里面,所以其他三个文件,只

需要简单地把强命名替换了就好了(在我的附件里有snr.exe这个小工具,和生成的强命名文件,以及去掉强命和重新签强命名的CMD文件)
  12. 然后汇编以后,参照上面的代码去掉LOGO吧,注意,这次再去掉的时候就不要再把强命名去掉了哦。
  修改完成后即可编译,这次再测试一下吧,呵呵,OK了,收工...

  注意:VS2005步骤基本相同,这里不再重复^_^
原文地址:https://www.cnblogs.com/cxd4321/p/1211841.html