this contains the missing parts of the puzzle
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;
}