1 2// "what" code should default to 0. 3resource(401) message { "field1" = "value1" }; 4 5// Fields with casts, type codes, and nested compound data. 6resource(402) message(1000) 7{ 8 "small1" = (int8) 257, // 1 9 int8 "small2" = 257, // 1 10 int8 "small3" = (int8) 257, // 1 11 uint8 "small4" = (int8) -1, // (uint8)255 12 int8 "small5" = (uint8) -1, // -1 13 int8 "small6" = (int8) -1, // -1 14 uint8 "small7" = (uint8) -1, // (uint8)255 15 16 "large1" = (int64) 3, 17 int64 "large2" = 3, 18 int64 "large3" = (int32) 3, 19 int32 "large4" = (int64) 3, 20 21 "string1" = "some text", 22// string "string2" = 123, // invalid cast 23// int32 "string3" = "text", // invalid cast 24 25 #'BYTE' "typecode1" = 1234, // does not become "(int8)-46" 26 #'blah' int16 "typecode2" = 1234, // becomes 16-bit, but raw encoded 27 28 "array1" = array { $"40", $"41" }, 29 buffer "array2" = array { $"50" $"51" }, 30 raw "array3" = array { "w00t", "dude" }, 31 array "array4" = array { "w00t", 1234 }, 32 array "array5" = (array) array { "w00t", 1234 }, 33 //raw "array3" = { "w00t", "dude" }, // syntax error 34 35 "msg1" = message { "field" = "value" }, 36 message "msg2" = message(2000) { "field" = "value" }, 37 message "msg3" = (message) message(2000) { "field" = "value" }, 38 #'blah' message "msg4" = message { "field" = "value" } 39// ,message(2000) "msg5" = message(2000) { "fld" = "val" } // not supported 40}; 41 42// "Arrays" of fields, i.e. multiple fields with the same name. 43resource(403) message('blah') 44{ 45 "integer" = 1, 46 "integer" = 3, 47 "integer" = 2 48// ,"integer" = "hi there" // type conflict 49}; 50 51// Tests whether the decompiler correctly outputs nested messages. 52resource(404) message('blah') 53{ 54 "sub1" = message('bla1') { "string1" = "value1" }, 55 "sub1" = message('bla2') { "string2" = "value2" }, 56 "sub1" = message('bla2') { "string2" = "value2", "string3" = "value3" }, 57 "SomeField" = 2, 58 "sub2" = message('bla3') { "string3" = "value3" } 59}; 60 61// Another comma test for the decompiler. 62resource(405) #'w00t' message('blah') 63{ 64 "integer1" = 1, 65 "sub" = message { "string1" = "woot1" }, 66 "integer2" = 2 67}; 68 69// The decompiler should still recognize this as a message. 70resource(406) #'RAWT' message { "field" = "value" }; 71 72//resource(407) (int32) message { "field" = "value" }; // invalid cast 73//resource(407) (buffer) message { "field" = "value" }; // invalid cast 74 75// beres allows you to specify a what code inside the cast, 76// but we don't (beres ignores it anyway): 77//resource(407) (message('blah')) message { "field" = "value"; } 78 79// Decompiler turns the very long string into an array. 80resource(408) message 81{ 82 "longstring" = "alongstring-alongstringg\000-alongstringg-alongstringg-alongstringgalongstringg-alongstringg-alongstringg-alongstringg-alongstring", 83 "longarray" = array { $"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabb" }, 84 #'blah' "longblah" = array { $"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabb" }, 85 "textarray" = array { "pompiedom" } 86}; 87 88// Note: negative "what" values are allowed, but the decompiler converts 89// them to unsigned, just like type codes (which cannot be negative). 90resource(409) message(-1) { "field" = "value" }; 91resource(410) message(0x80000000) { "field" = "value" }; 92resource(411) message(0x7FFFFFFF) { "field" = "value" }; 93resource(412) message(-100001) { "field" = "value" }; 94resource(413) #100001 message(-100001) { "field" = "value" }; 95//resource(414) #-100001 message { "f" = "v" }; // syntax error 96 97resource(415) message { }; 98resource(416) message; 99resource(417) message('blah') { }; 100resource(418) message('blah'); 101 102// Decompiles to an empty message. 103resource(419) $"31424F460100001212000000000000000100"; 104 105resource(420) message('blah') { 106 "sub" = message('bla1') { "string1" = "woot1" }, 107 "sub" = message('bla2') { "string2" = "woot2" }, 108 int8 "small integer" = 1, 109 "integer" = 2, 110 "integer" = 3, 111 "large integer" = (int64)3, 112 "string" = "some text", 113 "sub2" = message('bla3') { "string3" = "woot3" } 114}; 115 116resource(421) #'w00t' message('blah') { 117 "integer1" = 1, 118 "sub" = message('bla1') { "string1" = "woot1" }, 119 "integer2" = 2 120}; 121 122//------------------------------------------------------------------------------ 123 124resource(701) #'BBMP' archive BSomeClass { "data" = 123 }; 125resource(702) archive BSomeClass { "data" = 123 }; 126resource(703) archive("dynamic", 'blah') BSomeClass { "data" = 123 }; 127resource(704) archive("dynamic") BSomeClass { "data" = 123 }; 128resource(705) archive(, 200) BSomeClass { "data" = 123 }; 129resource(706) (archive BSomeClass) archive BSomeClass { "data" = 123 }; 130resource(707) archive(, -1) BSomeClass { "data" = 123 }; 131resource(700) archive BSomeClass { "" = $"" }; // empty archive trick 132 133// When you cast an archive to a message, beres strips the 134// "class" field from the message (so it will no longer be 135// recognized as an archive), but we don't. 136resource(708) (message) archive BSomeClass { "data" = 123 }; 137 138// beres allows you to specify the add_on name and what code 139// inside the cast, but we don't (beres ignores it anyway). 140//resource(709) (archive("t", 1) BSomeClass) archive BSomeClass { "d" = 123 }; 141 142//resource(709) (archive) archive BSomeClass { "d" = 123 }; // syntax error 143//resource(709) archive("dynamic",) BSomeClass { "d" = 123 }; // syntax error 144 145//------------------------------------------------------------------------------ 146 147enum { 148 R_BBMP_kLargeNewGroupIcon = 516, 149 R_BBMP_kSmallNewGroupIcon = 517, 150}; 151 152resource(R_BBMP_kLargeNewGroupIcon) #'BBMP' archive BBitmap { 153 "_frame" = rect { 0.0, 0.0, 31.0, 31.0 }, 154 "_cspace" = 4, 155 "_bmflags" = 1, 156 "_rowbytes" = 32, 157 "_data" = array { 158 $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 159 $"FFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 160 $"FFFFFFFFFFFFFFFF00FAFA0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 161 $"FFFFFFFFFFFFFFFF00FAF8FAFA0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 162 $"FFFFFFFFFFFF000000FAF8F8F8FAFA0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 163 $"FFFFFFFFFF00FAFA0000F8F8F8F8F8FAFA00FFFFFFFFFFFFFFFFFFFFFFFFFFFF" 164 $"FFFFFFFFFF00FAF8FAFA0000F8F8F8F8F800FFFFFFFFFFFFFFFFFFFFFFFFFFFF" 165 $"FFFFFFFFFF00FAF8F8F8FAFA0000F8F8F800FFFFFFFFFFFFFFFFFFFFFFFFFFFF" 166 $"FFFFFFFFFF00FAF8F8F8F8F8FAFA00F8F80000FFFFFFFFFFFFFFFFFFFFFFFFFF" 167 $"FFFFFFFFFF001BF8F8F8F8F8F8F8000E0F1C1C0000FFFFFFFFFFFFFFFFFFFFFF" 168 $"FFFFFFFFFF001B0F0F0FF8F8F8F8003F3F0E0F1C1C0000FFFFFFFFFFFFFFFFFF" 169 $"FFFFFFFFFF001B0F3F3F0E0FF8F800003F3F3F0E0F1C1C0000FFFFFFFFFFFFFF" 170 $"FFFFFFFFFF001B0F3F3F3F3F0E0F1C1C00003F3F3F0E0F1A190000FFFFFFFFFF" 171 $"FFFFFFFFFF001B0F3F3F3F3F3F3F0E0F1C1C00003F3F3F0E1A1900FFFFFFFFFF" 172 $"FFFFFFFFFF001B0F3F3F3F3F3F3F3F3F0E0F1C1C00003F3F171900FFFFFFFFFF" 173 $"FFFFFFFFFF001B0F3F3F3F3F3F3F3F3F3F3F0E0F1A190000171900FFFFFFFFFF" 174 $"FFFFFFFFFF001B0F3F3F3F3F3F3F3F3F3F3F3F3F0E1A1900171900FFFFFFFFFF" 175 $"FFFFFFFFFF001B0F3F3F3F3F3F3F3F3F3F3F3F3F3F171900171900FFFFFFFFFF" 176 $"FFFFFFFFFF001B0F3F3F3F3F3F3F3F3F3F3F3F3F3F171900171900FFFFFFFFFF" 177 $"FFFFFFFFFF001B0F3F3F3F3F3F3F3F3F3F3F3F3F3F171900171900FFFFFFFFFF" 178 $"FFFFFFFFFF001B183F3F3F3F3F3F3F3F3F3F3F3F3F171900171900FFFFFFFFFF" 179 $"FFFFFFFFFF001B1C17183F3F3F3F3F3F3F3F3F3F3F171900171900FFFFFFFFFF" 180 $"FFFFFFFFFFFF00001B1C17183F3F3F3F3F3F3F3F3F171900171900FFFFFFFFFF" 181 $"FFFFFFFFFFFFFFFF0000191A17173F3F3F3F3F3F3F171900171900FFFFFFFFFF" 182 $"FFFFFFFFFFFFFFFFFFFF0000191A17173F3F3F3F3F171900171A00FFFFFFFFFF" 183 $"FFFFFFFFFFFFFFFFFFFFFFFF0000191A17173F3F3F1719001A1900FFFFFFFFFF" 184 $"FFFFFFFFFFFFFFFFFFFFFFFFFFFF0000191A17173F171900001900FFFFFFFFFF" 185 $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000191A17171A00FF0000FFFFFFFFFF" 186 $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000191A1900FFFFFFFFFFFFFFFF" 187 $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00001900FFFFFFFFFFFFFFFF" 188 $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFF" 189 $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 190 } 191}; 192 193resource(R_BBMP_kSmallNewGroupIcon) #'BBMP' archive BBitmap { 194 "_frame" = rect { 0.0, 0.0, 15.0, 15.0 }, 195 "_cspace" = 4, 196 "_bmflags" = 1, 197 "_rowbytes" = 16, 198 "_data" = array { 199 $"FFFFFFFF0E0EFFFFFFFFFFFFFFFFFFFFFFFFFF0EFAFA0E0EFFFFFFFFFFFFFFFF" 200 $"FFFF0E0EF8F8FAFA0EFFFFFFFFFFFFFFFFFF0EFAFA0EF8F80EFFFFFFFFFFFFFF" 201 $"FFFF0EF8F8FAFA0E0E0EFFFFFFFFFFFFFFFF0E1818F8F80E3F3F0E0EFFFFFFFF" 202 $"FFFF0E183F18180F0F3F3F0E12FFFFFFFFFF0E183F3F3F18180F0F0E12FFFFFF" 203 $"FFFF0E183F3F3F3F3F18180E12FFFFFFFFFF0E183F3F3F3F3F3F1C0E12FFFFFF" 204 $"FFFF0E0E181C3F3F3F3F1C0E12FFFFFFFFFFFFFF0E0E171C3F3F1C0E12FFFFFF" 205 $"FFFFFFFFFFFF0E0E171C1C0E12FFFFFFFFFFFFFFFFFFFFFF0E0E170E12FFFFFF" 206 $"FFFFFFFFFFFFFFFFFFFF0E0EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 207 } 208}; 209