Probably because I decided to do it empirically instead of systematically reversing the material subsystem. I'll take a look when I have a bit of free time. Also I didn't realize the item module is to be dumped, why is that ? Because of the hackish nature of the accessors decoding "system" ?
The accessor decoding worked great.. the problem with the module is that it only works(worked) on windows.
I'm torn, because Dwarf Fortress itself has to switch on each item's type to really understand it. The thing is, because Dwarf Fortress uses that switch it already has the types. So for us to properly understand items we too have to switch on each type anyway, so what to do?
EDIT:
This seems to work and has show then right material types for all the items I have ran across in .13.
const uint32_t vtable = p->readDWord(items[i]);
const std::string className = p->readClassName(vtable);
const uint32_t type = p->readWord(p->readDWord(vtable)) >> 8;
const uint32_t matoff = p->readDWord(p->readDWord(vtable+8)) >> 24 ;
const int16_t typeC = p->readWord(items[i]+matoff);
const int32_t typeD = p->readDWord(items[i]+matoff+(matoff % 4 ? 2:4)); // faster to grab the next aligned byte than read the vtable more
If someone can show me one it doesn't work on, that would be great.