]> git.zerfleddert.de Git - rsbs2/commitdiff
compressed main firmware now also gets extracted :-)
authorMichael Gernoth <michael@gernoth.net>
Sat, 31 Jan 2009 13:11:10 +0000 (14:11 +0100)
committerMichael Gernoth <michael@gernoth.net>
Sat, 31 Jan 2009 13:11:10 +0000 (14:11 +0100)
this contains the missing parts of the puzzle

rsb-lz.c

index e009a4f8ad2eec8545629e244e6539778746fae7..b6242658d2b6322a9041fd10b53f80620a1ab4f4 100644 (file)
--- a/rsb-lz.c
+++ b/rsb-lz.c
@@ -766,13 +766,20 @@ void search_lz_sections(unsigned char *fw, int len)
        for(i = 0; i < len - 4; i++) {
                if (*((unsigned int*)(fw+i)) == LZ_MAGIC) {
                        j = fw + i - 1;
-                       if (*j != 0x00)
-                               continue;
                        printf("0x%02x: ", i);
                        j--;
                        while (j > fw) {
+                               if (!strncmp("SP3", (char*)j, 3)) {
+                                       unsigned char fname[5];
+
+                                       bzero(fname, sizeof(fname));
+                                       memcpy(fname, j, 4);
+                                       printf("Firmware found: %s", fname);
+                                       extract_lz_file(fw + i, fname);
+                                       break;
+                               }
                                if (*j == 0x00) {
-                                       if ( *(j+1) != '/') {
+                                       if ((*(j+1) != '/')) {
                                                printf("ignoring...\n");
                                                break;
                                        }
Impressum, Datenschutz