mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-09 02:16:46 +00:00
Print first 16 bytes of unknown resources
This commit is contained in:
@@ -2826,24 +2826,32 @@ namespace BurnOutSharp.Wrappers
|
||||
{
|
||||
Console.WriteLine($"{padding}Data: [NULL] (This may indicate a very large resource)");
|
||||
}
|
||||
else if (entry.Data[0] == 0x4D && entry.Data[1] == 0x5A)
|
||||
{
|
||||
Console.WriteLine($"{padding}Data: [Embedded Executable File]"); // TODO: Parse this out and print separately
|
||||
}
|
||||
else if (entry.Data[0] == 0x4D && entry.Data[1] == 0x53 && entry.Data[2] == 0x46 && entry.Data[3] == 0x54)
|
||||
{
|
||||
Console.WriteLine($"{padding}Data: [Embedded OLE Library File]"); // TODO: Parse this out and print separately
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (entry.Data != null)
|
||||
// Console.WriteLine($"{padding}Value (Byte Data): {BitConverter.ToString(entry.Data).Replace('-', ' ')}");
|
||||
//if (entry.Data != null)
|
||||
// Console.WriteLine($"{padding}Value (ASCII): {Encoding.ASCII.GetString(entry.Data)}");
|
||||
//if (entry.Data != null)
|
||||
// Console.WriteLine($"{padding}Value (UTF-8): {Encoding.UTF8.GetString(entry.Data)}");
|
||||
//if (entry.Data != null)
|
||||
// Console.WriteLine($"{padding}Value (Unicode): {Encoding.Unicode.GetString(entry.Data)}");
|
||||
int offset = 0;
|
||||
byte[] magic = entry.Data.ReadBytes(ref offset, Math.Min(entry.Data.Length, 16));
|
||||
|
||||
if (entry.Data[0] == 0x4D && entry.Data[1] == 0x5A)
|
||||
{
|
||||
Console.WriteLine($"{padding}Data: [Embedded Executable File]"); // TODO: Parse this out and print separately
|
||||
}
|
||||
else if (entry.Data[0] == 0x4D && entry.Data[1] == 0x53 && entry.Data[2] == 0x46 && entry.Data[3] == 0x54)
|
||||
{
|
||||
Console.WriteLine($"{padding}Data: [Embedded OLE Library File]"); // TODO: Parse this out and print separately
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"{padding}Data: {BitConverter.ToString(magic).Replace('-', ' ')} ...");
|
||||
|
||||
//if (entry.Data != null)
|
||||
// Console.WriteLine($"{padding}Value (Byte Data): {BitConverter.ToString(entry.Data).Replace('-', ' ')}");
|
||||
//if (entry.Data != null)
|
||||
// Console.WriteLine($"{padding}Value (ASCII): {Encoding.ASCII.GetString(entry.Data)}");
|
||||
//if (entry.Data != null)
|
||||
// Console.WriteLine($"{padding}Value (UTF-8): {Encoding.UTF8.GetString(entry.Data)}");
|
||||
//if (entry.Data != null)
|
||||
// Console.WriteLine($"{padding}Value (Unicode): {Encoding.Unicode.GetString(entry.Data)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user