Skip to content

Commit

Permalink
Use RBinPlugin.symbolsVec() in Kernelcache ##bin
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Nov 17, 2023
1 parent e84d38d commit 3109805
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 46 deletions.
9 changes: 4 additions & 5 deletions libr/bin/format/mach0/mach0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,7 @@ static bool parse_chained_fixups(struct MACH0_(obj_t) *mo, ut32 offset, ut32 siz
}

static bool reconstruct_chained_fixup(struct MACH0_(obj_t) *mo) {
R_LOG_DEBUG ("reconstructing chained fixups");
if (!mo->dyld_info) {
return false;
}
Expand All @@ -1611,10 +1612,10 @@ static bool reconstruct_chained_fixup(struct MACH0_(obj_t) *mo) {
}
size_t wordsize = get_word_size (mo);
ut8 *p = NULL;
size_t j, count, skip, bind_size;
size_t j, count, skip;
int seg_idx = 0;
ut64 seg_off = 0;
bind_size = mo->dyld_info->bind_size;
size_t bind_size = mo->dyld_info->bind_size;
if (!bind_size || bind_size < 1) {
return false;
}
Expand Down Expand Up @@ -2172,9 +2173,7 @@ static int init_items(struct MACH0_(obj_t) *mo) {
}
}

if (!has_chained_fixups && mo->hdr.cputype == CPU_TYPE_ARM64 &&
(mo->hdr.cpusubtype & ~CPU_SUBTYPE_MASK) == CPU_SUBTYPE_ARM64E) {
R_LOG_DEBUG ("reconstructing chained fixups");
if (!has_chained_fixups && mo->hdr.cputype == CPU_TYPE_ARM64 && (mo->hdr.cpusubtype & ~CPU_SUBTYPE_MASK) == CPU_SUBTYPE_ARM64E) {
reconstruct_chained_fixup (mo);
}
return true;
Expand Down
Loading

0 comments on commit 3109805

Please sign in to comment.