Description
Heya!
Since many hands make light work, I thought I'd share my first draft of reversing the NewAge LSMF format (Which I think stands for Larian Studios Metadata File).
It's a 010 Editor template, but it reads like C/C++ really.
struct Block0Header {
uint64 RelativeOffset;
uint64 BlockSize;
uint32 NameSize;
uint16 NumberOfNameIndexEntries;
byte Unknown1[10]<fgcolor=cRed>;
};
struct Block0Entry(uint64 namesPosition) {
uint64 Offset;
uint64 NameSize;
byte Unknown1[32]<fgcolor=cRed>;
local uint64 currentPosition = FTell();
FSeek(namesPosition + Offset);
char Name[NameSize];
FSeek(currentPosition);
};
struct Block0Body(Block0Header &header) {
local uint64 currentPosition = FTell();
local uint64 namesPosition = currentPosition + header.RelativeOffset;
FSeek(namesPosition + header.NameSize);
Block0Entry NameIndex(namesPosition)[block0Header.NumberOfNameIndexEntries]<optimize=false>;
FSeek(currentPosition);
};
struct Block1 {
local uint64 currentPosition = FTell();
byte Unknown1[8]<fgcolor=cRed>;
uint64 RelativeOffset;
byte Unknown2[8]<fgcolor=cRed>;
uint64 BlockSize;
byte Unknown3[8]<fgcolor=cRed>;
FSeek(currentPosition + RelativeOffset);
byte Unknown4[BlockSize-RelativeOffset];
};
struct LSMF {
char MagicHeader[4]<bgcolor=cLtGray>;
byte Unknown1[12]<fgcolor=cRed>;
Block0Header block0Header<bgcolor=cLtGray>;
Block0Body block0Body(block0Header)<bgcolor=cLtGray>;
Block1 block1<bgcolor=cLtGray>;
};
LSMF lsmf;
Obviously work in progress, but as this file gets shaped more and more, I reckon a lot of tech-savvy players can pitch in their thoughts on the unknown bits.
With this version, Block1 is still very WIP. Just by looking at the data, the current size seems alright. But I'm pretty sure it's not the full block size. As between the Block0 and Block 1, there is a chunk of space (about 1/4 of the NewAge data in size), that contains your character names (among other things). I'm pretty sure if we look for a similar string-lookup structure for Block0, that we will find pointers back to other parts in the file.
EDIT: By just looking at some of the data and recognizing certain structures from other games, I'm pretty sure there are is actually 3D model data in this file. Give-aways are usually the large repeated structures repeating the alphabet (IndexBuffer data). Like these: