private ReadProcessMemory ( |
||
hProcess | ||
lpBaseAddress | ||
bBuffer | [ | |
size | uint | |
lpNumberOfBytesRead | ||
Результат | int |
private int CalculatePointer(int iMemoryAddress, int[] iOffsets) { int num = iOffsets.Length - 1; byte[] bBuffer = new byte[4]; int num2 = 0; if (num == 0) { num2 = iMemoryAddress; } for (int i = 0; i <= num; i++) { IntPtr ptr; if (i == num) { MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)num2, bBuffer, 4, out ptr); return(this.Dec(this.CreateAddress(bBuffer)) + iOffsets[i]); } if (i == 0) { MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 4, out ptr); num2 = this.Dec(this.CreateAddress(bBuffer)) + iOffsets[0]; } else { MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)num2, bBuffer, 4, out ptr); num2 = this.Dec(this.CreateAddress(bBuffer)) + iOffsets[i]; } } return(0); }
public byte[] ReadAOB(int iMemoryAddress, uint iBytesToRead) { IntPtr ptr; byte[] bBuffer = new byte[iBytesToRead]; MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, iBytesToRead, out ptr); return(bBuffer); }
public ushort ReadShort(int iMemoryAddress, int[] iOffsets) { IntPtr ptr; int num = this.CalculatePointer(iMemoryAddress, iOffsets); byte[] bBuffer = new byte[2]; MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)num, bBuffer, 2, out ptr); return(BitConverter.ToUInt16(bBuffer, 0)); }
public long ReadLong(int iMemoryAddress, int[] iOffsets) { IntPtr ptr; int num = this.CalculatePointer(iMemoryAddress, iOffsets); byte[] bBuffer = new byte[8]; MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)num, bBuffer, 8, out ptr); return(BitConverter.ToInt64(bBuffer, 0)); }
public float ReadFloat(int iMemoryAddress, int[] iOffsets) { IntPtr ptr; int num = this.CalculatePointer(iMemoryAddress, iOffsets); byte[] bBuffer = new byte[4]; MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)num, bBuffer, 4, out ptr); return(BitConverter.ToSingle(bBuffer, 0)); }
public byte ReadByte(int iMemoryAddress, int[] iOffsets) { IntPtr ptr; int num = this.CalculatePointer(iMemoryAddress, iOffsets); byte[] bBuffer = new byte[1]; MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)num, bBuffer, 1, out ptr); return(bBuffer[0]); }
public byte[] ReadAOB(int iMemoryAddress, int[] iOffsets, uint iBytesToRead) { IntPtr ptr; int num = this.CalculatePointer(iMemoryAddress, iOffsets); byte[] bBuffer = new byte[iBytesToRead]; MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)num, bBuffer, iBytesToRead, out ptr); return(bBuffer); }
public ushort ReadShort(int iMemoryAddress) { IntPtr ptr; byte[] bBuffer = new byte[2]; if (MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 2, out ptr) == 0) { return(0); } return(BitConverter.ToUInt16(bBuffer, 0)); }
public long ReadLong(int iMemoryAddress) { IntPtr ptr; byte[] bBuffer = new byte[8]; if (MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 8, out ptr) == 0) { return(0L); } return(BitConverter.ToInt64(bBuffer, 0)); }
public uint ReadInt(int iMemoryAddress) { IntPtr ptr; byte[] bBuffer = new byte[4]; if (MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 4, out ptr) == 0) { return(0); } return(BitConverter.ToUInt32(bBuffer, 0)); }
public float ReadFloat(int iMemoryAddress) { IntPtr ptr; byte[] bBuffer = new byte[4]; if (MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 4, out ptr) == 0) { return(0f); } return(BitConverter.ToSingle(bBuffer, 0)); }
public double ReadDouble(int iMemoryAddress) { IntPtr ptr; byte[] bBuffer = new byte[8]; if (MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 8, out ptr) == 0) { return(0.0); } return(BitConverter.ToDouble(bBuffer, 0)); }
public byte ReadByte(int iMemoryAddress) { IntPtr ptr; byte[] bBuffer = new byte[1]; if (MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, 1, out ptr) == 0) { return(0); } return(bBuffer[0]); }
public string ReadString(int iMemoryAddress, uint iTextLength, int iMode = 0) { IntPtr ptr; byte[] bBuffer = new byte[iTextLength]; MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)iMemoryAddress, bBuffer, iTextLength, out ptr); if (iMode == 0) { return(Encoding.UTF8.GetString(bBuffer)); } if (iMode == 1) { return(BitConverter.ToString(bBuffer).Replace("-", "")); } return(""); }
public string ReadText(int iMemoryAddress, int[] iOffsets, uint iStringLength, int iMode = 0) { IntPtr ptr; int num = this.CalculatePointer(iMemoryAddress, iOffsets); byte[] bBuffer = new byte[1]; MAPI.ReadProcessMemory(this.hReadProcess, (IntPtr)num, bBuffer, iStringLength, out ptr); if (iMode == 0) { return(Encoding.UTF8.GetString(bBuffer)); } if (iMode == 1) { return(BitConverter.ToString(bBuffer).Replace("-", "")); } return(""); }