PoC 1.0 #1

Merged
nganhkhoa merged 15 commits from merge into main 2024-01-10 15:37:59 +07:00
Showing only changes of commit 07f361d8ac - Show all commits

View File

@ -619,7 +619,15 @@ func (mc *MachoContext) RewriteImportsTable(keepSymbols []string) {
// but because we keep a few symbols, we need to rewrite the pointers // but because we keep a few symbols, we need to rewrite the pointers
// as well as rebuild the import table and strings table, and bind values // as well as rebuild the import table and strings table, and bind values
// we keep all symbols that are referenced by libintl.8.dylib // some symbols are annoyingly distributed by another library
// dispite the name asking for X, the dyld loads a Y library
// LC_DYLD_ID of Y is equal to X and dyld can resolve these symbols
// because we do not search for library using LC_DYLD_ID,
// paths are mistaken and will not resolve symbols
//
// the most common library that has this behavior is libintl
// and fixing the resolver takes time, we temporarily ignore this library
// and so we keep symbols referenced by libintl
intlSymbols := []string{} intlSymbols := []string{}
for _, symbol := range allSymbols { for _, symbol := range allSymbols {
if symbol.Dylib() == "/usr/local/opt/gettext/lib/libintl.8.dylib" { if symbol.Dylib() == "/usr/local/opt/gettext/lib/libintl.8.dylib" {