Quick'n'dirty:
int value = 0x48454C4F;
Console.WriteLine(Encoding.ASCII.GetString(
BitConverter.GetBytes(value).Reverse().ToArray()
));
Converting int to bytes, changing the byte array to the correct order, and then getting the ASCII character representation from it.
EDIT: The inverse method is an extension method from .NET 3.5, for information only. Reverse byte order may also not be needed in your script.
Cheers, David
source
share