Skip to content

Commit 40bc1bd

Browse files
committed
Remove indiscriminate setting of KeepOldMaxStack
This is not required for replacing call with call/callvirt/newobj, and it breaks things if other deobfuscation passes rely on MaxStack recomputation.
1 parent f8db395 commit 40bc1bd

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

de4dot.code/ObfuscatedFile.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,6 @@ void Deobfuscate(MethodDef method, BlocksCflowDeobfuscator cflowDeobfuscator, Me
645645
if (!HasNonEmptyBody(method))
646646
return;
647647

648-
var rewritten = false;
649648
foreach (var instr in method.Body.Instructions) {
650649
if (instr.OpCode == OpCodes.Call) {
651650
var targetMethod = (IMethod?)instr.Operand;
@@ -654,15 +653,10 @@ void Deobfuscate(MethodDef method, BlocksCflowDeobfuscator cflowDeobfuscator, Me
654653
var realCall = methodToInline.Body.Instructions[methodToInline.Parameters.Count];
655654
instr.OpCode = realCall.OpCode;
656655
instr.Operand = realCall.Operand;
657-
rewritten = true;
658656
}
659657
}
660658
}
661659

662-
if (rewritten) {
663-
method.Body.KeepOldMaxStack = true;
664-
}
665-
666660
var blocks = new Blocks(method);
667661

668662
int numRemovedLocals = 0;

0 commit comments

Comments
 (0)