]> cvs.zerfleddert.de Git - rsbs2/blobdiff - firmware.c
add functions to reliably read files in the filesystem, to be used by the
[rsbs2] / firmware.c
index 2c9960fa7436ad745160b512977e108db2c3475e..cd7927b8f9854d86c20696adcfaabd8285f18dbf 100644 (file)
@@ -8,7 +8,7 @@
 #include <string.h>
 #include <strings.h>
 #include "rsb-crc.h"
 #include <string.h>
 #include <strings.h>
 #include "rsb-crc.h"
-#include "rsb-lz.h"
+#include "extract.h"
 
 #define FINDSTR(addr, str) (!strncmp((char*)addr, str, strlen(str)))
 
 
 #define FINDSTR(addr, str) (!strncmp((char*)addr, str, strlen(str)))
 
@@ -76,13 +76,13 @@ void show_properties(unsigned char *fw, int len)
                        }
 
                        if (prop->right_rw == 0x00 && prop->rw_mask == 0x00) {
                        }
 
                        if (prop->right_rw == 0x00 && prop->rw_mask == 0x00) {
-                               printf("(R-) ");
+                               printf("(R-)");
                        } else if (prop->right_rw == 0x01) {
                        } else if (prop->right_rw == 0x01) {
-                               printf("(RW mask: 0x%02x) ", prop->rw_mask);
+                               printf("(RW mask: 0x%02x)", prop->rw_mask);
                        } else {
                        } else {
-                               printf("(UNK 0x%02x 0x%02x) ", prop->right_rw, prop->rw_mask);
+                               printf("(UNK 0x%02x 0x%02x)", prop->right_rw, prop->rw_mask);
                        }
                        }
-                       printf("\n");
+                       printf(", length: %d\n", *((unsigned int*)(fw + i - 4)));
                }
        }
 }
                }
        }
 }
@@ -423,6 +423,7 @@ int main(int argc, char **argv)
        ret = check_crc(fw, statbuf.st_size);
        if ((ret != 0) && (!update_crc)) {
                fprintf(stderr,"Checksum incorrect, aborting...\n");
        ret = check_crc(fw, statbuf.st_size);
        if ((ret != 0) && (!update_crc)) {
                fprintf(stderr,"Checksum incorrect, aborting...\n");
+               exit(1);
        }
 
        if (patch_fw) {
        }
 
        if (patch_fw) {
@@ -461,7 +462,7 @@ int main(int argc, char **argv)
        }
 
        if (extract) {
        }
 
        if (extract) {
-               search_lz_sections(fw, statbuf.st_size - 4);
+               extract_files(fw, statbuf.st_size - 4);
        }
 
        if (update_crc || patch_fw || patch_bd) {
        }
 
        if (update_crc || patch_fw || patch_bd) {
Impressum, Datenschutz