summaryrefslogtreecommitdiffstats
path: root/src/mbn.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2016-09-22 13:39:33 +0200
committerGravatar Nikias Bassen2016-09-22 13:39:33 +0200
commit5bb30c6397b736671a04857ac4e95a3e53a3ce25 (patch)
tree836750b61c4c8c71b5be411a9200261f92e21da8 /src/mbn.c
parent6fbbc685ce31b0b779c3b2ea34348019d93cf955 (diff)
downloadidevicerestore-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.c11
1 files changed, 11 insertions, 0 deletions
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");