diff --git a/dfhack/DFHackAPI.cpp b/dfhack/DFHackAPI.cpp index fcaaf4db0..2d649c638 100644 --- a/dfhack/DFHackAPI.cpp +++ b/dfhack/DFHackAPI.cpp @@ -1079,8 +1079,8 @@ bool API::InitReadCreatures( uint32_t &numcreatures ) off.name_nickname_offset = minfo->getOffset("name_nickname"); off.name_words_offset = minfo->getOffset("name_words"); - // HACK: vector correction - off.vector_correct = minfo->getOffset("hacked_vector_start"); + // HACK: vector correction. No longer relevant. + off.vector_correct = 0; d->p_cre = new DfVector (d->p, off.creature_vector, 4); d->creaturesInited = true; diff --git a/dfhack/DFVector.cpp b/dfhack/DFVector.cpp index d03eabacb..4123940ca 100644 --- a/dfhack/DFVector.cpp +++ b/dfhack/DFVector.cpp @@ -33,7 +33,7 @@ DfVector::DfVector(Process * p, uint32_t address, uint32_t _item_size) uint32_t triplet[3]; item_size = _item_size; memory_info * mem = p->getDescriptor(); - uint32_t offs = mem->getOffset("hacked_vector_triplet"); + uint32_t offs = mem->getOffset("vector_triplet"); p->read(address + offs, sizeof(triplet), (uint8_t *) &triplet); start = triplet[0]; diff --git a/examples/veccheck.cpp b/examples/veccheck.cpp index 66c6431c5..ba82b2f87 100644 --- a/examples/veccheck.cpp +++ b/examples/veccheck.cpp @@ -64,29 +64,31 @@ int main (int numargs, const char ** args) DFHack::memory_info* mem = DF.getMemoryInfo(); //const vector * names = mem->getClassIDMapping(); - DumpObjStr0Vector("Inorganics",p,0x16afd04); + DumpObjStr0Vector("Material templates",p, mem->getAddress("mat_templates")); - DumpObjStr0Vector("Organics - all",p,0x16afd1C); + DumpObjStr0Vector("Inorganics",p, mem->getAddress("mat_inorganics")); - DumpObjStr0Vector("Organics - filtered",p,0x16afd34); + DumpObjStr0Vector("Organics - all",p, mem->getAddress("mat_organics_all")); - DumpDWordVector("Some weird numbers",p,0x16afd4C); + DumpObjStr0Vector("Organics - plants",p, mem->getAddress("mat_organics_plants")); - DumpObjStr0Vector("Trees/wood",p,0x16afd64); + DumpDWordVector("Maybe map between all organics and plants",p, mem->getAddress("mat_unk1_numbers")); - DumpDWordVector("More weird numbers",p,0x16afd7C); + DumpObjStr0Vector("Trees/wood",p, mem->getAddress("mat_organics_trees")); - DumpObjStr0Vector("WTF",p,0x16afd7C + 0x18 ); + DumpDWordVector("Maybe map between all organics and trees",p, mem->getAddress("mat_unk2_numbers")); - DumpObjStr0Vector("WTF2",p,0x16afd7C + 0x18 + 0x18); + DumpObjStr0Vector("Body material templates",p, mem->getAddress("mat_body_material_templates")); - DumpObjStr0Vector("WTF3",p,0x16afd7C + 0x18 + 0x18 + 0x18 ); + DumpObjStr0Vector("Body detail plans",p, mem->getAddress("mat_body_detail_plans")); - DumpObjStr0Vector("WTF4",p,0x16afd7C + 0x18 + 0x18 + 0x18 + 0x18); + DumpObjStr0Vector("Bodies",p, mem->getAddress("mat_bodies")); - DumpObjStr0Vector("WTF5",p,0x16afd7C + 0x18 + 0x18 + 0x18 + 0x18 + 0x18); + DumpObjStr0Vector("Bodygloss",p, mem->getAddress("mat_bodygloss")); - DumpObjStr0Vector("Creature types",p,0x16afd7C + 0x18 + 0x18 + 0x18 + 0x18 + 0x18 + 0x18); + DumpObjStr0Vector("Creature variations",p, mem->getAddress("mat_creature_variations")); + + DumpObjStr0Vector("Creature types",p, mem->getAddress("mat_creature_types")); #ifndef LINUX_BUILD diff --git a/output/Memory.xml b/output/Memory.xml index bba958a69..d39ba5400 100644 --- a/output/Memory.xml +++ b/output/Memory.xml @@ -210,6 +210,14 @@ ============ 0x18 0xC + Vector layout in MSVC 9: + DWORD Allocator + DWORD ? + DWORD ? + DWORD Start + DWORD End + DWORD AllocationEnd + 0x1C Position and window dimensions @@ -281,8 +289,27 @@ 0x6D0 0x770 + Materials + ========= + + +
0x16afcec
+
0x16afcec
+
0x16afd04
+
0x16afd1C
+
0x16afd34
+
0x16afd4C
+
0x16afd64
+
0x16afd7C
+
0x16AFD94
+
0x16AFDAC
+
0x16AFDC4
+
0x16AFDDC
+
0x16AFDF4
+
0x16AFE0C
+ + +