]> git.saurik.com Git - ldid.git/commitdiff
Add MH_OBJECT and BIND_* definitions for later use.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 1 Dec 2012 12:45:33 +0000 (04:45 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 1 Dec 2012 12:46:09 +0000 (04:46 -0800)
ldid.cpp

index 807c33362b9f67d4d90563423988208865316407..f561fa63ce0a6b32f8113628fdbbe0770eb52ab1 100644 (file)
--- 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) |