public static IntPtr MAllocString(Process Target, string String, bool Unicode) { if (String == null) { return(IntPtr.Zero); } var Enco = Unicode ? Encoding.Unicode : Encoding.Default; return(MemoryManagement.MAlloc(Target, Enco.GetBytes(String + "\x0"))); }
/// <summary> /// Automatically Alloc the <paramref name="Content"/> to the target process /// </summary> /// <param name="Content">The content to alloc</param> /// <param name="Executable">Make this allocated content executable</param> /// <returns>The pointer to the allocated content</returns> public static IntPtr MAlloc(this Process Process, byte[] Content, bool Executable = false) => MemoryManagement.MAlloc(Process, Content, Executable);