summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ldid.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/ldid.cpp b/ldid.cpp
index 807c333..f561fa6 100644
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -67,6 +67,7 @@ struct mach_header {
#define MH_DYLDLINK 0x4
+#define MH_OBJECT 0x1
#define MH_EXECUTE 0x2
#define MH_DYLIB 0x6
#define MH_BUNDLE 0x8
@@ -277,6 +278,22 @@ struct encryption_info_command {
uint32_t cryptid;
} _packed;
+#define BIND_OPCODE_MASK 0xf0
+#define BIND_IMMEDIATE_MASK 0x0f
+#define BIND_OPCODE_DONE 0x00
+#define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10
+#define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20
+#define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30
+#define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40
+#define BIND_OPCODE_SET_TYPE_IMM 0x50
+#define BIND_OPCODE_SET_ADDEND_SLEB 0x60
+#define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70
+#define BIND_OPCODE_ADD_ADDR_ULEB 0x80
+#define BIND_OPCODE_DO_BIND 0x90
+#define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xa0
+#define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xb0
+#define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xc0
+
uint16_t Swap_(uint16_t value) {
return
((value >> 8) & 0x00ff) |