From: hackbard Date: Mon, 30 Sep 2002 20:13:00 +0000 (+0000) Subject: bsed - first version ! X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;p=my-code%2Fbsed.git bsed - first version ! --- 7acb84b99b9af996e6d29e495ca389f6eb98058e diff --git a/bsed.c b/bsed.c new file mode 100644 index 0000000..553aa6a --- /dev/null +++ b/bsed.c @@ -0,0 +1,30 @@ +/* bsed.c - binary sed program + * + * author: hackbard + * + */ + +#define MAX_BITS 1024 + +void main(int argc, char *argv[]) { + + FILE *file_h; + char temp[MAX_BITS]; + + if(argc<4) { + print("usage: %s \n",argv[0]); + return 0 + } + + file_h=fopen(argv[3],"w+"); + if(file_h==NULL) { + printf("error: cant open %s for reading\n",argv[3]); + return 0; + } else { + printf("processing %s\n",argv[1]); + } + + /* translate 2 bitmuster */ + + while(fgets(temp,MAX_BITS,file_h)) { + if(strstr(temp,"