Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XFL - What are the ./bin/*.dat files?

Uncompressed Adobe's Flash XFL format still keeps a lot of content compressed. Does anybody know specification of these binary *.dat files?

like image 737
Oldes Avatar asked Nov 02 '10 22:11

Oldes


1 Answers

The *.dat files stores various type of media content. What I can say so far is, that:

  1. images are stored as JPEGs without additional info. That means just renaming *.dat is enough to get the original image. Such a files starts with #{FFD8}
  2. images are stored in some internal RAW format. Using reverse engineering I can say that for example bitmap with raw pixel data #{FFFFFFFF} (1x1) is stored as:
0305     ;raw bitmap identifier?
0400     ;length of decompressed row data
0100     ;width
0100     ;height
00000000 ;unknown
14000000 ;width in twips
00000000 ;unknown
14000000 ;height in twips
00       ;some flags - 01=image has transparency

variant 1.:
01       ;compressed data flag
0200     ;length of compressed chunk
7801     ;compressed chunk
0A00     ;length of compressed chunk
FBFFFFFF7F0009FA03FD ;compressed chunk
0000     ;end of compressed stream

variant 2.:
00       ;data are uncompressed
00000000
00000000 ;unknown data - always zero?
FFFFFFFF ;raw uncompressed ARGB data

where the decompressed data are pixels with storage type: ARGB, so with the size info it should be enough to get the image from it. It's using ZLIB compression (www.zlib.net) Flash is using compression level 1, but it's possible to use any level (but it's not necessary as the sources are normally compressed altogether.

  1. SOUNDS are stored in DAT files in RAW format, it's possible to make WAV files from it easily using the information from the DOMSoundItem.
  2. The rest is unknown yet.

The rest of the *.dat types is unknown yet.

The name of the DAT files is important as well! Flash somehow gets numbers from the name, using name like checksum in hexadecimal form (9BB551621D3E2138FECA2F04469531D7.dat) crashes Flash! Using chars like [_.-] will cause the content unloadable as well (but not crash)

like image 158
Oldes Avatar answered Oct 03 '22 19:10

Oldes