WriteProcessMemory() 개인적인 메소드

private WriteProcessMemory ( IntPtr hProcess, IntPtr lpBaseAddress, [ bBuffer, uint size, IntPtr &lpNumberOfBytesWritten ) : int
hProcess System.IntPtr
lpBaseAddress System.IntPtr
bBuffer [
size uint
lpNumberOfBytesWritten System.IntPtr
리턴 int
예제 #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);
        }
예제 #2
0
        public bool Write(int iMemoryAddress, double iDoubleToWrite)
        {
            byte[] bBuffer = BitConverter.GetBytes(iDoubleToWrite); IntPtr ptrBytesWritten;
            MAPI.WriteProcessMemory(hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 8, out ptrBytesWritten);

            return(ptrBytesWritten.ToInt32() == 8);
        }
예제 #3
0
        //Write to Address
        public bool Write(int iMemoryAddress, byte bByteToWrite)
        {
            byte[] bBuffer = { bByteToWrite }; IntPtr ptrBytesWritten;
            MAPI.WriteProcessMemory(hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 1, out ptrBytesWritten);

            return(ptrBytesWritten.ToInt32() == 1);
        }
예제 #4
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);
        }
예제 #5
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);
        }
예제 #6
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);
        }
예제 #7
0
        public bool Write(int iMemoryAddress, int[] iOffsets, byte[] bBytesToWrite)
        {
            int    iFinalAddress = CalculatePointer(iMemoryAddress, iOffsets);
            IntPtr ptrBytesWritten;

            MAPI.WriteProcessMemory(hReadProcess, (IntPtr)iFinalAddress, bBytesToWrite, (uint)bBytesToWrite.Length, out ptrBytesWritten);
            return(ptrBytesWritten.ToInt32() == bBytesToWrite.Length);
        }
예제 #8
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);
        }
예제 #9
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);
        }
예제 #10
0
        public bool Write(int iMemoryAddress, int[] iOffsets, double iDoubleToWrite)
        {
            int    iFinalAddress = CalculatePointer(iMemoryAddress, iOffsets);
            IntPtr ptrBytesWritten;

            byte[] bBuffer = BitConverter.GetBytes(iDoubleToWrite);
            MAPI.WriteProcessMemory(hReadProcess, (IntPtr)iFinalAddress, bBuffer, 8, out ptrBytesWritten);
            return(ptrBytesWritten.ToInt32() == 8);
        }
예제 #11
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);
        }
예제 #12
0
        //Write to Pointer
        public bool Write(int iMemoryAddress, int[] iOffsets, byte bByteToWrite)
        {
            int    iFinalAddress = CalculatePointer(iMemoryAddress, iOffsets);
            IntPtr ptrBytesWritten;

            byte[] bBuffer = new byte[1] {
                bByteToWrite
            };
            MAPI.WriteProcessMemory(hReadProcess, (IntPtr)iFinalAddress, bBuffer, 1, out ptrBytesWritten);
            return(ptrBytesWritten.ToInt32() == 1);
        }
예제 #13
0
        public bool NOP(int iMemoryAddress, int iLength)
        {
            byte[] bBuffer = new byte[iLength]; IntPtr ptrBytesWritten;
            for (int i = 0; i < iLength; i++)
            {
                bBuffer[i] = 0x90;
            }

            MAPI.WriteProcessMemory(hReadProcess, (IntPtr)iMemoryAddress, bBuffer, (uint)iLength, out ptrBytesWritten);
            return(ptrBytesWritten.ToInt32() == iLength);
        }
예제 #14
0
        public bool NOP(int iMemoryAddress, int[] iOffsets, int iLength)
        {
            int    iFinalAddress = CalculatePointer(iMemoryAddress, iOffsets);
            IntPtr ptrBytesWritten; byte[] bBytesToWrite = new byte[iLength];

            for (int i = 0; i < iLength; i++)
            {
                bBytesToWrite[i] = 0x90;
            }
            MAPI.WriteProcessMemory(hReadProcess, (IntPtr)iFinalAddress, bBytesToWrite, (uint)iLength, out ptrBytesWritten);
            return(ptrBytesWritten.ToInt32() == bBytesToWrite.Length);
        }
예제 #15
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);
        }
예제 #16
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);
        }
예제 #17
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);
        }
예제 #18
0
        public bool Write(int iMemoryAddress, string sStringToWrite, int iMode = 0)
        {
            byte[] bBuffer = { 0 }; IntPtr ptrBytesWritten;

            if (iMode == 0)
            {
                bBuffer = CreateAOBText(sStringToWrite);
            }
            else if (iMode == 1)
            {
                bBuffer = ReverseBytes(CreateAOBString(sStringToWrite));
            }

            MAPI.WriteProcessMemory(hReadProcess, (IntPtr)iMemoryAddress, bBuffer, (uint)bBuffer.Length, out ptrBytesWritten);

            return(ptrBytesWritten.ToInt32() == bBuffer.Length);
        }
예제 #19
0
        public bool Write(int iMemoryAddress, int[] iOffsets, string sStringToWrite, int iMode = 0)
        {
            int    iFinalAddress = CalculatePointer(iMemoryAddress, iOffsets);
            IntPtr ptrBytesWritten; byte[] bBuffer = { 0 };

            if (iMode == 0)
            {
                bBuffer = CreateAOBText(sStringToWrite);
            }
            else if (iMode == 1)
            {
                bBuffer = ReverseBytes(CreateAOBString(sStringToWrite));
            }

            MAPI.WriteProcessMemory(hReadProcess, (IntPtr)iFinalAddress, bBuffer, (uint)sStringToWrite.Length, out ptrBytesWritten);
            return(ptrBytesWritten.ToInt32() == sStringToWrite.Length);
        }