If you have access to a C Compiler you could take this snippet from Pogoshell to compile your own Max OS X command line trimmer... been using it for years on Windows and Linux, works fine.
CODE/************************************************************************
* romtrunc - this programm removes "unnecessary" bytes from the end of *
* (theoretically any, but in this case) GBA files. *
* last changed September 9th 2003 *
************************************************************************/
#include
#include
#include
#define BUF_SIZE 65536
int main(int argc, char *argv[])
{
unsigned char buf[BUF_SIZE], c, oldc;
int l;
FILE *fpi, *fpo;
if(argc != 3){
printf("Truncate similar bytes from end of file\n");
printf("Usage: ""romtrunc infile.gba outfile.gba"" or\n");
printf(" ""romtrunc infile.gba""\n");
exit(0);
}else{
if(!(fpo=fopen(argv[2], "wb"))){
printf("ERROR, either your disk is full or this file does not exist.");
exit(0);
}
if(!(fpi=fopen(argv[1], "rb"))){
printf("ERROR, either your disk is full or this file does not exist.");
exit(0);
}
}
// Begin of truncating operation.
fseek(fpi, -1, SEEK_END);
fread(&c, 1, 1, fpi);
oldc = c;
while((!c || (c == 0xFF) || (c==0x00)) && (oldc == c)){
fseek(fpi, -2, SEEK_CUR);
oldc = c;
fread(&c, 1, 1, fpi);
}
l = ftell(fpi);
fseek(fpi, 0, SEEK_SET);
printf("Truncating at %d\n", l);
while(l > BUF_SIZE){
fread(buf, 1, BUF_SIZE, fpi);
fwrite(buf, 1, BUF_SIZE, fpo);
l -= BUF_SIZE;
}
fread(buf, 1, l, fpi);
fwrite(buf,1, l, fpo);
fclose(fpi);
fclose(fpo);
return 0;
}
If Mac OS X has gcc installed (what I hope, it's based on BSD, afterall...) just paste this into a text file and call it 'romtrunc.c'. Then compile it with 'gcc -Wall -g romtrunc.c -o romtrunc.