display-name: "Earthworm Jim"

if (file.name == "emj1.dat")
{
	at file.size - 4:
	unsigned32 fat-offset

	at file.position - fat-offset - 4:
	unsigned32 magic == 0x317ED093

	unsigned32 count
	count = count + 1

	index: [](count)
	length1: [](count)
	length2: [](count)
	flags: [](count)
	offsets: [](count)
	names: [](count)

	loop(count): i
	{
		unsigned16 this-index
		index[i] = this-index

		unsigned16 this-length-1
		length1[i] = this-length-1

		unsigned16 this-length-2
		length1[i] = this-length-2

		unsigned16 this-flags
		flags[i] = this-flags
	}

	unsigned32 offsets-count

	loop(offsets-count / 4): i
	{
		unsigned32 this-offset
		offsets[i] = this-offset
	}

	file [count]: i
	{
		name: index[i] + ", " + length1[i] + ", " + length2[i] + ", " + flags[i]
		offset: 0
		size: 0
	}
}