ES-2024 reverter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

decompress.c 561B

12345678910111213141516171819202122232425262728
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <string.h>
  5. #include "lzsd.h"
  6. #include "romfile.h"
  7. /*
  8. * $ decompress <rom-0-file>
  9. */
  10. int main(int argc, char *argv[])
  11. {
  12. struct romfile *rom = get_romfile(argv[1], "autoexec.net");
  13. struct filedata *config = alloc_filedata(65536);
  14. config->size = lzs_unpack(rom->data + 0xC, rom->size - 0xC, config->data, config->size);
  15. char outname[64];
  16. strncpy(outname, argv[1], sizeof(outname));
  17. strcat(outname, ".decomp");
  18. put_filedata(outname, config);
  19. free(config);
  20. free(rom);
  21. return 0;
  22. }