public static int[] ReadIDArray() { var itemids = new List <int>(); var memloc = (int)ArrayPointer; var n = LoadedCount; MemoryBuffer buffer = Preader.createSearchBuffer(memloc, (Constants.AH_OFFSET_FIRSTITEMID + Constants.AH_OFFSET_ITEMID_INCREMENT * n)); for (var i = 0; i < n; i++) { itemids.Add((int)buffer.Read2Bytes(memloc + Constants.AH_OFFSET_FIRSTITEMID + Constants.AH_OFFSET_ITEMID_INCREMENT * i)); } CampahStatus.SetStatus("Item list read complete."); return(itemids.ToArray()); }
private static IntPtr ReadPointer(IntPtr pointer, int offset) { int readcount; return((IntPtr)BitConverter.ToInt32(Preader.ReadProcessMemory((IntPtr)((int)pointer + offset), 4, out readcount), 0)); }
private static int Read2Bytes(IntPtr pointer, int offset) { int readcount; return(BitConverter.ToInt16(Preader.ReadProcessMemory((IntPtr)((int)pointer + offset), 2, out readcount), 0)); }