public static void Main()
string cadena = "B13E745599654841172F741A662880D4";
var guid = new Guid(cadena);
string hex = HexStringFromBytes(guid.ToByteArray());
string TypeString = "pssh";
string hexSystemID = HexStringFromBytes(new byte[] { 0xed, 0xef, 0x8b, 0xa9, 0x79, 0xd6, 0x4a, 0xce, 0xa3, 0xc8, 0x27, 0xdc, 0xd5, 0x1d, 0x21, 0xed });
string hexS = "edef8ba979d64acea3c827dcd51d21ed";
var guidSystem = new Guid(hexS);
Console.WriteLine(hexSystemID);
Console.WriteLine(HexStringFromBytes(guidSystem.ToByteArray()));
byte[] Type = Encoding.UTF8.GetBytes(TypeString);
byte[] Version = new byte[] { 0x00 };
byte[] Flags = new byte[] { 0x00, 0x00, 0x00};
string convType = HexStringFromBytes(Type);
string convVersion = HexStringFromBytes(Version);
string convFlags = HexStringFromBytes(Flags);
Console.WriteLine(convType);
Console.WriteLine(convVersion);
Console.WriteLine(convFlags);
public static string HexStringFromBytes(byte[] bytes)
var sb = new StringBuilder();
foreach (byte b in bytes)
var hex = b.ToString("x2");