You are on page 1of 10

GM8 EXE Format v1.

2 - Zach, original by Charlie This document loosely follows IsmAvatar's documenting style, mostly because my t ypical documentation style doesn't work well with GM formats, seeing as how it expects the format to not be completely fucked. Note that many of the structures in the EXE follow closely to the GMK format. Also note that types such as timestamps, booleans, doubles, etc use the same for mat as the GMK. Refer to IsmAvatar's GMK documentation for more detail. Comments will be inside of brackets, [ ] GMK Format (>=v5.3a): http://www.ismavatar.com/lgm/formats/gmformat8.txt Please let me know if you find any errors or can fill in an unknown field. Cheers, Zach. --- Main Format --0 4b Magic 4 4b Version 8 4b Debug flag 0 4b Version [ Settings ] 4 4b LenOfData 0 4b LenOfStr [ DX8 Wrapper ] 4 4b LenOfData

{ Compressed <Settings> } { String } { Compressed <d3dx8.dll> }

0 4b NumberOfDwords [ d1 ] 4 4b NumberOfDwords [ d2 ] 8 ?b Junk size of d1 * 4 0 512b Swap Table 0 ?b Junk size of d2 * 4 0 4b LenOfData { Data } [ Encrypted ] { 0 4b NumberOfDwords [ d3 ] 4 4b Junk size of d3 * 4 0 4b Pro 4 4b GameID 8 16b Unknown 18 4b Version [ Extensions ] 1C 4b ExtensionCount For ExtensionCount {

<Extension> } 0 4b Version [ Triggers ] 4 4b TriggerCount For TriggerCount { 0 4b LenOfData { Compressed <Trigger> } } 0 4b Version [ Constants ] 4 4b ConstantCount For ConstantCount { <Constant> } <Sounds, Sprites, Backgrounds, Paths, Scripts, Fonts, TimeLines, Objects, Rooms> 0 4b Version 4 4b Count For Count { 0 4b LenOfData { Compressed data } } 0 4b ID of last object placed 4 4b ID of last tile placed 0 4b Version [ Includes ] 4 4b IncludeCount For IncludeCount { 0 4b LenOfData { Compressed <Include> } } 0 4b Version [ Help ] 4 4b LenOfData { Compressed <Help> } 0 4b Version [ Library Init Code ] 4 4b Count For Count { 0 4b LenOfString { String } } 0 4b Version [ Room order ] 4 4b Count For Count { 0 4b RoomID } <More junk> } <End Of File> --- Resource Formats ---

<Settings> 0 4 8 C 10 14 18 1C 20 24 28 2C 30 34 38 3C 40 44 48 4C 50 54 58

{ 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b

Full screen Interpolate colors No border around window Show cursor Scale Resizable Always on top Color outside room Set resolution/refresh rate/bit depth Bit depth option Resolution option Refresh rate option No buttons in window caption Use vsync to avoid tearing Disable screensavers F4 changes to fullscreen F1 shows info Esc closes game F5 and F6 save and load respectively F9 takes a screenshot Close button treated as Esc Priority Freeze on loss of focus

5C 4b ShowBar If ShowBar { 60 4b ProgressBack Present If Present { 64 4b LenOfData { Compressed <Bitmap> } } 0 4b ProgessFore Present If Present { 4 4b LenOfData { Compressed <Bitmap> } } } 0 4b Background Present If Presents { 4 4b LenOfData { Compressed <Bitmap> } } 0 4 8 C 10 14 18 } <Extension> { 0 4b Version 4 4b Length { String <Name> } 0 4b Length { String <TempName> } 0 4b Count For Count { 0 4b Version 4 4b Length { String <Filename> } 4b 4b 4b 4b 4b 4b 4b Loading screen is translucent Loading screen translucency Scale progress bar indicator Show errors Log errors Errors are all fatal Treat uninitialized vars as 0

0 4b Type LL, Lib, Other ] 4 4b Length 0 4b Length 0 4b Count* For Count { 0 4b 4 4b 0 4b 0 4b 13 = cdecl ] 4 4b Internal ID? 8 4b ArgumentCount For ArgumentCount { 0 4b ArgumentKind } 0 4b ConstantCount For ConstantCount { 0 4b Version 4 4b Length 0 4b Length } } { String <InitializationCode> } { String <FinalizationCode> }

[ GML, D

Version Length { String <Name> } Length { String <ExternalName> } CallType [ 2 = GML, 12 = stdcall, [ Starts at 0x100 ] [ 1 = String, 2 = Real ]

{ String <Name> } { String <Value> }

[ Note: This section is a bit odd, Mark flip-flops standards here a whole lot, sorry :/ ] 0 4b LenOfData { <Data> } { 0 4b Seed [ Signed ] Encrypted { [ Length = CurPo s - ExtensionSize ] For Count* { [ Count = Count* ? Not sure ] 0 4b LenOfData { Compressed <File> } } } } } } <Trigger> { 0 4b Exists If Exists { 4 4b 8 4b 0 4b 4 4b 8 4b } } <Constant> { 0 4b Length 0 4b Length } <Sound> { 0 4b Exists

Version Length { String <Name> } Length { String <Condition> } When to execute Length { String <ConstantName> }

{ String <Name> } { String <Value> }

If Exists { 0 4b Length { String <Name> } 0 4b Version 4 4b Kind 8 4b Length { String <Filetype (".wav")> } 0 4b Length { String <Filename ("sound.wav")> } 0 4b Exists If Exists { 0 4b Length { <File> } } 0 4 C 14 } } <Sprite> { 0 4b Exists If Exists { 0 4b Length { String <Name> } 0 4b Version 4 4b X-Origin 8 4b Y-Origin [ Note: Again, this section is a little strange, I didn't even n otice that the If {} condition existed until Goomba Online sto pped decompiling at random, turns out spr_blank, which had no frames was causing it. ] C 4b NumberOfFrames* If NumberOfFrames > 0 { For NumberOfFrames { 0 4b Version 4 4b Width 8 4b Height C 4b LenOfData { <Raw RGBA> } } 0 4b Separate Collision Mask If SepCollMask { For NumberOfFrames* { 0 4b Version 4 4b Width 8 4b Height C 4b Left 10 4b Right 14 4b Bottom 18 4b Top [ Note: If you find a 1 in the following array then "precise collision checking" wil l be ticked. ] For Width * Height { 0 4b Mask data } 4b 8b 8b 4b Effects Volume Pan Preload

} } else { 0 4 8 C 10 14 18 hen "precise collision checking" wil l be ticked. ] For Width * Height { 0 4b Mask data } } } } } <Background> { 0 4b Exists If Exists { 4 4b Length { String <Name> } 0 4b Version [ Note: I believe that Mark once had tileset information that ha s since been removed in GM8, this may explain why there are two versions here . ] 0 4 8 If } } } <Path> { 0 4b Exists If Exists { 4 4b Length { String <Name> } 0 4b Version 4 4b Connection type 8 4b Closed C 4b Precision 10 4b Count For Count { 0 8b X 8 8b Y 10 8b Speed } } } <Script> { 4b Version 4b Width 4b Height Width != 0 && Height != 0 { 0 4b Length { <Raw RGBA> } 4b 4b 4b 4b 4b 4b 4b Version Width Height Left Right Bottom Top

[ Note: If you find a 1 in the following array t

0 4b Exists If Exists { 4 4b Length 0 4b Version 4 4b Length } } <Font> {

{ String <Name> } { String <Script> }

0 4b Exists If Exists { 4 4b Length { String <Name> } 0 4b Version 4 4b Length { String <FontName> } 0 4b Font size 4 4b Bold 8 4b Italic C 4b Range start 10 4b Range end 14 1808b Unknown 61C 4b Length { <Unknown data> } } } <Actions*> { umenting ] 0 4b Version 4 4b ActionCount For ActionCount { 0 4b Version 4 4b LibID 8 4b ActionID C 4b Action kind 10 4b May be relative 14 4b Question 18 4b Applies to something 1C 4b Type 20 4b Length { String <Name> } 0 4b Length { String <Code> }

[ Kerning? ] [ Font header? ]

[ Here to prevent re-doc

0 4b Arguments actually used 4 4b Total number of arguments (always 8) For 8 { 0 4b Argument kind } 0 4b Applies to ObjectIndex 4 4b Relative 8 4b Number of arguments (always 8) For 8 { 0 4b Length { String <Argument> } } 0 4b Not flag } } <TimeLine> { 0 4b Exists

If Exists { 4 4b Length { String <Name> } 0 4b Version 4 4b MomentCount For MomentCount { 0 4b Moment position <Actions*> } } } <Object> { 0 4b Exists If Exists { 0 4b 0 4b 4 4b 8 4b C 4b 10 4b 14 4b 18 4b 1C 4b

[ Documented above ]

Length { String <Name> } Version SpriteIndex Solid Visible Depth Persistent Parent ObjectIndex Mask SpriteIndex

[ -1 = None ]

[ Note: I would check out LGM's SVN and the GMK documentation provided by IsmAvatar for this section, it's very, very, very, very, very, very fucked. She explains it much bett er than I. ] [ Unknown reason ] 20 4b Number of events - 1 For 12 { Until EventNumber == -1 { 0 4b EventNumber If EventNumber >= 0 { <Actions*> } } 0 4b -1 vent ] } } } <Room> { 0 4b Exists If Exists { 0 4b 0 4b 4 4b 0 4b 4 4b 8 4b C 4b 10 4b 14 4b 1C 4b Length { String <Name> } Version Length { String <Room caption> } Width Height Speed Persistent BG Color Draw BG Color Length { String <Creation Code> }

[ Marks end of primary e

0 4b Number of backgrounds (Always 8)

For 8 { 0 4 8 C 10 14 18 1C 20 24 } 0 4b Enable views 4 4b Number of views (Always 8) For 8 { 0 4b Visible 4 4b View X 8 4b View Y C 4b View Width 10 4b View Height 14 4b Port X 18 4b Port Y 1C 4b Port Width 20 4b Port Height 24 4b Horizontal border 28 4b Vertical border 2C 4b Horizontal speed 30 4b Vertical speed 34 4b Following ObjectIndex } 0 4b Number of instances For NumberOfInstances { 0 4b X 4 4b Y 8 4b ObjectIndex C 4b ID 10 4b Length { String <Creation Code> } } 0 4b Number of tiles { 0 4b X 4 4b Y 8 4b BackgroundIndex C 4b Tile X 10 4b Tile Y 14 4b Width 18 4b Height 1C 4b Layer 20 4b ID } } } <Include> { 0 4b 4 4b 0 4b 0 4b Version Length { String <Filename> } Length { String <Original filename> } Original file chosen 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b Visible Foreground BackgroundIndex X Y Tile horizontal Tile vertical Horizontal speed Vertical speed Stretch

4 4b Original file size 8 4b Store in GMK If OriginalFileChosen && StoreInGMK { 0 4b Length { File } } 0 4 0 4 8 } <Help> { 0 4 8 0 4 8 C 10 14 18 1C 20 } 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b 4b BG Color Show in separate window Length { String <Window caption> } Left Top Width Height Show border Allow player to resize Stay on top Freeze game while help form is in focus Length { String <Game Information> } 4b 4b 4b 4b 4b Export Length { String <Folder to export to> } Overwrite Free memory Remove at end of game

You might also like