Difference between revisions of "GSD"

From Inkscape Wiki
Jump to navigation Jump to search
Line 15: Line 15:


=== Footer ===
=== Footer ===
The footer is composed of several sections. A header portion, and several blocks of data. These blocks seem to be related to various configuration information, although the exact purpose is unknown. This is followed by a footer section of static length.
The footer is composed of blocks of data. Each block begins with a 2-byte code indicating the type of data, followed by 1 byte code indicating the datatype and a second 1 byte code indicating how many elements of data are stored.
====Header====
====Header====
54 bytes - unknown data
54 bytes - unknown data
Line 22: Line 22:
The first two bytes of the block provide information on the purpose of the block. The following 2 bytes indicate the type of data and the number of data elements of that type.
The first two bytes of the block provide information on the purpose of the block. The following 2 bytes indicate the type of data and the number of data elements of that type.
{| border="1" cellspacing="0" cellpadding="5" align="center"
{| border="1" cellspacing="0" cellpadding="5" align="center"
!Header  
!Header !!Description
!Description
|-
|-
|01
|00 ||1 byte of data stored in length byte
|1-byte data chunks
|-
|-
|02
|01 ||1-byte data chunks
|2-byte data chunks
|-
|-
|03
|01 ||1-byte data chunks
|4-byte data chunks
|-
|-
|05  
|02 ||2-byte data chunks
|ASCII data chunks
|-
|03 ||4-byte data chunks
|-
|05 ||ASCII data chunks
|}
|}


Line 47: Line 46:
|0x0208 ||05 ||13 ||"Graphtec Craft ROBO"
|0x0208 ||05 ||13 ||"Graphtec Craft ROBO"
|-
|-
|0x0408 ||05 ||06 ||"Letter" (or whatever)
|0x0408 ||05 ||06 ||"Letter" - Text Paper Size
|-
|-
|0x0508 ||03 ||02 ||56 54 00 00 24 6D 00 00 (unk)
|0x0508 ||03 ||02 ||56 54 00 00   24 6D 00 00
|-
|-
|0x1B08 ||01 ||01 ||00
|0x1B08 ||01 ||01 ||00
Line 100: Line 99:
|-
|-
|0x1408 ||03 ||01 ||00 00 00 00
|0x1408 ||03 ||01 ||00 00 00 00
|}
====Footer====
{| border="1" cellspacing="0" cellpadding="5" align="center"
!Length !!Description
|-
|0x34 bytes ||unknown
|-
|4 bytes ||unknown (00 0E 00 0A)
|-
|-
|5 bytes ||unknown (01 0E 01 01 01)
|0x0306 ||00 || ||00
|-
|-
|6 bytes ||unknown (02 0E 02 01 01 00)
|0x0009 ||00 || ||09
|-
|-
|5 bytes ||unknown (03 0E 02 01 01)
|0x0109 ||01 ||01 ||00
|-
|-
|1 byte ||use registration mark (bool)
|0x0209 ||01 ||01 ||05
|-
|-
|4 bytes ||unknown (0A 0E 04 01)
|0x0309 ||01 ||01 ||05
|-
|-
|8 bytes ||unknown dimension
|0x0409 ||01 ||01 ||00
|-
|-
|3 bytes ||unknown (0B 0E 02)
|0x0406 ||00 || ||00
|-
|-
|1 byte ||unknown (0x01)
|0x000A ||00 || ||0A
|-
|-
|8 bytes ||registration mark size
|0x010A ||03 ||01 ||00 00 00 00
|-
|-
|16 bytes ||unknown (0C 0E 03 01)
|0x020A ||00 || ||00
|-
|-
|8 bytes ||origin X
|0x000C ||00 || ||01
|-
|-
|4 bytes ||unknown (0D 0E 03 01)
|0x010C ||03 ||01 ||00 00 00 00
|-
|-
|8 bytes ||origin Y
|0x0506 ||00 || ||00
|-
|-
|3 bytes ||unknown (0E 0E 03)
|0x000E ||00 || ||0A
|-
|-
|1 byte ||show grid (boolean)
|0x010E ||01 ||01 ||01 - Show Registration Marks
|-
|-
|8 bytes ||Registration Mark distance 1-2
|0x020E ||02 ||01 ||01 00
|-
|-
|4 bytes ||unknown (0F 0E 03 01)
|0x030E ||02 ||01 ||01 00
|-
|-
|8 bytes ||Registration mark distance 1-3
|0x0A0E ||04 ||01 ||CD CC CC CC CC 0C 33 40 - Unknown Dimension
|-
|-
|5 bytes ||unknown (11 0E 01 01 00)
|0x0B0E ||02 ||01 ||A8 C6 4B 37 89 41 E0 3F - Unknown Dimension
|-
|-
|4 bytes ||unknown (06 06 00 00)
|0x0C0E ||03 ||01 ||66 66 66 66 66 66 29 40 - Unknown Dimension (0.5")
|-
|-
|4 bytes ||unknown (00 0F 00 04)
|0x0D0E ||03 ||01 ||52 B8 1E 85 EB 51 24 40 - Unknown Dimension
|-
|-
|4 bytes ||unknown (01 0F 01 01)
|0x0E0E ||03 ||01 ||01 00 00 00 00 D0 67 40 - Unknown Dimension
|-
|-
|1 byte ||unknown (00)
|0x0F0E ||03 ||01 ||48 E1 7A 14 AE 87 6E 40 - Unknown Dimension
|-
|-
|4 bytes ||unknown (02 0F 02 01)
|0x110E ||01 ||01 ||00
|-
|-
|2 bytes ||grid type(0=line, 1=dot)
|0x0606 ||00 || ||00
|-
|-
|4 bytes ||unknown (03 0F 04 01)
|0x000F ||00 || ||04
|-
|-
|8 bytes ||grid size
|0x010F ||01 ||01 ||00
|-
|-
|4 bytes ||unknown (04 0F 01 01)
|0x020F ||02 ||01 ||00 00
|-
|-
|1 byte ||snap to grid(bool)
|0x030F ||04 ||01 ||66 66 66 66 66 66 29 40 - Unknown Dimension
|-
|-
|8 bytes ||unknown (00 10 03 01 00 00 00 00)
|0x040F ||01 ||01 ||01
|-
|-
|<EOF>
|0x0010 ||03 ||01 ||00 00 00 00 - End of file?
|}
|}

Revision as of 17:54, 4 November 2009


The GSD binary file format

This is my first try to reverse engineer a binary file format. If you like, you could add your thoughts! By comparison between different files with the extention .gsd i try to see what data is stored where. It has some parts in ansi-text and the most parts are just binary numbers of different length. As identification, the file starts with the text "GRAPHTEC PRT&CUT". The next line at offset 0000:0010 starts with binary numbers "03 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00" (I don't know if they make any sense there).

  • From offset 0000:0080 to offset 0000:00cf is unknown binary data.
  • From offset 0000:00d3 to offset 0000:00de is binary data, which is exactly repeated from offset 0000:00fb to 0000:0107. It starts with the hex numbers 40 6a 40 which seems to be a marker for file seek. It ends with 40 00 04. Inbetween those bytes is data which funktion is still unknown.
  • Every object can have a different color in the 8bit-RGB-color-range. E.g. RGB(254,254,254), but most probably it is only black. RGB(0,0,0).
  • The size of the canvas is written in pure ansi text. The value could be "ISO A4" or "Letter".
  • The hex value 40 seems to be the delimiter between chunks of data of different length. Hex value ff ff ff semms to be a start delimiter and ff ff ff ff semms to be the end delimiter.

Footer

The footer is composed of blocks of data. Each block begins with a 2-byte code indicating the type of data, followed by 1 byte code indicating the datatype and a second 1 byte code indicating how many elements of data are stored.

Header

54 bytes - unknown data

Blocks

The first two bytes of the block provide information on the purpose of the block. The following 2 bytes indicate the type of data and the number of data elements of that type.

Header Description
00 1 byte of data stored in length byte
01 1-byte data chunks
01 1-byte data chunks
02 2-byte data chunks
03 4-byte data chunks
05 ASCII data chunks


Sample Block Data
Prefix Type Length Data
0x0108 05 13 "Graphtec Craft ROBO"
0x0208 05 13 "Graphtec Craft ROBO"
0x0408 05 06 "Letter" - Text Paper Size
0x0508 03 02 56 54 00 00 24 6D 00 00
0x1B08 01 01 00
0x2708 01 01 00
0x1A08 02 01 64 00
0x0908 01 01 00
0x0A08 03 01 00 00 00 00
0x0B08 03 01 00 00 00 00
0x0C08 01 01 00
0x0D08 03 01 00 00 00 00
0x2208 01 01 00
0x2008 01 01 00
0x2108 02 01 00 00
0x2308 02 01 01 00
0x2408 03 01 6F 08 00 00
0x2508 03 01 EA 0A 00 00
0x2608 02 01 01 00
0x0808 02 01 00 00
0x0E08 01 01 00
0x0F08 01 01 01
0x1008 03 01 00 00 00 00
0x1E08 01 01 01
0x1F08 01 01 01
0x1108 01 01 00
0x1C08 03 01 00 00 00 00
0x1D08 03 01 00 00 00 00
0x1408 03 01 00 00 00 00
0x0306 00 00
0x0009 00 09
0x0109 01 01 00
0x0209 01 01 05
0x0309 01 01 05
0x0409 01 01 00
0x0406 00 00
0x000A 00 0A
0x010A 03 01 00 00 00 00
0x020A 00 00
0x000C 00 01
0x010C 03 01 00 00 00 00
0x0506 00 00
0x000E 00 0A
0x010E 01 01 01 - Show Registration Marks
0x020E 02 01 01 00
0x030E 02 01 01 00
0x0A0E 04 01 CD CC CC CC CC 0C 33 40 - Unknown Dimension
0x0B0E 02 01 A8 C6 4B 37 89 41 E0 3F - Unknown Dimension
0x0C0E 03 01 66 66 66 66 66 66 29 40 - Unknown Dimension (0.5")
0x0D0E 03 01 52 B8 1E 85 EB 51 24 40 - Unknown Dimension
0x0E0E 03 01 01 00 00 00 00 D0 67 40 - Unknown Dimension
0x0F0E 03 01 48 E1 7A 14 AE 87 6E 40 - Unknown Dimension
0x110E 01 01 00
0x0606 00 00
0x000F 00 04
0x010F 01 01 00
0x020F 02 01 00 00
0x030F 04 01 66 66 66 66 66 66 29 40 - Unknown Dimension
0x040F 01 01 01
0x0010 03 01 00 00 00 00 - End of file?