this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Mach-O pre-10.6 exports support

+23 -5
+23 -5
src/libmach-o/MachOImpl.cpp
··· 382 382 m_base + (m_is64 ? sizeof(mach_header_64) : sizeof(mach_header)) 383 383 ); 384 384 385 - uint32_t* symtab = 0; 386 - uint32_t* dysyms = 0; 387 - const char* symstrtab = 0; 388 - dyld_info_command* dyinfo = 0; 385 + uint32_t* symtab = nullptr; 386 + uint32_t* dysyms = nullptr; 387 + const char* symstrtab = nullptr; 388 + dyld_info_command* dyinfo = nullptr; 389 + dysymtab_command* dysymtab_cmd = nullptr; 389 390 390 391 struct relocation_info *ext_relocinfo = 0, *loc_relocinfo = 0; 391 392 uint32_t ext_reloccount = 0, loc_reloccount = 0; ··· 511 512 512 513 case LC_DYSYMTAB: 513 514 { 514 - dysymtab_command* dysymtab_cmd = reinterpret_cast<dysymtab_command*>(cmds_ptr); 515 + dysymtab_cmd = reinterpret_cast<dysymtab_command*>(cmds_ptr); 515 516 516 517 LOGF("dysym:\n" 517 518 " ilocalsym=%u nlocalsym=%u\n" ··· 719 720 { 720 721 for (uint32_t i = 0; i < loc_reloccount; i++) 721 722 readInternalRelocation(&loc_relocinfo[i]); 723 + } 724 + } 725 + 726 + if (dysymtab_cmd != nullptr) 727 + { 728 + int expStart, expCount; 729 + expStart = dysymtab_cmd->iextdefsym; 730 + expCount = dysymtab_cmd->nextdefsym; 731 + 732 + for (int i = expStart; i < expStart+expCount; i++) 733 + { 734 + Export* exp = new Export; 735 + exp->name = m_symbols[i].name; 736 + exp->addr = m_symbols[i].addr; 737 + exp->flag = 0; 738 + exp->resolver = 0; 739 + m_exports.push_back(exp); 722 740 } 723 741 } 724 742 }