From 5ad2e18695ed5f05db6778a4a9ee33edb1b9b9c4 Mon Sep 17 00:00:00 2001 From: de4dot Date: Mon, 19 Nov 2012 17:58:34 +0100 Subject: [PATCH] Update code since submodule was updated --- AssemblyData/methodsrewriter/CodeGenerator.cs | 2 +- blocks/Blocks.cs | 2 +- blocks/DotNetUtils.cs | 10 +++++----- blocks/cflow/InstructionEmulator.cs | 2 +- de4dot.code/MethodReturnValueInliner.cs | 4 ++-- de4dot.code/deobfuscators/Agile_NET/vm/Csvm.cs | 4 ++-- .../Agile_NET/vm/CsvmToCilMethodConverter.cs | 2 +- .../deobfuscators/Agile_NET/vm/OpCodeHandler.cs | 2 +- de4dot.code/deobfuscators/Babel_NET/ImageReader.cs | 4 ++-- de4dot.code/deobfuscators/ConstantsReader.cs | 2 +- .../deobfuscators/CryptoObfuscator/MethodBodyReader.cs | 2 +- .../deobfuscators/CryptoObfuscator/MethodsDecrypter.cs | 2 +- .../CryptoObfuscator/ResourceDecrypter.cs | 4 ++-- de4dot.code/deobfuscators/DeepSea/FieldsRestorer.cs | 2 +- de4dot.code/deobfuscators/DeepSea/StringDecrypter.cs | 4 ++-- de4dot.code/deobfuscators/DeobfuscatorBase.cs | 2 +- .../deobfuscators/Eazfuscator_NET/StringDecrypter.cs | 4 ++-- de4dot.code/deobfuscators/ILProtector/MainType.cs | 2 +- .../deobfuscators/ILProtector/MethodsDecrypter.cs | 2 +- de4dot.code/deobfuscators/MethodStack.cs | 2 +- .../Spices_Net/SpicesMethodCallInliner.cs | 2 +- de4dot.code/deobfuscators/StringCounts.cs | 2 +- de4dot.code/deobfuscators/TypesRestorer.cs | 2 +- .../dotNET_Reactor/v4/ResourceResolver.cs | 2 +- de4dot.code/renamer/TypeInfo.cs | 8 ++++---- de4dot.code/renamer/asmmodules/MemberRefFinder.cs | 2 +- dot10 | 2 +- 27 files changed, 40 insertions(+), 40 deletions(-) diff --git a/AssemblyData/methodsrewriter/CodeGenerator.cs b/AssemblyData/methodsrewriter/CodeGenerator.cs index 2765e70a..80a74e39 100644 --- a/AssemblyData/methodsrewriter/CodeGenerator.cs +++ b/AssemblyData/methodsrewriter/CodeGenerator.cs @@ -178,7 +178,7 @@ namespace AssemblyData.methodsrewriter { void initLocals() { locals = new List(); - foreach (var local in methodInfo.methodDef.Body.LocalList) + foreach (var local in methodInfo.methodDef.Body.Variables) locals.Add(ilg.DeclareLocal(Resolver.getRtType(local.Type), local.Type.RemoveModifiers().IsPinned)); tempObjLocal = ilg.DeclareLocal(typeof(object)); tempObjArrayLocal = ilg.DeclareLocal(typeof(object[])); diff --git a/blocks/Blocks.cs b/blocks/Blocks.cs index 70c2a3d6..9bc5dde5 100644 --- a/blocks/Blocks.cs +++ b/blocks/Blocks.cs @@ -47,7 +47,7 @@ namespace de4dot.blocks { public void updateBlocks() { var body = method.Body; - locals = body.LocalList; + locals = body.Variables; methodBlocks = new InstructionListParser(body.Instructions, body.ExceptionHandlers).parse(); } diff --git a/blocks/DotNetUtils.cs b/blocks/DotNetUtils.cs index b0f71415..0b074343 100644 --- a/blocks/DotNetUtils.cs +++ b/blocks/DotNetUtils.cs @@ -442,9 +442,9 @@ namespace de4dot.blocks { var fromBody = fromMethod.Body; var toBody = toMethod.Body; - toBody.LocalList.Clear(); - foreach (var local in fromBody.LocalList) - toBody.LocalList.Add(new Local(local.Type)); + toBody.Variables.Clear(); + foreach (var local in fromBody.Variables) + toBody.Variables.Add(new Local(local.Type)); } static void updateInstructionOperands(MethodDef fromMethod, MethodDef toMethod) { @@ -459,8 +459,8 @@ namespace de4dot.blocks { var toParams = toMethod.Parameters; for (int i = 0; i < fromParams.Count; i++) newOperands[fromParams[i]] = toParams[i]; - for (int i = 0; i < fromBody.LocalList.Count; i++) - newOperands[fromBody.LocalList[i]] = toBody.LocalList[i]; + for (int i = 0; i < fromBody.Variables.Count; i++) + newOperands[fromBody.Variables[i]] = toBody.Variables[i]; foreach (var instr in toBody.Instructions) { if (instr.Operand == null) diff --git a/blocks/cflow/InstructionEmulator.cs b/blocks/cflow/InstructionEmulator.cs index e110f374..b0be6768 100644 --- a/blocks/cflow/InstructionEmulator.cs +++ b/blocks/cflow/InstructionEmulator.cs @@ -48,7 +48,7 @@ namespace de4dot.blocks.cflow { public void init(MethodDef method) { this.parameterDefs = method.Parameters; - this.localDefs = method.Body.LocalList; + this.localDefs = method.Body.Variables; valueStack.init(); protectedStackValues.Clear(); diff --git a/de4dot.code/MethodReturnValueInliner.cs b/de4dot.code/MethodReturnValueInliner.cs index c2a55fbb..1951c4b3 100644 --- a/de4dot.code/MethodReturnValueInliner.cs +++ b/de4dot.code/MethodReturnValueInliner.cs @@ -218,7 +218,7 @@ namespace de4dot.code { bool getLocalVariableValue(Local variable, out object value) { if (variableValues == null) - variableValues = new VariableValues(theMethod.Body.LocalList, allBlocks); + variableValues = new VariableValues(theMethod.Body.Variables, allBlocks); var val = variableValues.getValue(variable); if (!val.isValid()) { value = null; @@ -342,7 +342,7 @@ namespace de4dot.code { case Code.Ldloc_1: case Code.Ldloc_2: case Code.Ldloc_3: - getLocalVariableValue(instr.Instruction.GetLocal(theMethod.Body.LocalList), out arg); + getLocalVariableValue(instr.Instruction.GetLocal(theMethod.Body.Variables), out arg); break; case Code.Ldfld: diff --git a/de4dot.code/deobfuscators/Agile_NET/vm/Csvm.cs b/de4dot.code/deobfuscators/Agile_NET/vm/Csvm.cs index 78495c2b..623cef33 100644 --- a/de4dot.code/deobfuscators/Agile_NET/vm/Csvm.cs +++ b/de4dot.code/deobfuscators/Agile_NET/vm/Csvm.cs @@ -123,8 +123,8 @@ namespace de4dot.code.deobfuscators.Agile_NET.vm { Logger.v("Locals:"); Logger.Instance.indent(); - for (int i = 0; i < method.Body.LocalList.Count; i++) - Logger.v("#{0}: {1}", i, method.Body.LocalList[i].Type); + for (int i = 0; i < method.Body.Variables.Count; i++) + Logger.v("#{0}: {1}", i, method.Body.Variables[i].Type); Logger.Instance.deIndent(); Logger.v("Code:"); diff --git a/de4dot.code/deobfuscators/Agile_NET/vm/CsvmToCilMethodConverter.cs b/de4dot.code/deobfuscators/Agile_NET/vm/CsvmToCilMethodConverter.cs index 33ba7882..342288f4 100644 --- a/de4dot.code/deobfuscators/Agile_NET/vm/CsvmToCilMethodConverter.cs +++ b/de4dot.code/deobfuscators/Agile_NET/vm/CsvmToCilMethodConverter.cs @@ -43,7 +43,7 @@ namespace de4dot.code.deobfuscators.Agile_NET.vm { var newExceptions = readExceptions(cilMethod, csvmMethod, newInstructions); fixInstructionOperands(newInstructions); - fixLocals(newInstructions, cilMethod.Body.LocalList); + fixLocals(newInstructions, cilMethod.Body.Variables); fixArgs(newInstructions, cilMethod); DotNetUtils.restoreBody(cilMethod, newInstructions, newExceptions); diff --git a/de4dot.code/deobfuscators/Agile_NET/vm/OpCodeHandler.cs b/de4dot.code/deobfuscators/Agile_NET/vm/OpCodeHandler.cs index b9cc6b31..a4d45541 100644 --- a/de4dot.code/deobfuscators/Agile_NET/vm/OpCodeHandler.cs +++ b/de4dot.code/deobfuscators/Agile_NET/vm/OpCodeHandler.cs @@ -462,7 +462,7 @@ namespace de4dot.code.deobfuscators.Agile_NET.vm { } static bool rethrow_check(UnknownHandlerInfo info) { - return info.ExecuteMethod.Body.LocalList.Count == 0; + return info.ExecuteMethod.Body.Variables.Count == 0; } static Instruction rethrow_read(BinaryReader reader) { diff --git a/de4dot.code/deobfuscators/Babel_NET/ImageReader.cs b/de4dot.code/deobfuscators/Babel_NET/ImageReader.cs index cd9d623d..f6440d66 100644 --- a/de4dot.code/deobfuscators/Babel_NET/ImageReader.cs +++ b/de4dot.code/deobfuscators/Babel_NET/ImageReader.cs @@ -115,9 +115,9 @@ namespace de4dot.code.deobfuscators.Babel_NET { body.MaxStack = babelMethod.MaxStack; body.InitLocals = babelMethod.InitLocals; - body.LocalList.Clear(); + body.Variables.Clear(); foreach (var local in babelMethod.Locals) - body.LocalList.Add(local); + body.Variables.Add(local); var toNewOperand = new Dictionary(); if (babelMethod.ThisParameter != null) diff --git a/de4dot.code/deobfuscators/ConstantsReader.cs b/de4dot.code/deobfuscators/ConstantsReader.cs index 85ab4c45..ffd1cb52 100644 --- a/de4dot.code/deobfuscators/ConstantsReader.cs +++ b/de4dot.code/deobfuscators/ConstantsReader.cs @@ -100,7 +100,7 @@ namespace de4dot.code.deobfuscators { public ConstantsReader(MethodDef method) : this(method.Body.Instructions) { - this.locals = method.Body.LocalList; + this.locals = method.Body.Variables; } public ConstantsReader(IList instrs, IList locals) diff --git a/de4dot.code/deobfuscators/CryptoObfuscator/MethodBodyReader.cs b/de4dot.code/deobfuscators/CryptoObfuscator/MethodBodyReader.cs index 5a60d4f4..80f0214a 100644 --- a/de4dot.code/deobfuscators/CryptoObfuscator/MethodBodyReader.cs +++ b/de4dot.code/deobfuscators/CryptoObfuscator/MethodBodyReader.cs @@ -54,7 +54,7 @@ namespace de4dot.code.deobfuscators.CryptoObfuscator { static IList getLocals(MethodDef method) { if (method.Body == null) return new List(); - return method.Body.LocalList; + return method.Body.Variables; } protected override IField ReadInlineField(Instruction instr) { diff --git a/de4dot.code/deobfuscators/CryptoObfuscator/MethodsDecrypter.cs b/de4dot.code/deobfuscators/CryptoObfuscator/MethodsDecrypter.cs index 452ee694..43fbf26c 100644 --- a/de4dot.code/deobfuscators/CryptoObfuscator/MethodsDecrypter.cs +++ b/de4dot.code/deobfuscators/CryptoObfuscator/MethodsDecrypter.cs @@ -159,7 +159,7 @@ namespace de4dot.code.deobfuscators.CryptoObfuscator { Utils.removeNewlines(encMethod.FullName), encMethod.MDToken.ToInt32(), encMethod.Body.Instructions.Count, - encMethod.Body.LocalList.Count, + encMethod.Body.Variables.Count, encMethod.Body.ExceptionHandlers.Count); delegateTypes.Add(delegateType); } diff --git a/de4dot.code/deobfuscators/CryptoObfuscator/ResourceDecrypter.cs b/de4dot.code/deobfuscators/CryptoObfuscator/ResourceDecrypter.cs index d0f5308c..db3a1788 100644 --- a/de4dot.code/deobfuscators/CryptoObfuscator/ResourceDecrypter.cs +++ b/de4dot.code/deobfuscators/CryptoObfuscator/ResourceDecrypter.cs @@ -188,7 +188,7 @@ namespace de4dot.code.deobfuscators.CryptoObfuscator { var ldloc = instrs[i]; if (!ldloc.IsLdloc()) continue; - var local = ldloc.GetLocal(method.Body.LocalList); + var local = ldloc.GetLocal(method.Body.Variables); if (local == null || local.Type.GetElementType().GetPrimitiveSize() < 0) continue; @@ -222,7 +222,7 @@ namespace de4dot.code.deobfuscators.CryptoObfuscator { var ldloc = instructions[i - 2]; if (!ldloc.IsLdloc()) continue; - var local = ldloc.GetLocal(method.Body.LocalList); + var local = ldloc.GetLocal(method.Body.Variables); if (local.Type.GetElementType().GetPrimitiveSize() < 0) continue; constants.Add(flagValue); diff --git a/de4dot.code/deobfuscators/DeepSea/FieldsRestorer.cs b/de4dot.code/deobfuscators/DeepSea/FieldsRestorer.cs index 14073906..f83d43df 100644 --- a/de4dot.code/deobfuscators/DeepSea/FieldsRestorer.cs +++ b/de4dot.code/deobfuscators/DeepSea/FieldsRestorer.cs @@ -134,7 +134,7 @@ namespace de4dot.code.deobfuscators.DeepSea { foreach (var parameter in method.MethodSig.GetParams()) removeType(candidates, parameter); if (method.Body != null) { - foreach (var local in method.Body.LocalList) + foreach (var local in method.Body.Variables) removeType(candidates, local.Type); } } diff --git a/de4dot.code/deobfuscators/DeepSea/StringDecrypter.cs b/de4dot.code/deobfuscators/DeepSea/StringDecrypter.cs index f1410077..bb7306cb 100644 --- a/de4dot.code/deobfuscators/DeepSea/StringDecrypter.cs +++ b/de4dot.code/deobfuscators/DeepSea/StringDecrypter.cs @@ -65,7 +65,7 @@ namespace de4dot.code.deobfuscators.DeepSea { var stloc = instrs[i + 2]; if (!stloc.IsStloc()) continue; - var local = stloc.GetLocal(initMethod.Body.LocalList); + var local = stloc.GetLocal(initMethod.Body.Variables); int startInitIndex = i; i++; @@ -89,7 +89,7 @@ namespace de4dot.code.deobfuscators.DeepSea { var ldloc = instrs[i]; if (!ldloc.IsLdloc()) continue; - if (ldloc.GetLocal(method.Body.LocalList) != local) + if (ldloc.GetLocal(method.Body.Variables) != local) continue; var stsfld = instrs[i + 1]; diff --git a/de4dot.code/deobfuscators/DeobfuscatorBase.cs b/de4dot.code/deobfuscators/DeobfuscatorBase.cs index e3579fae..ef696f4b 100644 --- a/de4dot.code/deobfuscators/DeobfuscatorBase.cs +++ b/de4dot.code/deobfuscators/DeobfuscatorBase.cs @@ -555,7 +555,7 @@ namespace de4dot.code.deobfuscators { var body = method.Body; if (body.InitLocals || body.MaxStack > 8) return true; - if (body.LocalList.Count > 0) + if (body.Variables.Count > 0) return true; if (body.ExceptionHandlers.Count > 0) return true; diff --git a/de4dot.code/deobfuscators/Eazfuscator_NET/StringDecrypter.cs b/de4dot.code/deobfuscators/Eazfuscator_NET/StringDecrypter.cs index 6b646683..2813e55d 100644 --- a/de4dot.code/deobfuscators/Eazfuscator_NET/StringDecrypter.cs +++ b/de4dot.code/deobfuscators/Eazfuscator_NET/StringDecrypter.cs @@ -349,7 +349,7 @@ namespace de4dot.code.deobfuscators.Eazfuscator_NET { var ldloc = instrs[index]; if (!ldloc.IsLdloc()) continue; - if (ldloc.GetLocal(method.Body.LocalList) != local) + if (ldloc.GetLocal(method.Body.Variables) != local) continue; return index; @@ -374,7 +374,7 @@ namespace de4dot.code.deobfuscators.Eazfuscator_NET { var stloc = instrs[index++]; if (!stloc.IsStloc()) return null; - return stloc.GetLocal(method.Body.LocalList); + return stloc.GetLocal(method.Body.Variables); } void initialize() { diff --git a/de4dot.code/deobfuscators/ILProtector/MainType.cs b/de4dot.code/deobfuscators/ILProtector/MainType.cs index bcdbe4f9..d6eb63ed 100644 --- a/de4dot.code/deobfuscators/ILProtector/MainType.cs +++ b/de4dot.code/deobfuscators/ILProtector/MainType.cs @@ -97,7 +97,7 @@ namespace de4dot.code.deobfuscators.ILProtector { var cctor = DotNetUtils.getModuleTypeCctor(module); if (cctor != null) { cctor.Body.InitLocals = false; - cctor.Body.LocalList.Clear(); + cctor.Body.Variables.Clear(); cctor.Body.Instructions.Clear(); cctor.Body.Instructions.Add(Instruction.Create(OpCodes.Ret)); cctor.Body.ExceptionHandlers.Clear(); diff --git a/de4dot.code/deobfuscators/ILProtector/MethodsDecrypter.cs b/de4dot.code/deobfuscators/ILProtector/MethodsDecrypter.cs index bc40d6cc..2681dc6c 100644 --- a/de4dot.code/deobfuscators/ILProtector/MethodsDecrypter.cs +++ b/de4dot.code/deobfuscators/ILProtector/MethodsDecrypter.cs @@ -212,7 +212,7 @@ namespace de4dot.code.deobfuscators.ILProtector { Utils.removeNewlines(method.FullName), method.MDToken.ToInt32(), method.Body.Instructions.Count, - method.Body.LocalList.Count, + method.Body.Variables.Count, method.Body.ExceptionHandlers.Count); } } diff --git a/de4dot.code/deobfuscators/MethodStack.cs b/de4dot.code/deobfuscators/MethodStack.cs index 8b853e32..a5b67843 100644 --- a/de4dot.code/deobfuscators/MethodStack.cs +++ b/de4dot.code/deobfuscators/MethodStack.cs @@ -246,7 +246,7 @@ namespace de4dot.code.deobfuscators { case Code.Ldloc_1: case Code.Ldloc_2: case Code.Ldloc_3: - local = pushInstr.GetLocal(method.Body.LocalList); + local = pushInstr.GetLocal(method.Body.Variables); if (local == null) return null; type = local.Type.RemovePinned(); diff --git a/de4dot.code/deobfuscators/Spices_Net/SpicesMethodCallInliner.cs b/de4dot.code/deobfuscators/Spices_Net/SpicesMethodCallInliner.cs index 2822ac55..d9f45c4e 100644 --- a/de4dot.code/deobfuscators/Spices_Net/SpicesMethodCallInliner.cs +++ b/de4dot.code/deobfuscators/Spices_Net/SpicesMethodCallInliner.cs @@ -102,7 +102,7 @@ namespace de4dot.code.deobfuscators.Spices_Net { calledMethod = null; if (method.Body == null) return false; - if (method.Body.LocalList.Count > 0) + if (method.Body.Variables.Count > 0) return false; if (method.Body.ExceptionHandlers.Count > 0) return false; diff --git a/de4dot.code/deobfuscators/StringCounts.cs b/de4dot.code/deobfuscators/StringCounts.cs index d22b0121..e253464f 100644 --- a/de4dot.code/deobfuscators/StringCounts.cs +++ b/de4dot.code/deobfuscators/StringCounts.cs @@ -88,7 +88,7 @@ namespace de4dot.code.deobfuscators { class LocalTypes : StringCounts { public LocalTypes(MethodDef method) { if (method != null && method.Body != null) - init(method.Body.LocalList); + init(method.Body.Variables); } public LocalTypes(IEnumerable locals) { diff --git a/de4dot.code/deobfuscators/TypesRestorer.cs b/de4dot.code/deobfuscators/TypesRestorer.cs index d8794d20..1503ebf3 100644 --- a/de4dot.code/deobfuscators/TypesRestorer.cs +++ b/de4dot.code/deobfuscators/TypesRestorer.cs @@ -329,7 +329,7 @@ namespace de4dot.code.deobfuscators { pushedArgs = MethodStack.getPushedArgInstructions(instructions, i); if (pushedArgs.NumValidArgs < 1) break; - addMethodArgType(method, getParameter(methodParams, pushedArgs.getEnd(0)), instr.GetLocal(method.Body.LocalList)); + addMethodArgType(method, getParameter(methodParams, pushedArgs.getEnd(0)), instr.GetLocal(method.Body.Variables)); break; case Code.Stsfld: diff --git a/de4dot.code/deobfuscators/dotNET_Reactor/v4/ResourceResolver.cs b/de4dot.code/deobfuscators/dotNET_Reactor/v4/ResourceResolver.cs index bcca5397..b7e54e36 100644 --- a/de4dot.code/deobfuscators/dotNET_Reactor/v4/ResourceResolver.cs +++ b/de4dot.code/deobfuscators/dotNET_Reactor/v4/ResourceResolver.cs @@ -112,7 +112,7 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 { continue; if (!DotNetUtils.isMethod(method, "System.Void", "()")) continue; - if (method.Body.LocalList.Count > 1) + if (method.Body.Variables.Count > 1) continue; simpleDeobfuscator.deobfuscate(method); diff --git a/de4dot.code/renamer/TypeInfo.cs b/de4dot.code/renamer/TypeInfo.cs index 111da10b..b11f5d5f 100644 --- a/de4dot.code/renamer/TypeInfo.cs +++ b/de4dot.code/renamer/TypeInfo.cs @@ -530,11 +530,11 @@ namespace de4dot.code.renamer { if (ret == null) return null; if (ret.IsStloc()) { - var local = ret.GetLocal(method.Body.LocalList); + var local = ret.GetLocal(method.Body.Variables); ret = DotNetUtils.getInstruction(instructions, ref index); if (ret == null || !ret.IsLdloc()) return null; - if (ret.GetLocal(method.Body.LocalList) != local) + if (ret.GetLocal(method.Body.Variables) != local) return null; ret = DotNetUtils.getInstruction(instructions, ref index); } @@ -592,9 +592,9 @@ namespace de4dot.code.renamer { return null; if (sig.Params.Count != 1) return null; - if (method.Body.LocalList.Count != 1) + if (method.Body.Variables.Count != 1) return null; - if (!isEventHandlerType(method.Body.LocalList[0].Type)) + if (!isEventHandlerType(method.Body.Variables[0].Type)) return null; var instructions = method.Body.Instructions; diff --git a/de4dot.code/renamer/asmmodules/MemberRefFinder.cs b/de4dot.code/renamer/asmmodules/MemberRefFinder.cs index 27ca0755..d34d4283 100644 --- a/de4dot.code/renamer/asmmodules/MemberRefFinder.cs +++ b/de4dot.code/renamer/asmmodules/MemberRefFinder.cs @@ -405,7 +405,7 @@ namespace de4dot.code.renamer.asmmodules { return; add(cb.Instructions); add(cb.ExceptionHandlers); - add(cb.LocalList); + add(cb.Variables); } void add(IEnumerable instrs) { diff --git a/dot10 b/dot10 index 9efe77ce..a3a732dd 160000 --- a/dot10 +++ b/dot10 @@ -1 +1 @@ -Subproject commit 9efe77cebda9b8d3b667fa6404c2805036b967cd +Subproject commit a3a732dde405752bcec85add1dad9e1fdc69b214