1BeIDE .prof project file format - a reverse engineering attempt
2
3This is based on Philippe Houdoin's previous work.
4
5Hierarchical tags format.
6Tag structure:
7
8```
9uint32  tag
10uint32  tag data size
11uint8   data[tag_data_size]
12
13(Values are big endian - always?)
14
15'MIDE'                                 = Metrowerks IDE top tag
16       uint32                          = sizeof of tag data
17       'DPrf'                          = Data project file? Define Prefs?
18               uint32                  = size of tag data
19               'PrEn'                  = Project/prefs encoding?
20                       uint32          = size of tag data (4)
21                       uint32          0xffffffff = ???
22               'PrVr'                  = Project/pref Version?
23                       uint32          = size of tag data (4)
24                       uint32          0x00000003 = ???
25               'Priv'                  = ???
26                       uint32          = size of tag data (8)
27                       uint32          0x00000007 = ???
28                       uint32          0x00000000 = ???
29               'DAcc'                  = ???
30                       uint32          = size of tag data (16 = 0x10)
31                       uint32          0x00000006 = ???
32                       uint32          0x00000000 = ???
33                       uint32          0x00000005 = ???
34                       uint32          0x00000002 = ??? (flags fields)
35               'SPth'                  = Search Paths tag (fixed tag size of 0x0108 = 264 bytes)
36                       uint32          = size of tag data (264 = 0x108)
37                       uint32          = Flags field ? (values seen so far: 0, 1 or 3)
38                       uint8           = boolean ??? (local or system? precompiled/cached?)
39                       uint8[259]      = path string
40               'PPth'                  = Project paths (reuse the same tag format above, see SPth tag)
41               'Trgg'                  = Table of build "Trigger" ? Tag data is n x 140 bytes
42record of bellow format:
43                       uint32          = size of tag data (n x 140 bytes)
44                               uint16          = build stage ? (ranging from 0-never, 1-preproc,
45                                                                2-compile, 3-link, 4-resource, ?=always)
46                               uint16          = build flags (0 ou 1 ou 4 + 2 + 1 = ?)
47                               uint8[8]        = file kind extension
48                               uint8[64]       = tool kind (gcc_link, gcc, rsrc ?)
49                               uint8[64]       = file kind mime type
50               'GPrf'                  = Global prefs ?
51                       uint32          = size of tag data
52                       'GenB'          = Generic block ?
53                               uint32          = size of tag data
54                               one single generic_block
55
56                               generic_block has the following structure:
57                                       uint32  = block group ID
58                                       uint32  = value size
59                                       string with zero ending = value name
60                                       uint32  = flags (1 = factory/default value?, 7 = custom ? To investigate)
61                                       uint8[value size - 4] = value
62
63                               List of generic blocks groups and names found so far:
64
65                               'MWPr'  = Metrowerks prefs ?
66                                       name = 'AppEditorPrefs', value = binary blob with colors, booleans, flags
67                               'cccg'  = C compiler config
68                                       name = 'gccCompilerOptions', value = gcc options string
69                                       name = 'gccLanguage', value = language number ?
70                                       name = 'gccCommonWarning', value = array of uint8 booleans ?
71                                       name = 'gccWarning', value = array of uint8 booleans ?
72                                       name = 'gccCodeGeneration', value = array of uint8 booleans ?
73                               'dlcg'  = dynamic linker config
74                                       name = 'gccLinkerOptions', value = gcc linker options string
75                                       name = 'AdditionalGCCLinkerOptions', value = additions linker options string
76                               'GNOL' = ??? (Globally needs object linking ?)
77                                       name = 'UpdateProject, value = uint32 (boolean?)
78                               'mwcx' = Metrowerks C++ ?
79                                       name = 'ProjectPrefsx86', value = binary blob with:
80                                               uint8[9] of flags & like...
81                                               uint8[64] = output file mime type (for setmime) (usually
82                                                           'application/x-vnd.Be-elfexecutable'!)
83                                               uint8[67 (!?)] = output file name
84                                               -> To investigate deeper
85                               'RsDt' = Resource Data config
86                                       name = 'ResData', value = array of uint8 booleans ?
87                               'mwcc' = Metrowerks C compiler
88                                       name = 'ProcessorPrefs', value = binary blob/array of booleans
89                                       name = 'XLanguagePrefs', value = binary blob/array of booleans
90                                       name = 'WarningsPrefs', value = binary blob/array of booleans
91                                       name = 'DisassemblerPrefs', value = ???
92                                       name = 'GlobalOpts', value = ???
93                               'mwld' = Metrowerks linker
94                                       name = 'LinkerPrefs', value = few array of booleans + 3 x
95                                               uint8[64), the symbol names of the
96                                               __start, _term_routine and _init_routine routines.
97                                       name = 'PEFPrefs', value = we don't care about PEF ;-)
98                                       name = 'ProjectNamePrefs', value =
99                                                       uint8[64] = Default output name string ('Application')
100                                                       SUBTYPE in big endian ('????')
101                                                       TYPE 'BAPP' in big endian
102                                                       uint8[64] = output mime type string
103                                                       (application/x-be-executable)
104                               'ShDt' = Shell Data
105                                       name = 'ShellData', value = shell string options (usually '-noprofile')
106                               'msan' = NASM config
107                                       name = 'NASMOptions', value = cryptic binary blob :-(
108
109       'Sect' = Section (Group section in project list)
110               uint32 = size of tag data (always 0x50 bytes long)
111               uint32 = nb items ('Link', 'PLnk', 'Fil1' or 'IgFl' tags) in this section
112               uint32[2] = flags ?
113               uint8 = ??? boolean ???
114               uint8[*] = Name of the section
115
116       'Link' = Link file
117               uint32 = size of tag data
118               uint32[6] = ???
119               One or more file (sub-)tag:
120
121               List of file sub-tags found so far:
122                       'Mime' = value = MIME type of the file (one per parent tag)
123                               uint32 = sizeof tag data
124                               uint32 = size of value = size of tag data - sizeof(uint32)
125                               uint8[size of value] = MIME type of the file
126                       'MSFl' = Master/Main/Module? Source File (one per parent tag)
127(either a library file, or a source file)
128                               uint32 = sizeof tag data
129                               uint32[2] = flags (to investigate)
130                               'Name'
131                               uint32 = sizeof 'Name' tag
132                               uint32 = sizeof 'Name' value
133                               uint8[size of 'Name' value] = File name (no path)
134                       'SrFl' = Source File dependencies ([0..n] tags after the 'MSFl' tag) (mostly, headers - presents in Fil1 parent tag)
135                               uint32 = sizeof tag data
136                               uint32[2] = flags (to investigate)
137                               'Name'
138                               uint32 = sizeof 'Name' tag
139                               uint32 = sizeof 'Name' value
140                               uint8[size of 'Name' value] = File name (no path)
141
142       'PLnk' = Post-Link file? (e.g. resource file)
143               Same structure as 'Link'
144       'Fil1' = One build file
145               Same structure as 'Link'
146       'IgFl' = Ignored File, for file user has added to project list for easy access but is not build (e.g. local headers)
147               Same structure as 'Link'. Note that the next 2 following uint32 (off 6) are then set to 0xFFFF each.
148       'Brws' = Source browser info
149               uint32 = size of tag
150               uint8[*]
151```
152
153More info can be found in proj2make source code at https://git.haiku-os.org/haiku/tree/3rdparty/proj2make.
154