this repo has no description
1
fork

Configure Feed

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

Fixes for classic weak binds with NULL value + some working 32bit new/new[]

+47 -3
+11 -2
src/dyld/MachOLoader.cpp
··· 377 377 else 378 378 { 379 379 if (bind->is_classic) 380 + //if (false) 380 381 { 381 - writeBind(bind->type, ptr, uintptr_t(bind->value)); 382 - last_weak_sym = uintptr_t(bind->value); 382 + uintptr_t addr = bind->value; 383 + if (!addr) 384 + { 385 + LOG << "Trying to resolve classic,weak,null\n"; 386 + addr = (uintptr_t) __darwin_dlsym(__DARLING_RTLD_STRONG, name.c_str()); 387 + } 388 + LOG << "Bind (classic, weak) @" << ptr << " -> " << std::hex << uintptr_t(addr) << std::dec << std::endl; 389 + 390 + writeBind(bind->type, ptr, uintptr_t(addr)); 391 + last_weak_sym = uintptr_t(addr); 383 392 } 384 393 else 385 394 {
+2
src/libSystem/libc/namemap.lst
··· 17 17 64!_ZNSt15basic_streambufIwSt11char_traitsIwEE10pubseekoffExSt12_Ios_SeekdirSt13_Ios_Openmode;_ZNSt15basic_streambufIwSt11char_traitsIwEE10pubseekoffElSt12_Ios_SeekdirSt13_Ios_Openmode 18 18 64!_ZNSt12strstreambuf7seekoffExSt12_Ios_SeekdirSt13_Ios_Openmode;_ZNSt12strstreambuf7seekoffElSt12_Ios_SeekdirSt13_Ios_Openmode 19 19 20 + 32!_Znwm;_Znwj 21 + 32!_Znam;_Znaj 20 22 21 23 opendir$INODE64;opendir 22 24 CC_MD5_Init;MD5_Init
+34 -1
src/util/genfuncmap.cpp
··· 11 11 std::ifstream ifs(argv[1]); 12 12 std::ofstream ofs(argv[2]); 13 13 14 + ofs << "section .note.GNU-stack noalloc noexec nowrite progbits\n"; 15 + ofs << "%ifidn __OUTPUT_FORMAT__, elf\n" 16 + "extern _GLOBAL_OFFSET_TABLE_\n"; 17 + ofs << "global ebxsave\n" 18 + "section .tbss\nalign 4\n" 19 + "ebxsave: dd 0\n" 20 + 21 + "section .text\n" 22 + 23 + "%macro EbxGet 0\n" 24 + "mov eax, ebx\n" 25 + "call .get_GOT\n" 26 + ".get_GOT:\n" 27 + "pop ebx\n" 28 + "add ebx, _GLOBAL_OFFSET_TABLE_+$$-.get_GOT wrt ..gotpc\n" 29 + "mov ecx, [ebxsave wrt ..tlsie]\n" 30 + "mov [gs:ecx], eax\n" 31 + "%endmacro\n" 32 + 33 + "%macro EbxRestore 0\n" 34 + "mov ecx, [ebxsave wrt ..tlsie]\n" 35 + "mov ebx, [gs:ecx]\n" 36 + "%endmacro\n" 37 + 38 + "%else\n" 39 + 40 + "%macro EbxGet 0\n%endmacro\n" 41 + "%macro EbxRestore 0\n%endmacro\n" 42 + 43 + "%endif\n"; 44 + 14 45 while (std::getline(ifs, line)) 15 46 { 16 47 if (line.empty()) ··· 42 73 ofs << "global " << tok[0] << std::endl 43 74 << "extern " << tok[1] << std::endl 44 75 << tok[0] << ":\n" 45 - << "\tjmp " << tok[1] << " WRT ..plt\n"; 76 + << "\tEbxGet\n" 77 + << "\tjmp " << tok[1] << " WRT ..plt\n" 78 + << "\tEbxRestore\n"; 46 79 47 80 if (o32 || o64) 48 81 ofs << "%endif\n";