Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- public delegate IntPtr VirtualAllocDelegate(IntPtr lpAddress, UIntPtr dwSize, AllocationType allocationType, MemoryProtection protection);
- public static readonly VirtualAllocDelegate VirtualAllocHandler = OnVirtualAlloc;
- public static IntPtr OnVirtualAlloc(IntPtr lpAddress, UIntPtr dwSize, AllocationType allocationType, MemoryProtection protection)
- {
- IntPtr addressFound = (IntPtr)Magic.Instance.Detours["VirtualAllocHook"].CallOriginal(lpAddress, dwSize, allocationType, protection);
- Logging.Write("Address found: 0x{0:X}, dwSize: 0x{1:X}, allocationFlags: {2}, protectFlags: {3}", (uint)addressFound, (uint)dwSize, allocationType, protection);
- return addressFound;
- }
Add Comment
Please, Sign In to add comment