| 1 |
# A valid MachO object with a weak-bind table following a bind table ending |
| 2 |
# with an effectively no-op opcode `BIND_OPCODE_SET_TYPE_IMM(1)` instead of |
| 3 |
# a `BIND_OPCODE_DONE` or an actual bind `BIND_OPCODE_DO_BIND[_*]`, following |
| 4 |
# a rebase table ending with an effectively no-op opcode |
| 5 |
# `REBASE_OPCODE_SET_TYPE_IMM(1)` instead of a `REBASE_OPCODE_DONE` or an |
| 6 |
# actual rebase `REBASE_OPCODE_DO_REBASE_*`. |
| 7 |
--- !mach-o |
| 8 |
FileHeader: |
| 9 |
magic: 0xFEEDFACF |
| 10 |
cputype: 0x100000C |
| 11 |
cpusubtype: 0x0 |
| 12 |
filetype: 0x6 |
| 13 |
ncmds: 15 |
| 14 |
sizeofcmds: 1232 |
| 15 |
flags: 0x118085 |
| 16 |
reserved: 0x0 |
| 17 |
LoadCommands: |
| 18 |
- cmd: LC_SEGMENT_64 |
| 19 |
cmdsize: 392 |
| 20 |
segname: __TEXT |
| 21 |
vmaddr: 0 |
| 22 |
vmsize: 32768 |
| 23 |
fileoff: 0 |
| 24 |
filesize: 32768 |
| 25 |
maxprot: 5 |
| 26 |
initprot: 5 |
| 27 |
nsects: 4 |
| 28 |
flags: 0 |
| 29 |
Sections: |
| 30 |
- sectname: __text |
| 31 |
segname: __TEXT |
| 32 |
addr: 0x4000 |
| 33 |
size: 32 |
| 34 |
offset: 0x4000 |
| 35 |
align: 2 |
| 36 |
reloff: 0x0 |
| 37 |
nreloc: 0 |
| 38 |
flags: 0x80000400 |
| 39 |
reserved1: 0x0 |
| 40 |
reserved2: 0x0 |
| 41 |
reserved3: 0x0 |
| 42 |
content: C0035FD6FD7BBFA9FD03009105000094000080D206000094FD7BC1A8C0035FD6 |
| 43 |
- sectname: __stubs |
| 44 |
segname: __TEXT |
| 45 |
addr: 0x4020 |
| 46 |
size: 24 |
| 47 |
offset: 0x4020 |
| 48 |
align: 2 |
| 49 |
reloff: 0x0 |
| 50 |
nreloc: 0 |
| 51 |
flags: 0x80000408 |
| 52 |
reserved1: 0x0 |
| 53 |
reserved2: 0xC |
| 54 |
reserved3: 0x0 |
| 55 |
content: 30000090100240F900021FD650000090100240F900021FD6 |
| 56 |
- sectname: __stub_helper |
| 57 |
segname: __TEXT |
| 58 |
addr: 0x4038 |
| 59 |
size: 36 |
| 60 |
offset: 0x4038 |
| 61 |
align: 2 |
| 62 |
reloff: 0x0 |
| 63 |
nreloc: 0 |
| 64 |
flags: 0x80000400 |
| 65 |
reserved1: 0x0 |
| 66 |
reserved2: 0x0 |
| 67 |
reserved3: 0x0 |
| 68 |
content: 5100009031220091F047BFA930000090100640F900021FD650000018F9FFFF1700000000 |
| 69 |
- sectname: __unwind_info |
| 70 |
segname: __TEXT |
| 71 |
addr: 0x405C |
| 72 |
size: 96 |
| 73 |
offset: 0x405C |
| 74 |
align: 2 |
| 75 |
reloff: 0x0 |
| 76 |
nreloc: 0 |
| 77 |
flags: 0x0 |
| 78 |
reserved1: 0x0 |
| 79 |
reserved2: 0x0 |
| 80 |
reserved3: 0x0 |
| 81 |
content: 010000001C000000000000001C000000000000001C00000002000000004000004000000040000000204000000000000040000000000000000000000000000000030000000C000200140002000000000004000001000000020000000400000000 |
| 82 |
- cmd: LC_SEGMENT_64 |
| 83 |
cmdsize: 152 |
| 84 |
segname: __DATA_CONST |
| 85 |
vmaddr: 32768 |
| 86 |
vmsize: 16384 |
| 87 |
fileoff: 32768 |
| 88 |
filesize: 16384 |
| 89 |
maxprot: 3 |
| 90 |
initprot: 3 |
| 91 |
nsects: 1 |
| 92 |
flags: 16 |
| 93 |
Sections: |
| 94 |
- sectname: __got |
| 95 |
segname: __DATA_CONST |
| 96 |
addr: 0x8000 |
| 97 |
size: 16 |
| 98 |
offset: 0x8000 |
| 99 |
align: 3 |
| 100 |
reloff: 0x0 |
| 101 |
nreloc: 0 |
| 102 |
flags: 0x6 |
| 103 |
reserved1: 0x2 |
| 104 |
reserved2: 0x0 |
| 105 |
reserved3: 0x0 |
| 106 |
content: '00400000000000000000000000000000' |
| 107 |
- cmd: LC_SEGMENT_64 |
| 108 |
cmdsize: 232 |
| 109 |
segname: __DATA |
| 110 |
vmaddr: 49152 |
| 111 |
vmsize: 16384 |
| 112 |
fileoff: 49152 |
| 113 |
filesize: 16384 |
| 114 |
maxprot: 3 |
| 115 |
initprot: 3 |
| 116 |
nsects: 2 |
| 117 |
flags: 0 |
| 118 |
Sections: |
| 119 |
- sectname: __la_symbol_ptr |
| 120 |
segname: __DATA |
| 121 |
addr: 0xC000 |
| 122 |
size: 8 |
| 123 |
offset: 0xC000 |
| 124 |
align: 3 |
| 125 |
reloff: 0x0 |
| 126 |
nreloc: 0 |
| 127 |
flags: 0x7 |
| 128 |
reserved1: 0x4 |
| 129 |
reserved2: 0x0 |
| 130 |
reserved3: 0x0 |
| 131 |
content: '5040000000000000' |
| 132 |
- sectname: __data |
| 133 |
segname: __DATA |
| 134 |
addr: 0xC008 |
| 135 |
size: 8 |
| 136 |
offset: 0xC008 |
| 137 |
align: 3 |
| 138 |
reloff: 0x0 |
| 139 |
nreloc: 0 |
| 140 |
flags: 0x0 |
| 141 |
reserved1: 0x0 |
| 142 |
reserved2: 0x0 |
| 143 |
reserved3: 0x0 |
| 144 |
content: '0000000000000000' |
| 145 |
- cmd: LC_SEGMENT_64 |
| 146 |
cmdsize: 72 |
| 147 |
segname: __LINKEDIT |
| 148 |
vmaddr: 65536 |
| 149 |
vmsize: 16384 |
| 150 |
fileoff: 65536 |
| 151 |
filesize: 272 |
| 152 |
maxprot: 1 |
| 153 |
initprot: 1 |
| 154 |
nsects: 0 |
| 155 |
flags: 0 |
| 156 |
- cmd: LC_ID_DYLIB |
| 157 |
cmdsize: 48 |
| 158 |
dylib: |
| 159 |
name: 24 |
| 160 |
timestamp: 1 |
| 161 |
current_version: 0 |
| 162 |
compatibility_version: 0 |
| 163 |
Content: '@rpath/libtest.dylib' |
| 164 |
ZeroPadBytes: 4 |
| 165 |
- cmd: LC_DYLD_INFO_ONLY |
| 166 |
cmdsize: 48 |
| 167 |
rebase_off: 65536 |
| 168 |
rebase_size: 8 |
| 169 |
bind_off: 65544 |
| 170 |
bind_size: 24 |
| 171 |
weak_bind_off: 65568 |
| 172 |
weak_bind_size: 16 |
| 173 |
lazy_bind_off: 65584 |
| 174 |
lazy_bind_size: 16 |
| 175 |
export_off: 65600 |
| 176 |
export_size: 40 |
| 177 |
- cmd: LC_SYMTAB |
| 178 |
cmdsize: 24 |
| 179 |
symoff: 65648 |
| 180 |
nsyms: 5 |
| 181 |
stroff: 65752 |
| 182 |
strsize: 56 |
| 183 |
- cmd: LC_DYSYMTAB |
| 184 |
cmdsize: 80 |
| 185 |
ilocalsym: 0 |
| 186 |
nlocalsym: 1 |
| 187 |
iextdefsym: 1 |
| 188 |
nextdefsym: 2 |
| 189 |
iundefsym: 3 |
| 190 |
nundefsym: 2 |
| 191 |
tocoff: 0 |
| 192 |
ntoc: 0 |
| 193 |
modtaboff: 0 |
| 194 |
nmodtab: 0 |
| 195 |
extrefsymoff: 0 |
| 196 |
nextrefsyms: 0 |
| 197 |
indirectsymoff: 65728 |
| 198 |
nindirectsyms: 5 |
| 199 |
extreloff: 0 |
| 200 |
nextrel: 0 |
| 201 |
locreloff: 0 |
| 202 |
nlocrel: 0 |
| 203 |
- cmd: LC_UUID |
| 204 |
cmdsize: 24 |
| 205 |
uuid: 3A5ED8A0-F9D2-35D8-8C0E-4914289341CC |
| 206 |
- cmd: LC_BUILD_VERSION |
| 207 |
cmdsize: 32 |
| 208 |
platform: 2 |
| 209 |
minos: 1114112 |
| 210 |
sdk: 1179648 |
| 211 |
ntools: 1 |
| 212 |
Tools: |
| 213 |
- tool: 3 |
| 214 |
version: 73073920 |
| 215 |
- cmd: LC_SOURCE_VERSION |
| 216 |
cmdsize: 16 |
| 217 |
version: 0 |
| 218 |
- cmd: LC_ENCRYPTION_INFO_64 |
| 219 |
cmdsize: 24 |
| 220 |
cryptoff: 16384 |
| 221 |
cryptsize: 16384 |
| 222 |
cryptid: 0 |
| 223 |
pad: 0 |
| 224 |
- cmd: LC_LOAD_DYLIB |
| 225 |
cmdsize: 56 |
| 226 |
dylib: |
| 227 |
name: 24 |
| 228 |
timestamp: 2 |
| 229 |
current_version: 88539136 |
| 230 |
compatibility_version: 65536 |
| 231 |
Content: '/usr/lib/libSystem.B.dylib' |
| 232 |
ZeroPadBytes: 6 |
| 233 |
- cmd: LC_FUNCTION_STARTS |
| 234 |
cmdsize: 16 |
| 235 |
dataoff: 65640 |
| 236 |
datasize: 8 |
| 237 |
- cmd: LC_DATA_IN_CODE |
| 238 |
cmdsize: 16 |
| 239 |
dataoff: 65648 |
| 240 |
datasize: 0 |
| 241 |
LinkEditData: |
| 242 |
RebaseOpcodes: |
| 243 |
- Opcode: REBASE_OPCODE_SET_TYPE_IMM |
| 244 |
Imm: 1 |
| 245 |
- Opcode: REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB |
| 246 |
Imm: 1 |
| 247 |
ExtraData: [ 0x0 ] |
| 248 |
- Opcode: REBASE_OPCODE_DO_REBASE_IMM_TIMES |
| 249 |
Imm: 1 |
| 250 |
- Opcode: REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB |
| 251 |
Imm: 2 |
| 252 |
ExtraData: [ 0x0 ] |
| 253 |
- Opcode: REBASE_OPCODE_DO_REBASE_IMM_TIMES |
| 254 |
Imm: 1 |
| 255 |
- Opcode: REBASE_OPCODE_SET_TYPE_IMM |
| 256 |
Imm: 1 |
| 257 |
BindOpcodes: |
| 258 |
- Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM |
| 259 |
Imm: 1 |
| 260 |
Symbol: '' |
| 261 |
- Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM |
| 262 |
Imm: 0 |
| 263 |
Symbol: dyld_stub_binder |
| 264 |
- Opcode: BIND_OPCODE_SET_TYPE_IMM |
| 265 |
Imm: 1 |
| 266 |
Symbol: '' |
| 267 |
- Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB |
| 268 |
Imm: 1 |
| 269 |
ULEBExtraData: [ 0x8 ] |
| 270 |
Symbol: '' |
| 271 |
- Opcode: BIND_OPCODE_DO_BIND |
| 272 |
Imm: 0 |
| 273 |
Symbol: '' |
| 274 |
- Opcode: BIND_OPCODE_SET_TYPE_IMM |
| 275 |
Imm: 1 |
| 276 |
Symbol: '' |
| 277 |
WeakBindOpcodes: |
| 278 |
- Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM |
| 279 |
Imm: 0 |
| 280 |
Symbol: _foo |
| 281 |
- Opcode: BIND_OPCODE_SET_TYPE_IMM |
| 282 |
Imm: 1 |
| 283 |
Symbol: '' |
| 284 |
- Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB |
| 285 |
Imm: 1 |
| 286 |
ULEBExtraData: [ 0x0 ] |
| 287 |
Symbol: '' |
| 288 |
- Opcode: BIND_OPCODE_DO_BIND |
| 289 |
Imm: 0 |
| 290 |
Symbol: '' |
| 291 |
- Opcode: BIND_OPCODE_DONE |
| 292 |
Imm: 0 |
| 293 |
Symbol: '' |
| 294 |
LazyBindOpcodes: |
| 295 |
- Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB |
| 296 |
Imm: 2 |
| 297 |
ULEBExtraData: [ 0x0 ] |
| 298 |
Symbol: '' |
| 299 |
- Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM |
| 300 |
Imm: 1 |
| 301 |
Symbol: '' |
| 302 |
- Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM |
| 303 |
Imm: 0 |
| 304 |
Symbol: _free |
| 305 |
- Opcode: BIND_OPCODE_DO_BIND |
| 306 |
Imm: 0 |
| 307 |
Symbol: '' |
| 308 |
- Opcode: BIND_OPCODE_DONE |
| 309 |
Imm: 0 |
| 310 |
Symbol: '' |
| 311 |
- Opcode: BIND_OPCODE_DONE |
| 312 |
Imm: 0 |
| 313 |
Symbol: '' |
| 314 |
- Opcode: BIND_OPCODE_DONE |
| 315 |
Imm: 0 |
| 316 |
Symbol: '' |
| 317 |
- Opcode: BIND_OPCODE_DONE |
| 318 |
Imm: 0 |
| 319 |
Symbol: '' |
| 320 |
- Opcode: BIND_OPCODE_DONE |
| 321 |
Imm: 0 |
| 322 |
Symbol: '' |
| 323 |
ExportTrie: |
| 324 |
TerminalSize: 0 |
| 325 |
NodeOffset: 0 |
| 326 |
Name: '' |
| 327 |
Flags: 0x0 |
| 328 |
Address: 0x0 |
| 329 |
Other: 0x0 |
| 330 |
ImportName: '' |
| 331 |
Children: |
| 332 |
- TerminalSize: 0 |
| 333 |
NodeOffset: 21 |
| 334 |
Name: _ |
| 335 |
Flags: 0x0 |
| 336 |
Address: 0x0 |
| 337 |
Other: 0x0 |
| 338 |
ImportName: '' |
| 339 |
Children: |
| 340 |
- TerminalSize: 4 |
| 341 |
NodeOffset: 9 |
| 342 |
Name: bar |
| 343 |
Flags: 0x0 |
| 344 |
Address: 0x4004 |
| 345 |
Other: 0x0 |
| 346 |
ImportName: '' |
| 347 |
- TerminalSize: 4 |
| 348 |
NodeOffset: 15 |
| 349 |
Name: foo |
| 350 |
Flags: 0x4 |
| 351 |
Address: 0x4000 |
| 352 |
Other: 0x0 |
| 353 |
ImportName: '' |
| 354 |
NameList: |
| 355 |
- n_strx: 35 |
| 356 |
n_type: 0xE |
| 357 |
n_sect: 7 |
| 358 |
n_desc: 0 |
| 359 |
n_value: 49160 |
| 360 |
- n_strx: 2 |
| 361 |
n_type: 0xF |
| 362 |
n_sect: 1 |
| 363 |
n_desc: 0 |
| 364 |
n_value: 16388 |
| 365 |
- n_strx: 7 |
| 366 |
n_type: 0xF |
| 367 |
n_sect: 1 |
| 368 |
n_desc: 128 |
| 369 |
n_value: 16384 |
| 370 |
- n_strx: 12 |
| 371 |
n_type: 0x1 |
| 372 |
n_sect: 0 |
| 373 |
n_desc: 256 |
| 374 |
n_value: 0 |
| 375 |
- n_strx: 18 |
| 376 |
n_type: 0x1 |
| 377 |
n_sect: 0 |
| 378 |
n_desc: 256 |
| 379 |
n_value: 0 |
| 380 |
StringTable: |
| 381 |
- ' ' |
| 382 |
- _bar |
| 383 |
- _foo |
| 384 |
- _free |
| 385 |
- dyld_stub_binder |
| 386 |
- __dyld_private |
| 387 |
- '' |
| 388 |
- '' |
| 389 |
- '' |
| 390 |
- '' |
| 391 |
- '' |
| 392 |
- '' |
| 393 |
IndirectSymbols: [ 0x2, 0x3, 0x2, 0x4, 0x3 ] |
| 394 |
FunctionStarts: [ 0x4000, 0x4004 ] |
| 395 |
... |