Exemple #1
0
        void initStringDecrypter(StringDecrypterInfo info)
        {
            Log.v("Adding string decrypter. Resource: {0}", Utils.toCsharpString(info.StringsResource.Name));
            var decrypter = new StringDecrypter(info);

            if (decrypter.CanDecrypt)
            {
                staticStringInliner.add(DotNetUtils.getMethod(info.GetStringDelegate, "Invoke"), (method, args) => {
                    var fieldDefinition = DotNetUtils.getField(module, (FieldReference)args[0]);
                    return(decrypter.decrypt(fieldDefinition.MetadataToken.ToInt32(), (int)args[1]));
                });
                staticStringInliner.add(info.StringDecrypterMethod, (method, args) => {
                    return(decrypter.decrypt(0, (int)args[0]));
                });
            }
            stringDecrypters.Add(decrypter);
            DeobfuscatedFile.stringDecryptersAdded();
        }
Exemple #2
0
        void InitStringDecrypter(StringDecrypterInfo info)
        {
            Logger.v("Adding string decrypter. Resource: {0}", Utils.ToCsharpString(info.StringsResource.Name));
            var decrypter = new StringDecrypter(info);

            if (decrypter.CanDecrypt)
            {
                var invokeMethod = info.GetStringDelegate?.FindMethod("Invoke");
                staticStringInliner.Add(invokeMethod, (method, gim, args) => {
                    var fieldDef = DotNetUtils.GetField(module, (IField)args[0]);
                    return(decrypter.Decrypt(fieldDef.MDToken.ToInt32(), (int)args[1]));
                });
                staticStringInliner.Add(info.StringDecrypterMethod, (method, gim, args) => {
                    return(decrypter.Decrypt(0, (int)args[0]));
                });
            }
            stringDecrypters.Add(decrypter);
            DeobfuscatedFile.StringDecryptersAdded();
        }
		void InitStringDecrypter(StringDecrypterInfo info) {
			Logger.v("Adding string decrypter. Resource: {0}", Utils.ToCsharpString(info.StringsResource.Name));
			var decrypter = new StringDecrypter(info);
			if (decrypter.CanDecrypt) {
				var invokeMethod = info.GetStringDelegate == null ? null : info.GetStringDelegate.FindMethod("Invoke");
				staticStringInliner.Add(invokeMethod, (method, gim, args) => {
					var fieldDef = DotNetUtils.GetField(module, (IField)args[0]);
					return decrypter.Decrypt(fieldDef.MDToken.ToInt32(), (int)args[1]);
				});
				staticStringInliner.Add(info.StringDecrypterMethod, (method, gim, args) => {
					return decrypter.Decrypt(0, (int)args[0]);
				});
			}
			stringDecrypters.Add(decrypter);
			DeobfuscatedFile.StringDecryptersAdded();
		}
Exemple #4
0
 void initStringDecrypter(StringDecrypterInfo info)
 {
     Log.v("Adding string decrypter. Resource: {0}", Utils.toCsharpString(info.StringsResource.Name));
     var decrypter = new StringDecrypter(info);
     if (decrypter.CanDecrypt) {
         staticStringDecrypter.add(DotNetUtils.getMethod(info.GetStringDelegate, "Invoke"), (method, args) => {
             var fieldDefinition = DotNetUtils.getField(module, (FieldReference)args[0]);
             return decrypter.decrypt(fieldDefinition.MetadataToken.ToInt32(), (int)args[1]);
         });
         staticStringDecrypter.add(info.StringDecrypterMethod, (method, args) => {
             return decrypter.decrypt(0, (int)args[0]);
         });
     }
     stringDecrypters.Add(decrypter);
     DeobfuscatedFile.stringDecryptersAdded();
 }