]> hackdaworld.org Git - my-code/bsed.git/commitdiff
bsed - first version ! master origin
authorhackbard <hackbard>
Mon, 30 Sep 2002 20:13:00 +0000 (20:13 +0000)
committerhackbard <hackbard>
Mon, 30 Sep 2002 20:13:00 +0000 (20:13 +0000)
bsed.c [new file with mode: 0644]

diff --git a/bsed.c b/bsed.c
new file mode 100644 (file)
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 <orig> <new> <file>\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,"