#include <string.h>
#include <strings.h>
#include "rsb-crc.h"
+#include "rsb-lz.h"
#define FINDSTR(addr, str) (!strncmp((char*)addr, str, strlen(str)))
if (showall) {
show_properties(fw, statbuf.st_size - 4);
handle_boarddescription(fw, statbuf.st_size -4, 0);
+ search_lz_sections(fw, statbuf.st_size - 4);
}
if (update_crc || patch_fw || patch_bd) {
+#include <stdio.h>
+#include "rsb-lz.h"
+
/* TODO: IMPLEMET THIS! */
/* Probably very broken lzw implementation by Agilent:
*
* 59b7c: 14000410 strne r0, [r0], #-1040
* 59b80: 46335053 undefined
*/
+
+void search_lz_sections(unsigned char *fw, int len)
+{
+ int i;
+ unsigned char *j;
+
+ 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 (*j == 0x00) {
+ printf("%s", j+1);
+ break;
+ }
+ j--;
+ }
+ printf("\n");
+ }
+ }
+}
#define LZ_MAGIC 0x6110beef
+
+void search_lz_sections(unsigned char *fw, int len);