Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8086 depacker for non-raw LZSA2 file #61

Closed
ecm-pushbx opened this issue Apr 25, 2021 · 3 comments
Closed

8086 depacker for non-raw LZSA2 file #61

ecm-pushbx opened this issue Apr 25, 2021 · 3 comments

Comments

@ecm-pushbx
Copy link

Hello,

I used your NASM source for the space-efficient 8088 LZSA2 raw decompressor to build my 8086 depacker for the lDOS/lDebug/RxDOS kernel file.

I use -f2 for the lzsa tool to create an LZSA2 compressed stream. My files are usually larger than 64 KiB so using raw blocks was not an option.

I adapted your source so it counts down the remaining lengths of the source and destination. This provides a simple type of error check. I also added checks for the end of the block data similar to your C source. I further made it so a back reference can cross a segment boundary by doing segment arithmetic. I changed the code not to use bp so I can use it as a stack frame base pointer throughout. Finally, I added support for overlapping source and destination buffers which checks the far pointers after every match to insure the source data is not corrupted.

@ecm-pushbx
Copy link
Author

The stream format documentation on the length could be clearer by the way. I had to inspect the actual output and code to determine that 1. it is the length of the compressed data of this block and 2. that there is no End Of Data marker in the block's data as for raw blocks, but rather the depacker has to detect when it read enough of the block's data.

@ecm-pushbx
Copy link
Author

To be fair I just reviewed the LZSA2 block format description of the EOD marker and it does list that this is only used for raw blocks.

@emmanuel-marty
Copy link
Owner

Thanks, linked in the README file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants