Last active
August 29, 2015 14:24
-
-
Save tewilove/04415602664d5839d073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct fota_seg_hdr { | |
uint32_t crc; | |
uint32_t size; | |
uint32_t upi_ver; // seems to be 0x00014050 | |
uint32_t scout_ver; // seems to be 0x00013880 | |
uint32_t flags1; | |
uint32_t flags2; | |
uint32_t field_18; | |
uint32_t field_1c; | |
uint32_t index_offset; // index data offset in unLZMAed data(strings starts from 0) | |
uint32_t index_size; // index size when LZMAed | |
uint16_t field_28; | |
uint16_t field_2a; | |
uint16_t files_field_2c; | |
uint16_t files_diff; | |
uint16_t files_opt; | |
uint16_t files_del; | |
uint16_t dirs_del; | |
uint16_t dirs_add; | |
uint16_t links_del; | |
uint16_t links_add; | |
uint16_t criticals_field_3c; | |
uint16_t criticals_field_3e; | |
}; | |
/* | |
FOTA segment structure: | |
struct fota_seg_hdr; | |
{ | |
uint32_t dst_crc; | |
uint32_t src_crc; | |
} * files_diff; | |
{ | |
uint32_t crc32; | |
} * files_field_2c; | |
{ | |
uint32_t crc32; | |
} * files_opt; // not good to LZMA it so leave outside? | |
LZMAed index { | |
{ | |
links_del; | |
files_del; | |
files_field_2c + files_diff; | |
dirs_add + files_opt; | |
file_attrs; | |
} strings; | |
{ | |
int32_t size_new; // >= 0, consumes 2 strings | |
// < 0, consumes 1 string | |
// & 0x3fffffff is real size | |
} * files_diff; | |
{ | |
int32_t size_new; | |
} * files_field_2c; | |
{ | |
uint32_t field_04; | |
} * files_opt; | |
{ | |
int32_t size_diff; | |
} * files_diff; | |
{ | |
uint32_t attr_off; | |
} * (files_diff + files_field_2c); | |
{ | |
uint32_t attr_off; | |
} * (files_opt + dirs_add + links_add); | |
{ | |
uint32_t delta_size; // XXX: NG!!! shoud start after LZMAed index but no matches. | |
} * files_diff; | |
{ | |
uint32_t delta_size; | |
} * files_opt; | |
}; | |
LZMAed data * N; | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment