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.

30 lines
594B

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <string.h>
  5. #include "lzsc.h"
  6. #include "filedata.h"
  7. #include "romfile.h"
  8. /*
  9. * $ compress <rom-0-base> <plain-config>
  10. */
  11. int main(int argc, char *argv[])
  12. {
  13. struct romfile *rom = get_romfile(argv[1], "autoexec.net");
  14. struct filedata *config = get_filedata(argv[2]);
  15. rom->size = lzs_pack(config->data, config->size, rom->data + 0xC, 0x1000);
  16. rom->size += 0xC;
  17. char outname[64];
  18. strncpy(outname, argv[2], sizeof(outname));
  19. strcat(outname, ".comp");
  20. put_romfile(outname, rom);
  21. free(config);
  22. free(rom);
  23. return 0;
  24. }