I've been trying to modify a small script/program which unarchives a unique LZSS files. It was made to decompress .LZ files from the game F-Zero GX. It works just great for that, however, it doesn't work for F-Zero AX, the arcade version. The issue isn't that big, though, as the actual script has a debug feature. My 2 problems are; 1) I only started picking up C a few weeks ago and thus cannot find what exactly is wrong, 2) the debugger spits out hex values, and while I can read them, I have no idea how it is supposed to help me.

On that note, I'd like to ask 2 things. Firstly, can anyone recommend a good tutorial on how to apply hex? Once you find how to convert it to binary or other, it's fine and dandy, but how do you use those values? Secondly, can anyone help with finding either the bottleneck or issue the script is having?

Here is the program, along with working examples in \examples\packed_examples. AX files which will not unpack can be found in \examples\ax_packed_examples. http://www.mediafire.com/?jjijnhev8yt8yej
The file which returns the error is named binarystream.d located in src.

The error the console returns is this:
Code:
C:\Users\…\gxpand unpack input output
UnLZ output\st87.gma.lz
std.stream.ReadException@std\stream.d<46>: not enough data in stream
----------------
47EA54
47E8CB
----------------

C:\Users\…\gxpand>save
'save' is not recognized as an internal or external command, operable program or batch file.

C:\Users\…\gxpand>close
'close' is not recognized as an internal or external command, operable program or batch file.