修复 CallObfus生成Dispatch函数对被调用排序造成调用到错误函数的严重bug

1.x
walon 2025-06-10 13:53:53 +08:00
parent 9505f2b90f
commit 025f900f4e
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ namespace Obfuz.ObfusPasses.CallObfus
var ret = Instruction.Create(OpCodes.Ret); var ret = Instruction.Create(OpCodes.Ret);
// sort methods by signature to ensure stable order // sort methods by signature to ensure stable order
dispatchMethod.methods.Sort((a, b) => a.id.CompareTo(b.id)); //dispatchMethod.methods.Sort((a, b) => a.id.CompareTo(b.id));
foreach (CallInfo ci in dispatchMethod.methods) foreach (CallInfo ci in dispatchMethod.methods)
{ {
var callTargetMethod = Instruction.Create(ci.callVir ? OpCodes.Callvirt : OpCodes.Call, ci.method); var callTargetMethod = Instruction.Create(ci.callVir ? OpCodes.Callvirt : OpCodes.Call, ci.method);