]> git.zerfleddert.de Git - rsbs2/commitdiff
don't assume that some bytes are the filetype
authorMichael Gernoth <michael@gernoth.net>
Sat, 31 Jan 2009 22:15:48 +0000 (23:15 +0100)
committerMichael Gernoth <michael@gernoth.net>
Sat, 31 Jan 2009 22:15:48 +0000 (23:15 +0100)
extract.c

index feab68f33570da5f068b22c1953afa9147814df2..6c30bd22eace6c727bc0e6a154b28be2a6aecb1c 100644 (file)
--- a/extract.c
+++ b/extract.c
@@ -15,7 +15,8 @@
 void extract_files(unsigned char *fw, int len)
 {
        unsigned char *pos;
 void extract_files(unsigned char *fw, int len)
 {
        unsigned char *pos;
-       unsigned int type, length;
+       unsigned int length;
+       unsigned char unknown[5];
        char *name;
 
        pos = fw + 0x28;
        char *name;
 
        pos = fw + 0x28;
@@ -24,10 +25,11 @@ void extract_files(unsigned char *fw, int len)
        pos = fw + *((unsigned int*)pos);
 
        while (pos < (fw + len)) {
        pos = fw + *((unsigned int*)pos);
 
        while (pos < (fw + len)) {
-               type = *((unsigned int*)pos);
-               pos += 4;
-               /* ??? */
-               pos++;
+               unknown[0] = *pos; pos++;
+               unknown[1] = *pos; pos++;
+               unknown[2] = *pos; pos++;
+               unknown[3] = *pos; pos++;
+               unknown[4] = *pos; pos++;
                length = *((unsigned int*)pos);
                pos += 4;
                name = (char*)pos;
                length = *((unsigned int*)pos);
                pos += 4;
                name = (char*)pos;
@@ -37,7 +39,9 @@ void extract_files(unsigned char *fw, int len)
                        printf("EOF reached\n");
                        break;
                }
                        printf("EOF reached\n");
                        break;
                }
-               printf("%s: type: 0x%x, length: %d", name, type, length);
+               printf("%s: unknown: %02x %02x %02x %02x %02x, length: %d",
+                       name, unknown[0], unknown[1], unknown[2], unknown[3],
+                       unknown[4], length);
 
                if (length > 0) {
                        write_file(name, pos, length);
 
                if (length > 0) {
                        write_file(name, pos, length);
Impressum, Datenschutz