Added material addresses to veccheck and Memory.xml

develop
Petr Mrázek 2010-04-02 22:00:33 +02:00
parent c4ffb0d0b3
commit 5b8fa0ffa6
4 changed files with 47 additions and 16 deletions

@ -1079,8 +1079,8 @@ bool API::InitReadCreatures( uint32_t &numcreatures )
off.name_nickname_offset = minfo->getOffset("name_nickname"); off.name_nickname_offset = minfo->getOffset("name_nickname");
off.name_words_offset = minfo->getOffset("name_words"); off.name_words_offset = minfo->getOffset("name_words");
// HACK: vector correction // HACK: vector correction. No longer relevant.
off.vector_correct = minfo->getOffset("hacked_vector_start"); off.vector_correct = 0;
d->p_cre = new DfVector (d->p, off.creature_vector, 4); d->p_cre = new DfVector (d->p, off.creature_vector, 4);
d->creaturesInited = true; d->creaturesInited = true;

@ -33,7 +33,7 @@ DfVector::DfVector(Process * p, uint32_t address, uint32_t _item_size)
uint32_t triplet[3]; uint32_t triplet[3];
item_size = _item_size; item_size = _item_size;
memory_info * mem = p->getDescriptor(); 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); p->read(address + offs, sizeof(triplet), (uint8_t *) &triplet);
start = triplet[0]; start = triplet[0];

@ -64,29 +64,31 @@ int main (int numargs, const char ** args)
DFHack::memory_info* mem = DF.getMemoryInfo(); DFHack::memory_info* mem = DF.getMemoryInfo();
//const vector<string> * names = mem->getClassIDMapping(); //const vector<string> * 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 #ifndef LINUX_BUILD

@ -210,6 +210,14 @@
============ ============
<HexValue name="sizeof_vector">0x18</HexValue> <HexValue name="sizeof_vector">0x18</HexValue>
<Offset name="vector_triplet">0xC</Offset> <Offset name="vector_triplet">0xC</Offset>
Vector layout in MSVC 9:
DWORD Allocator
DWORD ?
DWORD ?
DWORD Start
DWORD End
DWORD AllocationEnd
<HexValue name="sizeof_string">0x1C</HexValue> <HexValue name="sizeof_string">0x1C</HexValue>
Position and window dimensions Position and window dimensions
@ -281,8 +289,27 @@
<Offset name="creature_artifact_name">0x6D0</Offset> <Offset name="creature_artifact_name">0x6D0</Offset>
<Offset name="creature_labors">0x770</Offset> <Offset name="creature_labors">0x770</Offset>
Materials
=========
<!-- Number vectors are vector <uint32_t> -->
<!-- Others are vector<object *> -->
<Address name="mat_system_start">0x16afcec</Address>
<Address name="mat_templates">0x16afcec</Address>
<Address name="mat_inorganics">0x16afd04</Address>
<Address name="mat_organics_all">0x16afd1C</Address>
<Address name="mat_organics_plants">0x16afd34</Address>
<Address name="mat_unk1_numbers">0x16afd4C</Address> <!-- maybe maps beween organics_all and organics_plants -->
<Address name="mat_organics_trees">0x16afd64</Address>
<Address name="mat_unk2_numbers">0x16afd7C</Address> <!-- maybe maps beween organics_all and organics_trees -->
<Address name="mat_body_material_templates">0x16AFD94</Address>
<Address name="mat_body_detail_plans">0x16AFDAC</Address>
<Address name="mat_bodies">0x16AFDC4</Address>
<Address name="mat_bodygloss">0x16AFDDC</Address>
<Address name="mat_creature_variations">0x16AFDF4</Address>
<Address name="mat_creature_types">0x16AFE0C</Address>
<!-- <!--
addresses from belal: vectors might need 8 subtracted from addresses from belal: vectors might need 8 subtracted from them
buildings 0x0166f9a8 buildings 0x0166f9a8
constructions 0xffffffff constructions 0xffffffff
creatures 0x0166eccc creatures 0x0166eccc
@ -372,3 +399,5 @@
<!-- Windows logo by Microsoft --> <!-- Windows logo by Microsoft -->
</MemoryDescriptors> </MemoryDescriptors>
</DFExtractor> </DFExtractor>