mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 10:35:26 +00:00
parent
44fb7dbcbe
commit
7188de1205
@ -366,7 +366,7 @@ static const char *vendor_ramdisk_type(int type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define assert_off() \
|
#define assert_off() \
|
||||||
if ((base_addr + off) > (map.buf() + map.sz())) { \
|
if ((base_addr + off) > (map.buf() + map_end)) { \
|
||||||
fprintf(stderr, "Corrupted boot image!\n"); \
|
fprintf(stderr, "Corrupted boot image!\n"); \
|
||||||
return false; \
|
return false; \
|
||||||
}
|
}
|
||||||
@ -395,6 +395,7 @@ bool boot_img::parse_image(const uint8_t *p, format_t type) {
|
|||||||
|
|
||||||
hdr->print();
|
hdr->print();
|
||||||
|
|
||||||
|
size_t map_end = align_to(map.sz(), getpagesize());
|
||||||
size_t off = hdr->hdr_space();
|
size_t off = hdr->hdr_space();
|
||||||
get_block(kernel);
|
get_block(kernel);
|
||||||
get_block(ramdisk);
|
get_block(ramdisk);
|
||||||
@ -408,7 +409,7 @@ bool boot_img::parse_image(const uint8_t *p, format_t type) {
|
|||||||
|
|
||||||
payload = byte_view(base_addr, off);
|
payload = byte_view(base_addr, off);
|
||||||
auto tail_addr = base_addr + off;
|
auto tail_addr = base_addr + off;
|
||||||
tail = byte_view(tail_addr, map.buf() + map.sz() - tail_addr);
|
tail = byte_view(tail_addr, map.buf() + map_end - tail_addr);
|
||||||
|
|
||||||
if (auto size = hdr->kernel_size()) {
|
if (auto size = hdr->kernel_size()) {
|
||||||
if (int dtb_off = find_dtb_offset(kernel, size); dtb_off > 0) {
|
if (int dtb_off = find_dtb_offset(kernel, size); dtb_off > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user