Пример #1
0
			public unsafe DecrypterV2_0_13_0_Base(DynamicMethodsDecrypter dmd) {
				this.dmd = dmd;
				invoker = (Delegate)dmd.invokerFieldInfo.GetValue(null);

				byte* p = (byte*)DecrypterBaseV2_0_12_x.GetStateAddr(invoker.Target);
				byte* pis = GetAddr(*(byte**)p);
				p = *(byte**)pis;
				byte* pam = *(byte**)(p + IntPtr.Size * 2);
				p = *(byte**)(p + ((Environment.Version.Major - 2) / 2 * IntPtr.Size));
				p += IntPtr.Size * 8 + 0x18;
				p = LookUp(p, AppDomain.CurrentDomain.Id);
				p = *(byte**)(p + IntPtr.Size * 16 + 0x18);
				byte* pd = p + IntPtr.Size * 2;
				p = *(byte**)(p + IntPtr.Size * 13);

				getCallerMethodAsILByteArrayDelegate = GetCallerMethodAsILByteArray;
				decryptCallbackDelegate = DecryptCallback;
				ignoreDelegate = IgnoreMethod;

				byte* pm = p + 0x28 * IntPtr.Size;
				*(IntPtr*)(p + 0x29 * IntPtr.Size) = Marshal.GetFunctionPointerForDelegate(getCallerMethodAsILByteArrayDelegate);
				*(IntPtr*)(p + 0x2A * IntPtr.Size) = Marshal.GetFunctionPointerForDelegate(decryptCallbackDelegate);
				if (IntPtr.Size == 4)
					*(IntPtr*)(p + 0x2B * IntPtr.Size) = Marshal.GetFunctionPointerForDelegate(ignoreDelegate);
				InitCode(GetModuleHandle(pis), pam, pd, pm);
			}
Пример #2
0
			public unsafe DecrypterV2_0_12_3(DynamicMethodsDecrypter dmd)
				: base(dmd) {
				getCallerMethodAsILByteArrayDelegate = GetCallerMethodAsILByteArray;
				decryptCallbackDelegate = DecryptCallback;

				*(IntPtr*)pGetILBytes = Marshal.GetFunctionPointerForDelegate(getCallerMethodAsILByteArrayDelegate);
				*(IntPtr*)pDecryptCallback = Marshal.GetFunctionPointerForDelegate(decryptCallbackDelegate);
			}
Пример #3
0
			public unsafe DecrypterV2_0_13_0_Base(DynamicMethodsDecrypter dmd) {
				this.dmd = dmd;
				this.invoker = (Delegate)dmd.invokerFieldInfo.GetValue(null);

				byte* p = (byte*)DecrypterBaseV2_0_12_x.GetStateAddr(invoker.Target);
				byte* pis = GetAddr(*(byte**)p);
				p = *(byte**)pis;
				byte* pam = *(byte**)(p + IntPtr.Size * 2);
				p = *(byte**)(p + ((Environment.Version.Major - 2) / 2 * IntPtr.Size));
				p += IntPtr.Size * 8 + 0x18;
				p = LookUp(p, AppDomain.CurrentDomain.Id);
				p = *(byte**)(p + IntPtr.Size * 16 + 0x18);
				byte* pd = p + IntPtr.Size * 2;
				p = *(byte**)(p + IntPtr.Size * 13);

				getCallerMethodAsILByteArrayDelegate = GetCallerMethodAsILByteArray;
				decryptCallbackDelegate = DecryptCallback;
				ignoreDelegate = IgnoreMethod;

				byte* pm = p + 0x28 * IntPtr.Size;
				*(IntPtr*)(p + 0x29 * IntPtr.Size) = Marshal.GetFunctionPointerForDelegate(getCallerMethodAsILByteArrayDelegate);
				*(IntPtr*)(p + 0x2A * IntPtr.Size) = Marshal.GetFunctionPointerForDelegate(decryptCallbackDelegate);
				if (IntPtr.Size == 4)
					*(IntPtr*)(p + 0x2B * IntPtr.Size) = Marshal.GetFunctionPointerForDelegate(ignoreDelegate);
				InitCode(GetModuleHandle(pis), pam, pd, pm);
			}
Пример #4
0
			public unsafe DecrypterV2_0_12_3(DynamicMethodsDecrypter dmd)
				: base(dmd) {
				getCallerMethodAsILByteArrayDelegate = GetCallerMethodAsILByteArray;
				decryptCallbackDelegate = DecryptCallback;

				*(IntPtr*)pGetILBytes = Marshal.GetFunctionPointerForDelegate(getCallerMethodAsILByteArrayDelegate);
				*(IntPtr*)pDecryptCallback = Marshal.GetFunctionPointerForDelegate(decryptCallbackDelegate);
			}