ADF

From GTAMods Wiki
Revision as of 06:16, 4 December 2011 by Spaceeinstein (talk | contribs) (examples and links)
Jump to navigation Jump to search

The ADF file format is used for the radio stations in Vice City. It is equal to a raw MP3 file with no ID3 tag (though a tag will likely be ignored) with a very simple encryption: every byte should be XOR-ed against the value 0x22.

Example

This is an example of performing a XOR operation on a byte within a file. The first byte in an ADF file is 0xDD. In binary, that would be 0b11011101. Perform a XOR on that against the value 0x22, which is 0b100010 in binary. If the digit in 0xDD corresponds to 0x22's digit "1", then switch the digit to its opposite. If the digit in 0xDD corresponds to 0x22's digit "0", then leave the digit alone. The result would be 0b11111111, which is 0xFF.

0xDD 0b11011101
0x22 0b00100010
     0b11111111 = 0xFF

Another example, performing a XOR on 0x10 against 0x22:

0x10 0b00010000
0x22 0b00100010
     0b00110010 = 0x32

When this is done to every byte within the ADF file, the file will result in a file that is listenable in standard audio players.

External links