Update code since submodule was updated

This commit is contained in:
de4dot 2012-11-19 17:58:34 +01:00
parent aa529c6c5a
commit 5ad2e18695
27 changed files with 40 additions and 40 deletions

View File

@ -178,7 +178,7 @@ namespace AssemblyData.methodsrewriter {
void initLocals() {
locals = new List<LocalBuilder>();
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[]));

View File

@ -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();
}

View File

@ -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)

View File

@ -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();

View File

@ -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:

View File

@ -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:");

View File

@ -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);

View File

@ -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) {

View File

@ -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<object, object>();
if (babelMethod.ThisParameter != null)

View File

@ -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<Instr> instrs, IList<Local> locals)

View File

@ -54,7 +54,7 @@ namespace de4dot.code.deobfuscators.CryptoObfuscator {
static IList<Local> getLocals(MethodDef method) {
if (method.Body == null)
return new List<Local>();
return method.Body.LocalList;
return method.Body.Variables;
}
protected override IField ReadInlineField(Instruction instr) {

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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];

View File

@ -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;

View File

@ -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() {

View File

@ -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();

View File

@ -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);
}
}

View File

@ -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();

View File

@ -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;

View File

@ -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<Local> locals) {

View File

@ -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:

View File

@ -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);

View File

@ -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;

View File

@ -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<Instruction> instrs) {

2
dot10

@ -1 +1 @@
Subproject commit 9efe77cebda9b8d3b667fa6404c2805036b967cd
Subproject commit a3a732dde405752bcec85add1dad9e1fdc69b214