diff options
author | 2016-09-22 13:39:33 +0200 | |
---|---|---|
committer | 2016-09-22 13:39:33 +0200 | |
commit | 5bb30c6397b736671a04857ac4e95a3e53a3ce25 (patch) | |
tree | 836750b61c4c8c71b5be411a9200261f92e21da8 /src/mbn.c | |
parent | 6fbbc685ce31b0b779c3b2ea34348019d93cf955 (diff) | |
download | idevicerestore-5bb30c6397b736671a04857ac4e95a3e53a3ce25.tar.gz idevicerestore-5bb30c6397b736671a04857ac4e95a3e53a3ce25.tar.bz2 |
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.
Diffstat (limited to 'src/mbn.c')
-rw-r--r-- | src/mbn.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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"); |