Difference between revisions of "ADF"

From GTAMods Wiki
Jump to navigation Jump to search
m
(examples and links)
Line 1: Line 1:
 
The [[ADF]] file format is used for the [[List of radio stations (VC)|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.
 
The [[ADF]] file format is used for the [[List of radio stations (VC)|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.
  
==External link==
+
== Example ==
[[Wikipedia:MP3|MP3 format description at Wikipedia]]
+
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 ==
 +
* [[Wikipedia:MP3|MP3 format description at Wikipedia]]
 +
* [[Wikipedia:Bitwise_operation#XOR|Bitwise exclusive OR at Wikipedia]]
 +
* {{GTAF|96504|Early topic on decoding ADF}}
  
 
{{N|VC}}
 
{{N|VC}}
 
[[Category:Audio Formats]]
 
[[Category:Audio Formats]]

Revision as of 06:16, 4 December 2011

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