2
0
Эх сурвалжийг харах

FreezeTool: Don't write blobinfo to wrong offset

The mechanism for searching for a specific symbol in a Mach-O binary got
tripped up when hitting the blobinfo stab entry, causing it to return an
offset of 0.
Donny Lawrence 5 жил өмнө
parent
commit
46ae5a52d3

+ 3 - 1
direct/src/dist/FreezeTool.py

@@ -2153,7 +2153,9 @@ class Freezer:
                     symoff += nlist_size
                     name = strings[strx : strings.find(b'\0', strx)]
 
-                    if name == b'_' + symbol_name:
+                    # If the entry's type has any bits at 0xe0 set, it's a debug
+                    # symbol, and will point us to the wrong place.
+                    if name == b'_' + symbol_name and type & 0xe0 == 0:
                         # Find out in which segment this is.
                         for vmaddr, vmsize, fileoff in segments:
                             # Is it defined in this segment?