Submodule was updated. Fix code
This commit is contained in:
parent
ab8e548340
commit
35849b0f9b
|
@ -40,7 +40,7 @@ namespace AssemblyData.methodsrewriter {
|
||||||
if (!fields.TryGetValue(fieldRef.Name.String, out list))
|
if (!fields.TryGetValue(fieldRef.Name.String, out list))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
fieldRef = GenericArgsSubstitutor.create(fieldRef, fieldRef.DeclaringType.ToGenericInstSig());
|
fieldRef = GenericArgsSubstitutor.create(fieldRef, fieldRef.DeclaringType.TryGetGenericInstSig());
|
||||||
|
|
||||||
foreach (var field in list) {
|
foreach (var field in list) {
|
||||||
if (ResolverUtils.compareFields(field, fieldRef))
|
if (ResolverUtils.compareFields(field, fieldRef))
|
||||||
|
@ -71,7 +71,7 @@ namespace AssemblyData.methodsrewriter {
|
||||||
if (!methods.TryGetValue(methodRef.Name.String, out list))
|
if (!methods.TryGetValue(methodRef.Name.String, out list))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
methodRef = GenericArgsSubstitutor.create(methodRef, methodRef.DeclaringType.ToGenericInstSig());
|
methodRef = GenericArgsSubstitutor.create(methodRef, methodRef.DeclaringType.TryGetGenericInstSig());
|
||||||
|
|
||||||
foreach (var method in list) {
|
foreach (var method in list) {
|
||||||
if (ResolverUtils.compareMethods(method, methodRef))
|
if (ResolverUtils.compareMethods(method, methodRef))
|
||||||
|
|
|
@ -190,7 +190,7 @@ namespace de4dot.blocks {
|
||||||
return null;
|
return null;
|
||||||
if (method is MethodDef)
|
if (method is MethodDef)
|
||||||
return (MethodDef)method;
|
return (MethodDef)method;
|
||||||
var git = method.DeclaringType.ToGenericInstSig();
|
var git = method.DeclaringType.TryGetGenericInstSig();
|
||||||
var dt = git == null ? method.DeclaringType : git.GenericType.TypeDefOrRef;
|
var dt = git == null ? method.DeclaringType : git.GenericType.TypeDefOrRef;
|
||||||
return getMethod(module, method, dt);
|
return getMethod(module, method, dt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace de4dot.code {
|
||||||
var ts = typeRef as TypeSpec;
|
var ts = typeRef as TypeSpec;
|
||||||
if (ts == null)
|
if (ts == null)
|
||||||
return typeRef;
|
return typeRef;
|
||||||
var gis = ts.ToGenericInstSig();
|
var gis = ts.TryGetGenericInstSig();
|
||||||
if (gis == null || gis.GenericType == null)
|
if (gis == null || gis.GenericType == null)
|
||||||
return typeRef;
|
return typeRef;
|
||||||
return gis.GenericType.TypeDefOrRef;
|
return gis.GenericType.TypeDefOrRef;
|
||||||
|
|
|
@ -252,7 +252,7 @@ namespace de4dot.code.deobfuscators.Babel_NET {
|
||||||
var castclass = instrs[index++];
|
var castclass = instrs[index++];
|
||||||
if (castclass.OpCode.Code != Code.Castclass)
|
if (castclass.OpCode.Code != Code.Castclass)
|
||||||
continue;
|
continue;
|
||||||
var arrayType = (castclass.Operand as ITypeDefOrRef).ToSZArraySig();
|
var arrayType = (castclass.Operand as ITypeDefOrRef).TryGetSZArraySig();
|
||||||
if (arrayType == null)
|
if (arrayType == null)
|
||||||
continue;
|
continue;
|
||||||
if (arrayType.Next.ElementType.GetPrimitiveSize() == -1) {
|
if (arrayType.Next.ElementType.GetPrimitiveSize() == -1) {
|
||||||
|
|
|
@ -513,7 +513,7 @@ namespace de4dot.code.deobfuscators {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
IList<TypeSig> calledMethodArgs = DotNetUtils.getArgs(calledMethodDefOrRef);
|
IList<TypeSig> calledMethodArgs = DotNetUtils.getArgs(calledMethodDefOrRef);
|
||||||
calledMethodArgs = DotNetUtils.replaceGenericParameters(calledMethodDefOrRef.DeclaringType.ToGenericInstSig(), calledMethodSpec, calledMethodArgs);
|
calledMethodArgs = DotNetUtils.replaceGenericParameters(calledMethodDefOrRef.DeclaringType.TryGetGenericInstSig(), calledMethodSpec, calledMethodArgs);
|
||||||
for (int j = 0; j < pushedArgs.NumValidArgs; j++) {
|
for (int j = 0; j < pushedArgs.NumValidArgs; j++) {
|
||||||
var pushInstr = pushedArgs.getEnd(j);
|
var pushInstr = pushedArgs.getEnd(j);
|
||||||
if (pushInstr.OpCode.Code != Code.Ldfld && pushInstr.OpCode.Code != Code.Ldsfld)
|
if (pushInstr.OpCode.Code != Code.Ldfld && pushInstr.OpCode.Code != Code.Ldsfld)
|
||||||
|
|
|
@ -236,7 +236,7 @@ namespace de4dot.code.renamer.asmmodules {
|
||||||
var ts = typeRef as TypeSpec;
|
var ts = typeRef as TypeSpec;
|
||||||
if (ts == null)
|
if (ts == null)
|
||||||
return typeRef;
|
return typeRef;
|
||||||
var gis = ts.ToGenericInstSig();
|
var gis = ts.TryGetGenericInstSig();
|
||||||
if (gis == null || gis.GenericType == null)
|
if (gis == null || gis.GenericType == null)
|
||||||
return typeRef;
|
return typeRef;
|
||||||
return gis.GenericType.TypeDefOrRef;
|
return gis.GenericType.TypeDefOrRef;
|
||||||
|
|
|
@ -494,7 +494,7 @@ namespace de4dot.code.renamer.asmmodules {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initializeInterfaces(TypeInfo typeInfo) {
|
void initializeInterfaces(TypeInfo typeInfo) {
|
||||||
var git = typeInfo.typeRef.ToGenericInstSig();
|
var git = typeInfo.typeRef.TryGetGenericInstSig();
|
||||||
interfaceMethodInfos.initializeFrom(typeInfo.typeDef.interfaceMethodInfos, git);
|
interfaceMethodInfos.initializeFrom(typeInfo.typeDef.interfaceMethodInfos, git);
|
||||||
foreach (var info in typeInfo.typeDef.allImplementedInterfaces.Keys) {
|
foreach (var info in typeInfo.typeDef.allImplementedInterfaces.Keys) {
|
||||||
var newTypeInfo = new TypeInfo(info, git);
|
var newTypeInfo = new TypeInfo(info, git);
|
||||||
|
@ -540,7 +540,7 @@ namespace de4dot.code.renamer.asmmodules {
|
||||||
var ifaceMethod = methodInst.origMethodDef;
|
var ifaceMethod = methodInst.origMethodDef;
|
||||||
if (!ifaceMethod.isVirtual())
|
if (!ifaceMethod.isVirtual())
|
||||||
continue;
|
continue;
|
||||||
var ifaceMethodRef = GenericArgsSubstitutor.create(methodInst.methodRef, ifaceInfo.typeRef.ToGenericInstSig());
|
var ifaceMethodRef = GenericArgsSubstitutor.create(methodInst.methodRef, ifaceInfo.typeRef.TryGetGenericInstSig());
|
||||||
MMethodDef classMethod;
|
MMethodDef classMethod;
|
||||||
if (!methodsDict.TryGetValue(ifaceMethodRef, out classMethod))
|
if (!methodsDict.TryGetValue(ifaceMethodRef, out classMethod))
|
||||||
continue;
|
continue;
|
||||||
|
@ -574,7 +574,7 @@ namespace de4dot.code.renamer.asmmodules {
|
||||||
var ifaceMethod = methodsList[0].origMethodDef;
|
var ifaceMethod = methodsList[0].origMethodDef;
|
||||||
if (!ifaceMethod.isVirtual())
|
if (!ifaceMethod.isVirtual())
|
||||||
continue;
|
continue;
|
||||||
var ifaceMethodRef = GenericArgsSubstitutor.create(ifaceMethod.MethodDef, ifaceInfo.typeRef.ToGenericInstSig());
|
var ifaceMethodRef = GenericArgsSubstitutor.create(ifaceMethod.MethodDef, ifaceInfo.typeRef.TryGetGenericInstSig());
|
||||||
MMethodDef classMethod;
|
MMethodDef classMethod;
|
||||||
if (!methodsDict.TryGetValue(ifaceMethodRef, out classMethod))
|
if (!methodsDict.TryGetValue(ifaceMethodRef, out classMethod))
|
||||||
continue;
|
continue;
|
||||||
|
@ -588,7 +588,7 @@ namespace de4dot.code.renamer.asmmodules {
|
||||||
methodsDict.Clear();
|
methodsDict.Clear();
|
||||||
var ifaceMethodsDict = new Dictionary<IMethodDefOrRef, MMethodDef>(MethodEqualityComparer.CompareDeclaringTypes);
|
var ifaceMethodsDict = new Dictionary<IMethodDefOrRef, MMethodDef>(MethodEqualityComparer.CompareDeclaringTypes);
|
||||||
foreach (var ifaceInfo in allImplementedInterfaces.Keys) {
|
foreach (var ifaceInfo in allImplementedInterfaces.Keys) {
|
||||||
var git = ifaceInfo.typeRef.ToGenericInstSig();
|
var git = ifaceInfo.typeRef.TryGetGenericInstSig();
|
||||||
foreach (var ifaceMethod in ifaceInfo.typeDef.methods.getValues()) {
|
foreach (var ifaceMethod in ifaceInfo.typeDef.methods.getValues()) {
|
||||||
IMethodDefOrRef ifaceMethodRef = ifaceMethod.MethodDef;
|
IMethodDefOrRef ifaceMethodRef = ifaceMethod.MethodDef;
|
||||||
if (git != null)
|
if (git != null)
|
||||||
|
@ -699,7 +699,7 @@ namespace de4dot.code.renamer.asmmodules {
|
||||||
void instantiateVirtualMembers(MethodNameGroups groups) {
|
void instantiateVirtualMembers(MethodNameGroups groups) {
|
||||||
if (!TypeDef.IsInterface) {
|
if (!TypeDef.IsInterface) {
|
||||||
if (baseType != null)
|
if (baseType != null)
|
||||||
virtualMethodInstances.initializeFrom(baseType.typeDef.virtualMethodInstances, baseType.typeRef.ToGenericInstSig());
|
virtualMethodInstances.initializeFrom(baseType.typeDef.virtualMethodInstances, baseType.typeRef.TryGetGenericInstSig());
|
||||||
|
|
||||||
// Figure out which methods we override in the base class
|
// Figure out which methods we override in the base class
|
||||||
foreach (var methodDef in methods.getValues()) {
|
foreach (var methodDef in methods.getValues()) {
|
||||||
|
|
2
dot10
2
dot10
|
@ -1 +1 @@
|
||||||
Subproject commit 8be6ceeb862d85ce3ea18fbee5a04990f0f0556c
|
Subproject commit ef5ba01006a288eef4739dc7c9b39c24914777e5
|
Loading…
Reference in New Issue
Block a user