From 5bb30c6397b736671a04857ac4e95a3e53a3ce25 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 22 Sep 2016 13:39:33 +0200 Subject: Add support for ICE16 baseband firmware files (iPhone 7/7+) While not tested, the new Mav16 baseband firmware files should also work with this update. --- src/mbn.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mbn.c') diff --git a/src/mbn.c b/src/mbn.c index a4f514e..101e29f 100644 --- a/src/mbn.c +++ b/src/mbn.c @@ -44,6 +44,17 @@ mbn_file* mbn_parse(unsigned char* data, unsigned int size) mbn->version = 1; memcpy(&mbn->header.v1, data, sizeof(mbn_header_v1)); mbn->parsed_size = mbn->header.v1.data_size + sizeof(mbn_header_v1); + } else if (memcmp(data, BIN_MAGIC, BIN_MAGIC_SIZE) == 0) { + mbn->version = 3; + memcpy(&mbn->header.bin, data, sizeof(bin_header)); + mbn->parsed_size = mbn->header.bin.total_size; + } else if (memcmp(data, ELF_MAGIC, ELF_MAGIC_SIZE) == 0) { + mbn->version = 4; + memcpy(&mbn->header.elf, data, sizeof(elf_header)); + // we cheat here since we don't parse the actual ELF file + mbn->parsed_size = mbn->size; + } else { + debug("DEBUG: Unknown file format passed to %s\n", __func__); } if (mbn->parsed_size != mbn->size) { info("WARNING: size mismatch when parsing MBN file. Continuing anyway.\n"); -- cgit v1.1-32-gdbae