public static void Main(string[] args)
byte[] keyTable = GenerateXORKey(
"020000002d916f2384f7857f30110170d58035e2b638d2e928251db7b8b30cea47110a330259d430bf5dc0609bd0a1d701d2192c3f983916cb480f1339fec51d1b01bc0467c954d8fad613d91495919d9a6f73e5",
@"E:\Users\ObsidianMinor\Music");
string key = GetHex(keyTable).ToLower();
public static string GetHex(byte[] data)
return BitConverter.ToString(
data).Replace("-", string.Empty);
public static byte[] GetBytes(string hex)
return Enumerable.Range(0, hex.Length)
.Select(x => Convert.ToByte(hex.Substring(x, 2), 16))
public static byte[] GenerateXORKey(string packedHex, string expectedUTF8)
byte[] packedData = GetBytes(packedHex);
using (var packedStream = new MemoryStream(packedData))
using (var inPacked = new BinaryReader(packedStream))
inPacked.BaseStream.Position += 16;
byte[] decipherableData = inPacked.ReadBytes(
((int)inPacked.BaseStream.Length) - 16);
byte[] expectedData = Encoding.UTF8.GetBytes(expectedUTF8);
byte[] keyTable = new byte[expectedData.Length];
for (int i = 0; i < expectedData.Length; i++)
for (byte b = 0; b < byte.MaxValue; b++)
(decipherableData[i] ^ b))