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

Depack utility for UPX-compressed FreeDOS kernel #75

Open
ecm-pushbx opened this issue May 22, 2022 · 1 comment
Open

Depack utility for UPX-compressed FreeDOS kernel #75

ecm-pushbx opened this issue May 22, 2022 · 1 comment

Comments

@ecm-pushbx
Copy link
Contributor

Having worked some on the kernel's exeflat I took on the challenge of undoing the compression that it orchestrates along with UPX. Here's the resulting program: https://hg.pushbx.org/ecm/fddepack/file/85a255f5048a/depack.c

As you can see it is a very basic program. It calls upx -d using a system call in C, the error handling is rudimentary, and it needs the output filename to end in .exe. Further, it only supports the MZ .EXE compression format for now. The resulting output file can be re-used as input to exeflat to recreate a bootable kernel (with or without UPX compression).

I checked with a kernel 2042 that I had around, the kernel 2036 from dosemu-freedos-1.0-bin.tgz, and the current git (with my exeflat update).

I think that the depacker might come in handy to appease the UPX usage conditions. If not under the GPL (which would require redistributing the corresponding source of UPX with any compressed kernel) they want us to not modify their depacker stub (what we technically do not do, just prepend our stub stub) and to allow anyone to depack compressed files. Even with this depacker we don't follow these requirements to the letter, but in spirit perhaps.

@ecm-pushbx
Copy link
Contributor Author

Updated to support the new format, both DOS/EXE and DOS/SYS compression formats: https://hg.pushbx.org/ecm/fddepack/file/e7c21dc601da/depack.c

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

1 participant