diff --git a/BurnOutSharp.Compression/LZX/Decompressor.cs b/BurnOutSharp.Compression/LZX/Decompressor.cs index 5ce8e38b..82fc98ec 100644 --- a/BurnOutSharp.Compression/LZX/Decompressor.cs +++ b/BurnOutSharp.Compression/LZX/Decompressor.cs @@ -65,7 +65,6 @@ namespace BurnOutSharp.Compression.LZX int endinp = inpos + inlen; int window = 0; // state.window[0]; int runsrc, rundest; // byte* - ushort[] hufftbl; /* used in READ_HUFFSYM macro as chosen decoding table */ uint window_posn = state.window_posn; uint window_size = state.window_size; @@ -470,13 +469,10 @@ namespace BurnOutSharp.Compression.LZX /// private static int ReadLengths(byte[] lengths, uint first, uint last, Bits lb, State state, byte[] inbuf) { - uint i, j, x, y; - int z; - + uint x, y; uint bitbuf = lb.BitBuffer; int bitsleft = lb.BitsLeft; int inpos = lb.InputPosition; - ushort[] hufftbl; for (x = 0; x < 20; x++) { @@ -488,7 +484,7 @@ namespace BurnOutSharp.Compression.LZX for (x = first; x < last;) { - z = READ_HUFFSYM(state.tblPRETREE_table, state.tblPRETREE_len, LZX_PRETREE_TABLEBITS, LZX_PRETREE_MAXSYMBOLS, inbuf, ref inpos, ref bitsleft, ref bitbuf); + int z = READ_HUFFSYM(state.tblPRETREE_table, state.tblPRETREE_len, LZX_PRETREE_TABLEBITS, LZX_PRETREE_MAXSYMBOLS, inbuf, ref inpos, ref bitsleft, ref bitbuf); if (z == 17) { y = READ_BITS(4, inbuf, ref inpos, ref bitsleft, ref bitbuf); diff --git a/BurnOutSharp.Wrappers/PortableExecutable.cs b/BurnOutSharp.Wrappers/PortableExecutable.cs index b02af082..2ff7aa66 100644 --- a/BurnOutSharp.Wrappers/PortableExecutable.cs +++ b/BurnOutSharp.Wrappers/PortableExecutable.cs @@ -2822,7 +2822,11 @@ namespace BurnOutSharp.Wrappers Console.WriteLine($"{padding}Unknown type {resourceType} found, not parsed yet"); // Then print the data, if needed - if (entry.Data[0] == 0x4D && entry.Data[1] == 0x5A) + if (entry.Data == null) + { + 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 }