SOL

From Gnash Project Wiki

Jump to: navigation, search

Shared Object Files

A .sol file is how Shared Objects in AMF format are stored on disk so they can be accessed by multiple swf applications. All .sol files start with the magic number (in big-endian format) of 0x00bf. This is followed by the length in bytes of the AMF objects in the file. The next 10 bytes never change in any of the sample .sol files I've analyzed, and I have no idea what they actually represent, so we just ignore them when reading, and write the identical values back out when writing to disk.

Following this is the length in bytes of the object name, followed by the name itself in ASCII. Thre header part is then terminated with 4 0 bytes. After this is a list of ["AMF Variables"] till the end of the file.

  • Magic Number - 2 bytes (always 0x00bf)
  • Length - 4 bytes (the length of the file including the Marker bytes)
  • Marker - 10 bytes (always "TCSO0x000400000000")
  • Object Name - variable (the name of the object as an AMF encoded string)
  • Padding - 4 bytes

A file then looks roughly like this:

[magic | AMF length | ID? | name length | name | padding | AMF object1 | AMF object2 | ...]

Here's a hex dump of a .sol file called "string", that encodes a basic AMF string object.

00 bf 00 00 00 3d 54 43 53 4f 00 04 00 00 00 00
00 06 73 74 72 69 6e 67 00 00 00 00 00 0a 54 65
73 74 53 74 72 69 6e 67 02 00 17 74 65 73 74 69
6e 67 2c 20 31 2d 32 2d 33 2c 20 74 65 73 74 69
6e 67 00 00 05 09

Here is the same dump with the strings converted.

00 bf 00 00 00 3d T C S O 00 04 00 00 00 00
00 06 s t r i n g 00 00 00 00 00 0a T e
s t S t r i n g 02 00 17 t e s t i
n g , 1 - 2 - 3 , t e s t i
n g 00 00 05 09