Esempio n. 1
0
        /// <summary>
        /// Writes a value to another process' memory.
        /// </summary>
        /// <param name="dwAddress">Address at which value will be written.</param>
        /// <param name="value">Value that will be written to memory.</param>
        /// <returns>Returns true on success, false on failure.</returns>
        public bool Write <T>(uint dwAddress, T value)
        {
            var size     = Marshal.SizeOf(typeof(T));
            var writePtr = Memory.WowMemory.Memory.AllocateMemory(size);

            if (writePtr <= 0)
            {
                return(false);
            }
            if (!SMemory.WriteObject(this.m_hProcess, writePtr, value, value.GetType()))
            {
                return(false);
            }
            string[] mWrite =
            {
                "mov esi, " + writePtr,
                "mov edi," + dwAddress,
                "mov ecx," + size,
                "rep movsb",
                "retn"
            };
            bool success = Memory.WowProcess.Executor.Call(mWrite) != IntPtr.Zero;

            Memory.WowMemory.Memory.FreeMemory(writePtr);
            return(success);
        }
Esempio n. 2
0
 /// <summary>
 /// Writes a value to another process' memory.
 /// </summary>
 /// <param name="dwAddress">Address at which value will be written.</param>
 /// <param name="Value">Value that will be written to memory.</param>
 /// <returns>Returns true on success, false on failure.</returns>
 public bool WriteObject(uint dwAddress, object Value)
 {
     return(SMemory.WriteObject(this.m_hProcess, dwAddress, Value, Value.GetType()));
 }
Esempio n. 3
0
 /// <summary>
 /// Writes a value to another process' memory.
 /// </summary>
 /// <param name="dwAddress">Address at which value will be written.</param>
 /// <param name="Value">Value that will be written to memory.</param>
 /// <param name="objType">Type of object to be written (hint: use Object.GetType() or typeof(ObjectType)).</param>
 /// <returns>Returns true on success, false on failure.</returns>
 public bool WriteObject(uint dwAddress, object Value, Type objType)
 {
     return(SMemory.WriteObject(this.m_hProcess, dwAddress, Value, objType));
 }