UltraDebug

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: A C D R G Y M Z X S P
公益项目,接受捐赠
查看: 2822|回复: 0
收起左侧

[.Net] ACEPatcher

[复制链接]
Pierce

主题

0

回帖

UD

新手上路

UID
28
积分
25
注册时间
2022-2-12
最后登录
1970-1-1
2022-8-12 23:03:07 | 显示全部楼层 |阅读模式

ACEPatcher

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

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

UltraDebug免责声明
✅以上内容均来自网友转发或原创,如存在侵权请发送到站方邮件9003554@qq.com处理。
✅The above content is forwarded or original by netizens. If there is infringement, please send the email to the destination 9003554@qq.com handle.
回复 打印

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|站点地图|UltraDebug ( 滇ICP备2022002049号-2 滇公网安备 53032102000034号)

GMT+8, 2025-6-18 07:00 , Processed in 0.041110 second(s), 12 queries , Redis On.

Powered by Discuz X3.4

© 2001-2023 Discuz! Team.

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