#include <stdio.h>

static void dump_file(char *name);
int main(int argc, char **argv)
{
    if (argc > 1)
	while (--argc)
	  dump_file(argv[argc]);
    else
	puts("usage: dump file1 file2 ...");	
    return 0;
}

void dump_file(char *name)
{
    unsigned long l, l1, l2, l3;             
    unsigned char c; 
    int n1, n2, n3;
    FILE *f;

    if (!name || !*name)
	return;
    printf("file name: %s\n", name);
    f = fopen(name,"rb");
    if (f == NULL)
	return;	    
    fread(&l, sizeof(l), 1, f);
    fread(&c, sizeof(c), 1, f);
    fread(&c, sizeof(c), 1, f);
    fread(&l, sizeof(l), 1, f);
    l = 1;	
    for (;;) {
        l1 = l2 = l3 = 0;
    	n1 = fread(&l1, sizeof(l1), 1, f);	   
        if (n1 == 1)
    	    n2 = fread(&l2, sizeof(l2), 1, f);	   
	else 
	    break;	
        if (n2 == 1)
    	    n3 = fread(&l3, sizeof(l3), 1, f);	   
        else
            break;
        printf("0x%lx\t0x%lx\t0x%lx\t0x%lx\n", l1, l2, l3, l);
	l++;
   } 
   fclose(f);   
	
}
