SCPT file specification (version 5)
I was looking at the script files (header: SCPT, path: /resources/systemgenerated/compilednative/) and what a surprise, the format has completely changed since I posted the specification on page 1 of this thread.
The current version is now 5, compared to the old version 4 I wrote about.
It seems like the ELF script files have been abandoned and a custom script format is now used. The new script files start with
D1 03 but I have not looked into them very much. Anyway, here's the format of the new SCPT files, but without the last part that contains the script files:
File header:
0-3: 4 bytes, file header:
SCPT (
53 43 50 54)
4-7: file version as two 16-bit integers:
05 00 05 00 → version 5
8-11: Unknown 32-bit integer (little-endian), always 1:
01 00 00 00
12-15: four zero bytes:
00 00 00 00
16-21: six bytes, possibly a CRC checksum, different for each file
22-23: two bytes, end of header:
00 D0
Script Name:
24: Variable-length integer specifying length of script name (all version 5 files no longer contain a script name, i.e. this byte is always 00)
string with specified length, if it exists
25-32: eight zero bytes
33-36: 32-bit integer, length of file, offset starting after this length, excluding the final 00
Strings without id:
37: Variable-length integer specifying number of strings without an id
LOOP (for each string) {
→ Variable-length integer specifying string length
→ String with the specified length
} END LOOP
Strings with id:
Variable-length integer specifying number of strings with an id
LOOP (for each string) {
→ Variable-length integer specifying string id
→ Variable-length integer specifying string length
→ String with the specified length
} END LOOP
Script file:
Beginning of script file, starting with
D1 03
Final byte:
00
Example
For example, the script file
/resources/systemgenerated/compilednative/14988250124449474902 contains the following strings:
Strings without id: datecreated, datelastmodified, lastread, ticketstatus, summary, fulltickettext
Strings with id: MAX_UPDATE_LENGTH, SubmitNewTicket, UpdateTicketText, UpdateTicketRead, CloseTicket, OnRequestTicketsCB, _ParseTicketFields, OnRequestTicketCB, TrackLine, ConstructLookupListIterator, LookupListIteratorNext, PopUntilTemporaries, ConstructString, GetLookupListCurrentValueLookupList, PrepareLocalCall, UnprepareCall, RefLookupListElementROByStringString, ConvertFromStringInt, LookupListHasStringCopyValueString
It seems like the strings without id are just strings used by the script, while strings with id contain the function and variable names. However, I do not know enough about the script files to say this for sure.
Script file
As I said, I have not yet analysed the format of the script file; here are the starting bytes of one script files.
It seems like
D1,
D3 and bytes
00 to
06 are used very often.
Does anyone recognize this format by chance, or is it really a custom format?
D1 03 01 D1 00 02 D3 C9 09 C5 D3 05 D1 00 02 D3
D1 00 00 D3 D1 00 06 D3 D1 00 08 D1 00 02 D3 D1
00 08 D1 00 06 D3 D1 00 06 D3 D3 D3 D1 00 08 D1
00 06 D3 D1 00 06 D3 D3 06 02 00 01 04 02 03 00
01 04 00 04 02 02 00 01 04 00 02 00 01 04 03 08
00 01 04 04 03 00 03 00 03 00 03 02 03 02 03 02
03 00 01 04 00 04 04 01 06 04 01 00 00 00 00 00
00 C9 06 0F 01 00 03 01 10 C9 06 0F C3 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 83 EC 0C 8B
44 24 14 8B 00 89 44 24 04 8B 44 24 10 89 04 24
E8 FC FF FF FF 83 C4 0C C3 00 00 00 C3 00 00 00
Ñ..Ñ..ÓÉ.ÅÓ.Ñ..ÓÑ..ÓÑ..ÓÑ..Ñ..ÓÑ..Ñ..ÓÑ..ÓÓÓÑ..Ñ..ÓÑ..ÓÓ.........................................................É.......É..Ã...............ƒì.‹D$.‹.‰D$.‹D$.‰.$èüÿÿÿƒÄ.Ã...Ã...............ƒì.‹D$.‹.‹P.‹@.‰D$.‰T$.‰L$.‹D$.‰.$èüÿÿÿƒÄ.Ã.....Ã...............ƒì.‹D$.‹.‹@.‰D$.‰L$.‹D$.‰.$èüÿÿÿƒÄ.Ã............Ã...............ƒì.‹D$.‹.‹@.‰D$.‰L$.‹D$.‰.$èüÿÿÿƒÄ.Ã............USWVƒ