WriteProcessMemory() private méthode

private WriteProcessMemory ( IntPtr hProcess, IntPtr lpBaseAddress, [ bBuffer, uint size, IntPtr &lpNumberOfBytesWritten ) : int
hProcess System.IntPtr
lpBaseAddress System.IntPtr
bBuffer [
size uint
lpNumberOfBytesWritten System.IntPtr
Résultat int
Exemple #1
0
        public bool Write(int iMemoryAddress, byte[] bBytesToWrite)
        {
            IntPtr ptr;

            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBytesToWrite, (uint)bBytesToWrite.Length, out ptr);
            return(ptr.ToInt32() == bBytesToWrite.Length);
        }
Exemple #2
0
        public bool Write(int iMemoryAddress, int[] iOffsets, byte[] bBytesToWrite)
        {
            IntPtr ptr;
            int    num = this.CalculatePointer(iMemoryAddress, iOffsets);

            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)num, bBytesToWrite, (uint)bBytesToWrite.Length, out ptr);
            return(ptr.ToInt32() == bBytesToWrite.Length);
        }
Exemple #3
0
        public bool Write(int iMemoryAddress, float iFloatToWrite)
        {
            IntPtr ptr;

            byte[] bytes = BitConverter.GetBytes(iFloatToWrite);
            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bytes, 4, out ptr);
            return(ptr.ToInt32() == 4);
        }
Exemple #4
0
        public bool Write(int iMemoryAddress, double iDoubleToWrite)
        {
            IntPtr ptr;

            byte[] bytes = BitConverter.GetBytes(iDoubleToWrite);
            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bytes, 8, out ptr);
            return(ptr.ToInt32() == 8);
        }
Exemple #5
0
        public bool Write(int iMemoryAddress, byte bByteToWrite)
        {
            IntPtr ptr;

            byte[] bBuffer = new byte[] { bByteToWrite };
            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 1, out ptr);
            return(ptr.ToInt32() == 1);
        }
Exemple #6
0
        public bool Write(int iMemoryAddress, int[] iOffsets, float iFloatToWrite)
        {
            IntPtr ptr;
            int    num = this.CalculatePointer(iMemoryAddress, iOffsets);

            byte[] bytes = BitConverter.GetBytes(iFloatToWrite);
            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)num, bytes, 4, out ptr);
            return(ptr.ToInt32() == 4);
        }
Exemple #7
0
        public bool Write(int iMemoryAddress, int[] iOffsets, byte bByteToWrite)
        {
            IntPtr ptr;
            int    num = this.CalculatePointer(iMemoryAddress, iOffsets);

            byte[] bBuffer = new byte[] { bByteToWrite };
            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)num, bBuffer, 1, out ptr);
            return(ptr.ToInt32() == 1);
        }
Exemple #8
0
        public bool NOP(int iMemoryAddress, int iLength)
        {
            IntPtr ptr;

            byte[] bBuffer = new byte[iLength];
            for (int i = 0; i < iLength; i++)
            {
                bBuffer[i] = 0x90;
            }
            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, (uint)iLength, out ptr);
            return(ptr.ToInt32() == iLength);
        }
Exemple #9
0
        public bool NOP(int iMemoryAddress, int[] iOffsets, int iLength)
        {
            IntPtr ptr;
            int    num = this.CalculatePointer(iMemoryAddress, iOffsets);

            byte[] bBuffer = new byte[iLength];
            for (int i = 0; i < iLength; i++)
            {
                bBuffer[i] = 0x90;
            }
            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)num, bBuffer, (uint)iLength, out ptr);
            return(ptr.ToInt32() == bBuffer.Length);
        }
Exemple #10
0
        public bool Write(int iMemoryAddress, string sStringToWrite, int iMode = 0)
        {
            IntPtr ptr;

            byte[] bBuffer = new byte[1];
            if (iMode == 0)
            {
                bBuffer = this.CreateAOBText(sStringToWrite);
            }
            else if (iMode == 1)
            {
                bBuffer = this.ReverseBytes(this.CreateAOBString(sStringToWrite));
            }
            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, (uint)bBuffer.Length, out ptr);
            return(ptr.ToInt32() == bBuffer.Length);
        }
Exemple #11
0
        public bool Write(int iMemoryAddress, int[] iOffsets, string sStringToWrite, int iMode = 0)
        {
            IntPtr ptr;
            int    num = this.CalculatePointer(iMemoryAddress, iOffsets);

            byte[] bBuffer = new byte[1];
            if (iMode == 0)
            {
                bBuffer = this.CreateAOBText(sStringToWrite);
            }
            else if (iMode == 1)
            {
                bBuffer = this.ReverseBytes(this.CreateAOBString(sStringToWrite));
            }
            MAPI.WriteProcessMemory(this.hReadProcess, (IntPtr)num, bBuffer, (uint)sStringToWrite.Length, out ptr);
            return(ptr.ToInt32() == sStringToWrite.Length);
        }