|
|
@ -108,6 +108,7 @@ namespace Decompiler |
|
|
|
MethodDefinition methodDef; |
|
|
|
MethodDefinition methodDef; |
|
|
|
Dictionary<Instruction, CilStack> stackBefore = new Dictionary<Instruction, CilStack>(); |
|
|
|
Dictionary<Instruction, CilStack> stackBefore = new Dictionary<Instruction, CilStack>(); |
|
|
|
Dictionary<Instruction, CilStack> stackAfter = new Dictionary<Instruction, CilStack>(); |
|
|
|
Dictionary<Instruction, CilStack> stackAfter = new Dictionary<Instruction, CilStack>(); |
|
|
|
|
|
|
|
Dictionary<Instruction, List<Instruction>> branchTargetOf = new Dictionary<Instruction, List<Instruction>>(); |
|
|
|
|
|
|
|
|
|
|
|
public Dictionary<Instruction, CilStack> StackBefore { |
|
|
|
public Dictionary<Instruction, CilStack> StackBefore { |
|
|
|
get { return stackBefore; } |
|
|
|
get { return stackBefore; } |
|
|
@ -117,6 +118,10 @@ namespace Decompiler |
|
|
|
get { return stackAfter; } |
|
|
|
get { return stackAfter; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Dictionary<Instruction, List<Instruction>> BranchTargetOf { |
|
|
|
|
|
|
|
get { return branchTargetOf; } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Cecil.TypeReference GetTypeOf(Instruction inst) |
|
|
|
public Cecil.TypeReference GetTypeOf(Instruction inst) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (Util.GetNumberOfOutputs(methodDef, inst) == 0) { |
|
|
|
if (Util.GetNumberOfOutputs(methodDef, inst) == 0) { |
|
|
@ -132,6 +137,15 @@ namespace Decompiler |
|
|
|
foreach(Instruction inst in methodDef.Body.Instructions) { |
|
|
|
foreach(Instruction inst in methodDef.Body.Instructions) { |
|
|
|
stackBefore[inst] = null; |
|
|
|
stackBefore[inst] = null; |
|
|
|
stackAfter[inst] = null; |
|
|
|
stackAfter[inst] = null; |
|
|
|
|
|
|
|
branchTargetOf[inst] = new List<Instruction>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach(Instruction inst in methodDef.Body.Instructions) { |
|
|
|
|
|
|
|
if (inst.OpCode.FlowControl == FlowControl.Branch || |
|
|
|
|
|
|
|
inst.OpCode.FlowControl == FlowControl.Cond_Branch) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
branchTargetOf[(Instruction)inst.Operand].Add(inst); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (methodDef.Body.Instructions.Count > 0) { |
|
|
|
if (methodDef.Body.Instructions.Count > 0) { |
|
|
|