吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 3178|回复: 11
收起左侧

[.NET] ACEPatcher

[复制链接]
风吹屁屁凉 发表于 2022-8-11 15:44

ACEPatcher

A simple to use, gui based program for patching .NET assemblies

ACE patcher

Features

  • Patches a wide range of methods(static methods, instance methods, constructors, getters, setters, etc.)
  • Works on packed assemblies
  • Works on a majority of obfuscators(including but not limited to:DnGuard,Eazfuscator,VMProtect,.NET reactor,Babel,Crypto Obfuscator and many more)
  • Easy and intuative GUI
  • Exports patches
  • Exports patches with password
  • Imports patches

How to write patch methods

Firstly you have to analyze the target assembly and see which methods do you want to patch, once you found the methods you want to patch open a new visual studio c# project and write patch methods after you have written patch methods compile the assembly with Release build.

Patch method must be static and public.

If the target method is static, the signature of the patch method must match the signature of target method:

//Target method
private static bool TargetMethod(string text,byte[] array)
{
//...
}

//Patch method
public static bool PatchMethod(string something,byte[] somethingelse)
{
//...
}

If the target method is not static, patch method must return the same type, first argument of the patch method must be type target method belongs to and the rest of the arguments are copied from the target method:

//Target method
class A
{
  private int TargetMethod(string text)
  {
  //...
  }
}

//Patch method
public static int PatchMethod(A instance,string text)
{
//...
}

Within the patch method you can modify the return value of the TargetMethod:

//Target method
private static bool TargetMethod(string text)
{
//...
}

//Patch method
public static bool PatchMethod(string text)
{
  return true;
}

You can execute the original method by calling the patch method from within itself, the values of passed parameters will be ignored to change parameters modify the values of parameters passed to patch method:

//Target method
private static bool TargetMethod(string text)
{
//...
}

//Patch method
public static bool PatchMethod(string text)
{
  //This will change the text parameter in the original method
  text = "Something else";
  //This will return the execution to the original method
  return PatchMethod(text);
}

Or you could do both:

//Target method
private static bool TargetMethod(string text)
{
//...
}

//Patch method
public static bool PatchMethod(string text)
{
  if(text.Contains("Invalid password"))
    return true;
  else
    return PatchMethod(text);
}

If the method is not static you can also edit the values of fields and properties on the object associated with target method.

How to patch assembly

Once you wrote the patch methods and compiled them into a .NET assembly open ACE patcher

Go to file -> open or click ctrl+o or drag n' drop target assembly onto ACE patcher.
Note: if you are loading in a packed assembly you must use 32 bit ACE patcher for 32 bit assembly and 64 bit ACE patcher for 64 bit assembly.
After the assembly is imported you will see it and it's dependancies in the 'Assembly Tree' panel, this panel has an interface similar to that of DnSpy.
Navigate to the methods you want to patch and double click them, if this is the first patch you are making the program will ask you to load the patch assembly.
A new window will appear that will list all the methods in the patch assembly, choose the one that patches the target method and then click on Add patch button.
Repeat that for all the methods you want to patch and after you've patched all the methods click on the apply patches button.
Then, in the result folder, move all of the files associated with the main assembly(resources ,configurations ,dll dependancies , misc files) and then click on Execute.bat to run patched version of the assembly.

Export patch

Let's say you have 5 assemblies that use the same auth provider, it would be tedious to manually patch every single one, so that is why export functionality exists to use it first patch one of the assemblies manually then go to file -> Export or click ctrl+E and the patch will be saved as file then load in the seconds assembly go to file -> Import or clicl ctrl+I to import all of the patches, these exports can also be distributed.

ACE patcher also allows you to password protect patches to export password protected patch go to File -> Secure Export or click ctrl+shift+E, when you try to import password protected patch you will be asked to provide the password and you won't be able to load the patch without the correct password.

Credits

  • dnlib - This is used for .net assembly manipulation
  • Harmony  - This is used for patching the assemblies
  • JitFreezer - This is used to deal with anti-dump when loading packed files
  • DarkUI - This is used for the dark theme

Down

https://github.com/BataBo/ACEPatcher/releases

免费评分

参与人数 2吾爱币 +1 热心值 +2 收起 理由
Shock + 1 + 1 用心讨论,共获提升!
笙若 + 1 谢谢@Thanks!

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

canon75 发表于 2022-8-11 17:29
Peace在南宁也算是个白领
canon75 发表于 2022-8-11 17:40
chaifengbox 发表于 2022-8-11 19:13
Xiers0721 发表于 2022-8-11 20:08
楼主是南宁老表吗
15028352577 发表于 2022-8-11 22:52
吼吼吼,谢谢分享
lyliucn 发表于 2022-8-12 08:48
可以学习一下怎么修补net程序。
maniacwj 发表于 2022-8-15 01:32
这个是.NET的支持?收藏了,感谢!
wdhmzt 发表于 2022-8-15 08:49
楼主能稍微介绍一下这个技术吗,有点不明所以~
lyliucn 发表于 2022-8-15 08:53
最好能给个例子学习学习。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-12-22 19:22

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表