Rev 3657 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3657 | vana | 1 | #include<stdio.h> |
2 | #include<stdlib.h> |
||
3 | |||
4 | int main(int argc,char** argv) |
||
5 | { |
||
6 | FILE *fi,*fo; |
||
7 | int count=0; |
||
8 | int ch; |
||
9 | fi=fopen("image.bin","rb"); |
||
10 | fo=fopen("image.c","wb"); |
||
11 | fprintf(fo,"char HOSimage[]={\n"); |
||
12 | if((ch=getc(fi))!=EOF) {fprintf(fo,"0x%02X",ch);count++;} |
||
13 | while((ch=getc(fi))!=EOF) {fprintf(fo,",0x%02X",ch);count++;} |
||
14 | fprintf(fo,"};\nint HOSimagesize=%d;\n",count); |
||
15 | return EXIT_SUCCESS; |
||
16 | } |
||
17 |