Skip to content

Instantly share code, notes, and snippets.

@rindeal
Last active July 11, 2020 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rindeal/4daabb3bd0a5cd570528081ce8bee1ce to your computer and use it in GitHub Desktop.
Save rindeal/4daabb3bd0a5cd570528081ce8bee1ce to your computer and use it in GitHub Desktop.
Structure/format defintion of a .res file archive (`Geometry.res` and `Textures.res`) from the game "The I of The Dragon" for use in "Hex Editor Neo" software
#include <stddefs.h>
#pragma byte_order(LittleEndian)
#pragma pack(1)
struct String
{
uint32 len;
char str[len];
};
#pragma pack(1)
struct ResHeader
{
uint32 nrof_entries;
$assert(nrof_entries > 0);
};
struct ResEntryData;
#pragma pack(1)
struct ResEntry
{
String name;
uint32 offset as ResEntryData*;
uint32 size;
};
#pragma pack(16)
struct ResEntryData
{
BYTE data[size];
};
#pragma pack(1)
public struct ResFile
{
ResHeader header;
ResEntry entries[header.nrof_entries];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment