Example #1
0
        private MIntPtr GetRemoteProcAddress(string Module, string Function)
        {
            Target.Refresh();

            var     Handle = LoadLibraryA(Module);
            MIntPtr func   = Imports.GetProcAddress(Handle, Function);

            if (!func)
            {
                return(IntPtr.Zero);
            }

            ulong offset = func.ToUInt64() - Handle.ToUInt64();

            return(Target.GetModuleByName(Module).Sum(offset));
        }
Example #2
0
 /// <summary>
 /// Parse a MIntPtr to your generic type
 /// </summary>
 /// <typeparam name="T">The MIntPtr Type</typeparam>
 /// <param name="Pointer">The Pointer to Parse</param>
 /// <returns>The Converted Type</returns>
 public static T Parse <T>(this MIntPtr <T> Pointer) => Pointer;
Example #3
0
 public static MIntPtr Sum(this MIntPtr Pointer, long Value) => (Pointer.ToUInt64() + (ulong)Value).ToIntPtr();
Example #4
0
 public static uint HighToUInt32(this MIntPtr Ptr) => unchecked ((uint)((IntPtr)Ptr) >> 32);
Example #5
0
 public static uint ToUInt32(this MIntPtr Ptr) => unchecked ((uint)(((IntPtr)Ptr).ToInt64() & 0xFFFFFFFF));
Example #6
0
 public static ulong ToUInt64(this MIntPtr Ptr) => unchecked ((ulong)((IntPtr)Ptr).ToInt64());