How do I endian swap the memory? Is it as simple as swapping every 4 bytes – or is the internal structure more complicated? Also as the TOME_PTR returned is the interface to cpp call members – doesn’t it need an address fixup?
You can indeed just treat the tome data as an array of dwords and swap every dword item. You will probably want to do this upon saving the tome data, separately for little-endian and big-endian target but you can just as well do it upon load. There’s also static swapEndianness() that does the swap for you.
A safer method than just blindly casting the data is to call static Tome::init that will do the cast for you, and make sure the data looks ok. The Tome class has no virtual methods so address fixup is not needed.