Add option to disable method inlining
This commit is contained in:
parent
ce8e53976e
commit
2fcd13000b
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Mono.Cecil;
|
||||||
using Mono.Cecil.Cil;
|
using Mono.Cecil.Cil;
|
||||||
|
|
||||||
namespace de4dot.blocks.cflow {
|
namespace de4dot.blocks.cflow {
|
||||||
|
@ -31,6 +32,8 @@ namespace de4dot.blocks.cflow {
|
||||||
StLdlocFixer stLdlocFixer = new StLdlocFixer();
|
StLdlocFixer stLdlocFixer = new StLdlocFixer();
|
||||||
MethodCallInliner methodCallInliner = new MethodCallInliner();
|
MethodCallInliner methodCallInliner = new MethodCallInliner();
|
||||||
|
|
||||||
|
public bool InlineMethods { get; set; }
|
||||||
|
|
||||||
public void init(Blocks blocks) {
|
public void init(Blocks blocks) {
|
||||||
this.blocks = blocks;
|
this.blocks = blocks;
|
||||||
}
|
}
|
||||||
|
@ -49,10 +52,12 @@ namespace de4dot.blocks.cflow {
|
||||||
if (iterations == 0)
|
if (iterations == 0)
|
||||||
changed |= fixDotfuscatorLoop();
|
changed |= fixDotfuscatorLoop();
|
||||||
|
|
||||||
|
if (InlineMethods) {
|
||||||
foreach (var block in allBlocks) {
|
foreach (var block in allBlocks) {
|
||||||
methodCallInliner.init(blocks, block);
|
methodCallInliner.init(blocks, block);
|
||||||
changed |= methodCallInliner.deobfuscate();
|
changed |= methodCallInliner.deobfuscate();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var block in allBlocks) {
|
foreach (var block in allBlocks) {
|
||||||
var lastInstr = block.LastInstr;
|
var lastInstr = block.LastInstr;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user