I wrote this small fragment of a small fragment for a Linux box with an old mp3 player that could not handle tags. All that remains is the mp3 headers and data (on stdout encoded). You can use this for your md5.
#include <fcntl.h>
#define DUMPTAGS
int main(int argc, char **argv){
unsigned char buf[4096];
int len,fd = open(argv[1],O_RDONLY);
while (len=read(fd,buf,10)){
if (buf[0]=='I' && buf[1]=='D' && buf[2]=='3'){
len=read(fd,buf,buf[9]|(buf[8] << 7)|(buf[7] << 14)|(buf[6] << 21));
#ifdef DUMPTAGS
write(2,buf,len);
#endif
} else break;
}
while (write(1,buf,len)){
unsigned char tag[3] = {'T','A','G'}, *end;
len=read(fd,buf,4096);
end=(unsigned char *)memmem(buf,len,&tag,3);
if (end){
write(1,buf,end-buf);
#ifdef DUMPTAGS
write(2,end,len-(end-buf));
#endif
break;
}
}
}
source
share