private void ShowStructure(cOffset ofs) { ofs.Structure = cmb_structure.Text; dta.Items.Clear(); if (!string.IsNullOrEmpty(cmb_structure.Text)) { cStructure str = (cStructure)Project.Poe.Structs.FirstOrDefault(s => s.Name == cmb_structure.Text); if (str != null) { foreach (cField f in str.Fields) { ListViewItem row = new ListViewItem(f.Offset.ToString("X8").TrimStart('0')); row.SubItems.Add(f.Description); row.SubItems.Add(f.Type.ToString()); string val = ""; switch (f.Type) { case DataType.Integer: val = mem.ReadInt(CurAdress + f.Offset).ToString(); break; case DataType.Float: val = mem.ReadFloat(CurAdress + f.Offset).ToString(); break; case DataType.Pointer: val = "p->" + mem.ReadInt(CurAdress + f.Offset).ToString("X8"); break; case DataType.String: val = mem.ReadString(CurAdress + f.Offset, 255); break; case DataType.Bit: val = (mem.ReadByte(CurAdress + f.Offset) & 1).ToString(); break; } row.SubItems.Add(val); dta.Items.Add(row); } } } }
private void initializeDemoStruct() { cStructure s = new cStructure(); s.Name = "Element"; s.Fields.Add(new cField(0x818, "List of ChildWindows-Start", DataType.Pointer)); s.Fields.Add(new cField(0x81c, "List of ChildWindows-Start", DataType.Pointer)); s.Fields.Add(new cField(0x864, "Root-Window", DataType.Pointer)); s.Fields.Add(new cField(0x868, "Parent Window", DataType.Pointer)); s.Fields.Add(new cField(0x86C, "X-Position", DataType.Float)); s.Fields.Add(new cField(0x870, "Y-Position", DataType.Float)); s.Fields.Add(new cField(0x8F8, "Widht", DataType.Float)); s.Fields.Add(new cField(0x8FC, "Height", DataType.Float)); s.Fields.Add(new cField(0x8a4, "isClickable -> not sure!!", DataType.Float)); Project.Poe.Structs.Add(s); s = new cStructure(); s.Name = "Inventory"; s.Fields.Add(new cField(0xC, "Width", DataType.Integer)); s.Fields.Add(new cField(0x10, "Height", DataType.Integer)); s.Fields.Add(new cField(0x20, "ListStart", DataType.Pointer)); s.Fields.Add(new cField(0x24, "ListEnd", DataType.Pointer)); Project.Poe.Structs.Add(s); s = new cStructure(); s.Name = "Entity"; s.Fields.Add(new cField(0x4, "ComponentList-Start", DataType.Pointer)); s.Fields.Add(new cField(0x8, "ComponentList-Start", DataType.Pointer)); s.Fields.Add(new cField(0x18, "Id", DataType.Integer)); s.Fields.Add(new cField(0x10, "Hostile", DataType.Bit)); s.Fields.Add(new cField(0x20, "ListStart", DataType.Pointer)); s.Fields.Add(new cField(0x24, "ListEnd", DataType.Pointer)); Project.Poe.Structs.Add(s); s = new cStructure(); s.Name = "Inventory-Set"; s.Fields.Add(new cField(0x0, "Player Inventory", DataType.Pointer)); s.Fields.Add(new cField(0x10, "Chest Item", DataType.Pointer)); s.Fields.Add(new cField(0x20, "Left Weapon", DataType.Pointer)); s.Fields.Add(new cField(0x30, "Right Weapon", DataType.Pointer)); s.Fields.Add(new cField(0x00, "PlayerInventory", DataType.Pointer)); s.Fields.Add(new cField(0x10, "Chest ", DataType.Pointer)); s.Fields.Add(new cField(0x20, "Left Weapon ", DataType.Pointer)); s.Fields.Add(new cField(0x30, "Right Weapon ", DataType.Pointer)); s.Fields.Add(new cField(0x40, "Helm ", DataType.Pointer)); s.Fields.Add(new cField(0x50, "Amulet ", DataType.Pointer)); s.Fields.Add(new cField(0x60, "Left Ring ", DataType.Pointer)); s.Fields.Add(new cField(0x70, "Right Ring ", DataType.Pointer)); s.Fields.Add(new cField(0x80, "Gloves ", DataType.Pointer)); s.Fields.Add(new cField(0x90, "Boots ", DataType.Pointer)); s.Fields.Add(new cField(0xa0, "Belt ", DataType.Pointer)); s.Fields.Add(new cField(0xb0, "Flasks ", DataType.Pointer)); s.Fields.Add(new cField(0xc0, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0xd0, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0xe0, "Left Weapon swap", DataType.Pointer)); s.Fields.Add(new cField(0xf0, "Right Weapon swap", DataType.Pointer)); s.Fields.Add(new cField(0x100, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0x110, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0x120, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0x130, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0x140, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0x150, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0x160, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0x170, "unknown", DataType.Pointer)); s.Fields.Add(new cField(0x180, "Stash 1", DataType.Pointer)); s.Fields.Add(new cField(0x190, "Stash 2", DataType.Pointer)); s.Fields.Add(new cField(0x1a0, "Stash 3", DataType.Pointer)); s.Fields.Add(new cField(0x1b0, "Stash 4", DataType.Pointer)); s.Fields.Add(new cField(0x1c0, "Stash 5", DataType.Pointer)); s.Fields.Add(new cField(0x1d0, "Stash 6", DataType.Pointer)); s.Fields.Add(new cField(0x1e0, "Stash 7", DataType.Pointer)); s.Fields.Add(new cField(0x1f0, "Stash 8", DataType.Pointer)); s.Fields.Add(new cField(0x200, "Stash 9", DataType.Pointer)); s.Fields.Add(new cField(0x210, "Stash 10", DataType.Pointer)); s.Fields.Add(new cField(0x220, "Stash 11", DataType.Pointer)); s.Fields.Add(new cField(0x230, "Stash 12", DataType.Pointer)); s.Fields.Add(new cField(0x240, "Stash 13", DataType.Pointer)); s.Fields.Add(new cField(0x250, "Stash 14", DataType.Pointer)); s.Fields.Add(new cField(0x260, "Stash 15", DataType.Pointer)); s.Fields.Add(new cField(0x270, "Stash 16", DataType.Pointer)); s.Fields.Add(new cField(0x280, "Stash 17", DataType.Pointer)); s.Fields.Add(new cField(0x290, "Stash 18", DataType.Pointer)); s.Fields.Add(new cField(0x2a0, "Stash 19", DataType.Pointer)); s.Fields.Add(new cField(0x2b0, "Stash 20", DataType.Pointer)); s.Fields.Add(new cField(0x2c0, "Stash 21", DataType.Pointer)); s.Fields.Add(new cField(0x2d0, "Stash 22", DataType.Pointer)); s.Fields.Add(new cField(0x2e0, "Stash 23", DataType.Pointer)); s.Fields.Add(new cField(0x2f0, "Stash 24", DataType.Pointer)); Project.Poe.Structs.Add(s); }