From 8e83bc22f23d0f979c8dc3bab80abb0833725a47 Mon Sep 17 00:00:00 2001 From: de4dot Date: Thu, 20 Oct 2011 05:43:01 +0200 Subject: [PATCH] Update isBranchBlock() method --- blocks/cflow/SwitchCflowDeobfuscator.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/blocks/cflow/SwitchCflowDeobfuscator.cs b/blocks/cflow/SwitchCflowDeobfuscator.cs index 511132e9..fb626bdc 100644 --- a/blocks/cflow/SwitchCflowDeobfuscator.cs +++ b/blocks/cflow/SwitchCflowDeobfuscator.cs @@ -204,9 +204,18 @@ namespace de4dot.blocks.cflow { } bool isBranchBlock(Block block) { - if (block.FallThrough != null) - return block.Targets == null || block.Targets.Count == 0; - return block.Targets != null && block.Targets.Count == 1; + if (block.Targets != null) + return false; + if (block.FallThrough == null) + return false; + switch (block.LastInstr.OpCode.Code) { + case Code.Switch: + case Code.Leave: + case Code.Leave_S: + return false; + default: + return true; + } } Block getSwitchTarget(IList targets, Block fallThrough, Block source, Value value) {