Emulate instrs only if last instr is bcc/switch

This commit is contained in:
de4dot 2011-10-18 08:28:23 +02:00
parent 98936364f7
commit f374308d1e

View File

@ -18,6 +18,7 @@
*/
using System.Collections.Generic;
using Mono.Cecil.Cil;
namespace de4dot.blocks.cflow {
public class BlocksControlFlowDeobfuscator {
@ -41,7 +42,9 @@ namespace de4dot.blocks.cflow {
removeDeadBlocks();
mergeBlocks();
foreach (var block in blocks.MethodBlocks.getAllBlocks()) {
//TODO: Only do this if it's a bcc block. switch blocks should use other code.
var lastInstr = block.LastInstr;
if (!DotNetUtils.isConditionalBranch(lastInstr.OpCode.Code) && lastInstr.OpCode.Code != Code.Switch)
continue;
blockControlFlowDeobfuscator.init(block, blocks.Method.Parameters, blocks.Locals);
changed |= blockControlFlowDeobfuscator.deobfuscate();
}