Beispiel #1
0
        void FindPatchData(TypeDef type, ICflowDeobfuscator cflowDeobfuscator)
        {
            var locals = new List <string> {
                "System.Int32[]",
                "System.UInt32[]",
            };

            foreach (var method in type.Methods)
            {
                if (method.Attributes != MethodAttributes.Private)
                {
                    continue;
                }
                if (!DotNetUtils.IsMethod(method, "System.Void", "()"))
                {
                    continue;
                }
                if (!new LocalTypes(method).Exactly(locals))
                {
                    continue;
                }
                cflowDeobfuscator.Deobfuscate(method);
                var patchInfo = GetPatchInfo(method);
                if (patchInfo == null)
                {
                    continue;
                }

                patchInfos.Add(patchInfo);
            }
        }
Beispiel #2
0
        void Find(TypeDef type, ICflowDeobfuscator cflowDeobfuscator)
        {
            var additionalTypes = new List <string> {
                "System.IO.BinaryReader",
                "System.IO.FileStream",
                "System.Reflection.Assembly",
                "System.Reflection.Assembly[]",
                "System.String",
            };

            foreach (var method in type.Methods)
            {
                if (!DotNetUtils.IsMethod(method, "System.Reflection.Assembly", "(System.Object,System.ResolveEventArgs)"))
                {
                    continue;
                }
                if (!DecryptMethod.CouldBeDecryptMethod(method, additionalTypes))
                {
                    continue;
                }
                cflowDeobfuscator.Deobfuscate(method);
                if (!decryptMethod.GetKey(method))
                {
                    continue;
                }

                return;
            }
        }
Beispiel #3
0
        void Find(TypeDef type, ICflowDeobfuscator cflowDeobfuscator)
        {
            var additionalTypes = new List <string> {
                "System.IO.BinaryWriter",
            };

            foreach (var method in type.Methods)
            {
                if (!DotNetUtils.IsMethod(method, "System.Void", "(System.Int32[],System.UInt32[])"))
                {
                    continue;
                }
                if (!DecryptMethod.CouldBeDecryptMethod(method, additionalTypes))
                {
                    continue;
                }
                cflowDeobfuscator.Deobfuscate(method);
                if (!decryptMethod.GetKey(method))
                {
                    continue;
                }

                FindPatchData(type, cflowDeobfuscator);
                return;
            }
        }
Beispiel #4
0
		void Find(TypeDef type, ICflowDeobfuscator cflowDeobfuscator) {
			var additionalTypes = new List<string> {
				"System.IO.BinaryWriter",
			};
			foreach (var method in type.Methods) {
				if (!DotNetUtils.IsMethod(method, "System.Void", "(System.Int32[],System.UInt32[])"))
					continue;
				if (!DecryptMethod.CouldBeDecryptMethod(method, additionalTypes))
					continue;
				cflowDeobfuscator.Deobfuscate(method);
				if (!decryptMethod.GetKey(method))
					continue;

				FindPatchData(type, cflowDeobfuscator);
				return;
			}
		}
Beispiel #5
0
		void FindPatchData(TypeDef type, ICflowDeobfuscator cflowDeobfuscator) {
			var locals = new List<string> {
				"System.Int32[]",
				"System.UInt32[]",
			};
			foreach (var method in type.Methods) {
				if (method.Attributes != MethodAttributes.Private)
					continue;
				if (!DotNetUtils.IsMethod(method, "System.Void", "()"))
					continue;
				if (!new LocalTypes(method).Exactly(locals))
					continue;
				cflowDeobfuscator.Deobfuscate(method);
				var patchInfo = GetPatchInfo(method);
				if (patchInfo == null)
					continue;

				patchInfos.Add(patchInfo);
			}
		}
		void Find(TypeDef type, ICflowDeobfuscator cflowDeobfuscator) {
			var additionalTypes = new List<string> {
				"System.IO.BinaryReader",
				"System.IO.FileStream",
				"System.Reflection.Assembly",
				"System.Reflection.Assembly[]",
				"System.String",
			};
			foreach (var method in type.Methods) {
				if (!DotNetUtils.IsMethod(method, "System.Reflection.Assembly", "(System.Object,System.ResolveEventArgs)"))
					continue;
				if (!DecryptMethod.CouldBeDecryptMethod(method, additionalTypes))
					continue;
				cflowDeobfuscator.Deobfuscate(method);
				if (!decryptMethod.GetKey(method))
					continue;

				return;
			}
		}
Beispiel #7
0
 public MemoryPatcher(TypeDef type, ICflowDeobfuscator cflowDeobfuscator) =>
Beispiel #8
0
 public MemoryPatcher(TypeDef type, ICflowDeobfuscator cflowDeobfuscator)
 {
     Find(type, cflowDeobfuscator);
 }
Beispiel #9
0
		public MemoryPatcher(TypeDef type, ICflowDeobfuscator cflowDeobfuscator) {
			Find(type, cflowDeobfuscator);
		}
Beispiel #10
0
 public MemoryPatcher(TypeDefinition type, ICflowDeobfuscator cflowDeobfuscator)
 {
     find(type, cflowDeobfuscator);
 }
Beispiel #11
0
 public AssemblyResolver(TypeDef type, ICflowDeobfuscator cflowDeobfuscator)
 {
     Find(type, cflowDeobfuscator);
 }
		public AssemblyResolver(TypeDef type, ICflowDeobfuscator cflowDeobfuscator) {
			Find(type, cflowDeobfuscator);
		}
Beispiel #13
0
 public AssemblyResolver(TypeDefinition type, ICflowDeobfuscator cflowDeobfuscator)
 {
     find(type, cflowDeobfuscator);
 }
Beispiel #14
0
 public MemoryPatcher(TypeDefinition type, ICflowDeobfuscator cflowDeobfuscator)
 {
     find(type, cflowDeobfuscator);
 }
Beispiel #15
0
 public AssemblyResolver(TypeDefinition type, ICflowDeobfuscator cflowDeobfuscator)
 {
     find(type, cflowDeobfuscator);
 }
 public AssemblyResolver(TypeDef type, ICflowDeobfuscator cflowDeobfuscator) =>