__u16 nr_desc;
};
+#if 0
static struct firmware_description* alloc_firmware_description(void) {
struct firmware_description *d = malloc(sizeof(*d));
d->type = 0;
free(d->data);
free(d);
}
+#endif
static struct firmware* alloc_firmware(void) {
struct firmware *f = malloc(sizeof(*f));
static void add_standard(struct firmware* f, char* firmware_file, char* standard_file) {
unsigned char* standard_data;
- unsigned int len, i;
+ unsigned int len;
struct firmware_description desc;
create_standard_data(standard_file, &standard_data, &len);
unsigned char *seek, unsigned char *endp, /* File to seek */
unsigned char *fdata, unsigned char *endf) /* Firmware */
{
- unsigned char *fpos, *p, *p2, *lastp;
- int rc, fsize;
+ unsigned char *fpos, *p, *p2;
+ int fsize;
unsigned char *temp_data;
struct chunk_hunk *hunk = fhunk;
/* Method 3 vars */
}
}
return 3;
-#endif
not_found:
+#endif
memset(fhunk, 0, sizeof(struct chunk_hunk));
printf("Couldn't find firmware\n");
return 0;
}
if (p2 > fdata + 3) {
int i = 0;
+ unsigned char *lastp;
printf("Found %ld equal bytes at %06x:\n",
p2 - fdata, p - seek);
fpos = p;
static void seek_firmware(struct firmware *f, char *seek_file, char *write_file) {
unsigned int i = 0, j, nfound = 0;
long size, rd = 0;
- unsigned char *seek, *p, *endp, *p2, *endp2, *fpos;
+ unsigned char *seek, *p, *endp, *endp2;
/*FIXME: Calculate it, instead of using a hardcode value */
char *md5 = "0e44dbf63bb0169d57446aec21881ff2";
FILE *fp;
char* firmware_file, *file = NULL, *nr_str = NULL, *index_str = NULL;
char *seek_file = NULL, *write_file = NULL;
struct firmware *f;
- __u64 nr;
while(1) {
static struct option long_options[] = {