All pastes #61078 Raw Edit

Mine

public text v1 · immutable
#61078 ·published 2006-06-02 17:01 UTC
rendered paste body
#include <stdlib.h>
#include <stdio.h>
void main () {
    FILE *inf;
    char buf[2];
    unsigned short int *b_int;
    int r;
    inf=fopen("22_22_conv.dat","r");
    fseek(inf,18,SEEK_SET);
    r=fread(&buf,2,1,inf);
    while ( !feof(inf)) {
        if (buf[1]==0) { //test for identifier
            if (buf[0]==0) { // block0000 identified
                printf("\nBlock0000 found, dumping data:\n");
            } else if (buf[0]>=48 && buf[0]<=127) { // blocks 4000 til 7900
                printf("\nSpecial block %0hhX%0hhX found, dumping data:\n",buf[0],buf[1]);
            };
        };
        printf("[%hhX,%00hhX]",buf[0],buf[1]);
        r=fread(&buf,2,1,inf);
    };
    fclose(inf);
}