Guest User

Untitled

a guest
Jul 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  2. public delegate IntPtr VirtualAllocDelegate(IntPtr lpAddress, UIntPtr dwSize, AllocationType allocationType, MemoryProtection protection);
  3. public static readonly VirtualAllocDelegate VirtualAllocHandler = OnVirtualAlloc;
  4.  
  5. public static IntPtr OnVirtualAlloc(IntPtr lpAddress, UIntPtr dwSize, AllocationType allocationType, MemoryProtection protection)
  6. {
  7. IntPtr addressFound = (IntPtr)Magic.Instance.Detours["VirtualAllocHook"].CallOriginal(lpAddress, dwSize, allocationType, protection);
  8. Logging.Write("Address found: 0x{0:X}, dwSize: 0x{1:X}, allocationFlags: {2}, protectFlags: {3}", (uint)addressFound, (uint)dwSize, allocationType, protection);
  9. return addressFound;
  10. }
Add Comment
Please, Sign In to add comment