summaryrefslogtreecommitdiff
path: root/view/macho/machoview.h
diff options
context:
space:
mode:
authorkat <kat@vector35.com>2025-07-11 09:44:37 -0400
committerkat <kat@vector35.com>2025-07-14 11:49:20 -0400
commit2b3ce702bdaa825af2dbff45f7899b9ffd82a257 (patch)
tree4911a4840379556e21929c72e90876ea9a73fec3 /view/macho/machoview.h
parent99ed22fd9799ccfa0367b03de4d04d3b9ab26cd5 (diff)
[Mach-O] Handling for special library ordinals used in binding information
Diffstat (limited to 'view/macho/machoview.h')
-rw-r--r--view/macho/machoview.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/view/macho/machoview.h b/view/macho/machoview.h
index 253af9d1..c05d03a8 100644
--- a/view/macho/machoview.h
+++ b/view/macho/machoview.h
@@ -818,6 +818,13 @@ namespace BinaryNinja
RebaseOpcodeDoRebaseUlebTimesSkippingUleb = 0x80u, // REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB
};
+ enum BindSpecial {
+ BindSpecialDylibSelf = 0, // BIND_SPECIAL_DYLIB_SELF
+ BindSpecialDylibMainExecutable = -1, // BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE
+ BindSpecialDylibFlatLookup = -2, // BIND_SPECIAL_DYLIB_FLAT_LOOKUP
+ BindSpecialDylibWeakLookup = -3 // BIND_SPECIAL_DYLIB_WEAK_LOOKUP
+ };
+
enum BindOpcode {
BindOpcodeMask = 0xF0u, // BIND_OPCODE_MASK
BindImmediateMask = 0x0Fu, // BIND_IMMEDIATE_MASK
@@ -1375,6 +1382,13 @@ namespace BinaryNinja
uint32_t reserved;
};
+ struct BoundRelocation
+ {
+ BNRelocationInfo info;
+ std::string name;
+ int64_t ordinal;
+ };
+
struct MachOHeader {
bool isMainHeader = false;
@@ -1386,7 +1400,7 @@ namespace BinaryNinja
std::vector<std::pair<uint64_t, bool>> entryPoints;
std::vector<uint64_t> m_entryPoints; //list of entrypoints
- std::vector<std::pair<BNRelocationInfo, std::string>> externalRelocations;
+ std::vector<BoundRelocation> bindingRelocations;
std::vector<BNRelocationInfo> rebaseRelocations;
symtab_command symtab;