Skip to content

Instantly share code, notes, and snippets.

@zsennenga
Last active December 23, 2018 10:03
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 zsennenga/438c05aeb23195f1c3d7762ab8ab6f64 to your computer and use it in GitHub Desktop.
Save zsennenga/438c05aeb23195f1c3d7762ab8ab6f64 to your computer and use it in GitHub Desktop.
Struct(
"signature" / Const(b"MT\xbe\xef"),
"unknown_const_256" / Const(256, Int16ul) * "Probably part of the signature",
"width" / Int16ul,
"unknown_1" / Int16ul,
"height" / Int16ul * "Seems to be decreased by 1 when using the standard builder. Bug?",
"color_count" / Const(16, Int16ul),
"palette_and_image_size" / Int16ul * "This seems to be unused - and it bugs out with larger images. You can easily exceed a short, even with the default generator",
"unknown_2" / Int16ul,
"unknown_3" / Int16ul,
"unknown_4" / Int16ul,
"unknown_5" / Int16ul,
"palette" / Array(
16,
Struct(
"R" / Int8ul,
"G" / Int8ul,
"B" / Int8ul,
)
) * "Identical to a standard bitmap palette, except for the order of the pixels",
"pixels" / GreedyRange(Int16ul)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment