![]() |
![]() |
#1 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 774
|
removing xpk headers?
Does anyone have a tool for removing the xpk headers off packed data files? I baiscally need to remove the first $10 bytes off a mass load of files. I was thinking i could load each one up into hrtmon, but that does seem like a massive ball ache.
Any ideas? |
![]() |
![]() |
#2 |
Junior Member
Join Date: Jan 2002
Location: PDX
Age: 62
Posts: 2,396
|
I thought that these were produced by a file compression utility named XPK.
If I remember correctly you can uncompress said files as well using the same tools. Here is a Google search on more for XPK on the Amiga ![]() http://www.google.com/search?num=100...=&oq=&gs_rfai= Last edited by jmmijo; 23 December 2010 at 21:23. Reason: More Info |
![]() |
![]() |
#3 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
First idea: just develop in a modern OS and write some Python code to fix the files. AmigaOS is just so inefficient to develop in.
but in case you're using a real Amiga, this will work: trim file1.bin file2 file3 etc. It overwrites the existing file so make sure to do copies. If it prints a filename then there was an error. EDIT: I've attached a compiled AmigaOS exe for you. Code:
#include <stdio.h> #include <stdlib.h> int main(int nargs, char** pargs) { FILE* file; void* buf; int size; while(--nargs) { file = fopen(pargs[nargs], "rb"); if(file == NULL) { printf("%s\n", pargs[nargs]); continue; } fseek(file, 0, SEEK_END); size = ftell(file)-16; fseek(file, 16, SEEK_SET); buf = malloc(size); if(buf == NULL) { printf("%s\n", pargs[nargs]); fclose(file); continue; } fread(buf, size, 1, file); fclose(file); file = fopen(pargs[nargs], "wb"); if(file == NULL) { printf("%s\n", pargs[nargs]); free(buf); continue; } fwrite(buf, size, 1, file); fclose(file); free(buf); } return 0; } Last edited by Leffmann; 23 December 2010 at 22:28. |
![]() |
![]() |
#4 | |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 774
|
Quote:
|
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
A1200 rev1a add clockport headers | OverDose | support.Hardware | 1 | 04 April 2011 03:24 |
OS 3.9 Includes headers missing(as installed from NDK3.9) | frotzen | Coders. General | 4 | 09 July 2007 02:40 |
EXE headers | Asle | request.Other | 3 | 29 July 2006 15:11 |
Please avoid xDMS with files which contain headers | andreas | project.TOSEC (amiga only) | 5 | 31 March 2006 16:47 |
XPK decruncher | Joe Maroni | request.Apps | 15 | 01 May 2005 12:40 |
|
|