Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.

Commit b721af5

Browse files
committed
update
1 parent e30bb02 commit b721af5

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/DyldExtractor/converter/objc_fixer.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,14 +1045,16 @@ def _processMethodList(self, methodListAddr: int, noImp=False) -> int:
10451045

10461046
if methodDef.name:
10471047
nameAddr = methodAddr + methodDef.name
1048-
if (newNameAddr := self._processString(nameAddr)) is not None:
1048+
if (newNameAddr := self._processString(nameAddr, _logString=False)) is not None:
10491049
methodDef.name = newNameAddr - methodAddr
10501050

10511051
relativeFixups.append((methodOff, newNameAddr))
10521052
else:
10531053
methodDef.name = 0
1054-
self._logger.warning(f"Unable to get string for method at {hex(methodAddr)}") # noqa
1054+
self._logger.warning(f"Unable to get string at {hex(nameAddr)}, for method def at {hex(methodAddr)}") # noqa
10551055
pass
1056+
else:
1057+
self._logger.debug("Null method name")
10561058

10571059
if methodDef.types:
10581060
typesAddr = methodAddr + 4 + methodDef.types
@@ -1111,7 +1113,7 @@ def _processMethodList(self, methodListAddr: int, noImp=False) -> int:
11111113
self._methodListCache[methodListAddr] = newMethodListAddr
11121114
return newMethodListAddr
11131115

1114-
def _processString(self, stringAddr: int) -> int:
1116+
def _processString(self, stringAddr: int, _logString=False) -> int:
11151117
if stringAddr in self._stringCache:
11161118
return self._stringCache[stringAddr]
11171119

@@ -1128,6 +1130,9 @@ def _processString(self, stringAddr: int) -> int:
11281130

11291131
stringData = ctx.fileCtx.readString(stringOff)
11301132
self._addExtraData(stringData)
1133+
1134+
if _logString:
1135+
self._logger.debug(stringData)
11311136
pass
11321137

11331138
self._stringCache[stringAddr] = newStringAddr

src/DyldExtractor/structure.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def __str__(self) -> str:
3838

3939
if isinstance(fieldData, ctypes.Array):
4040
fieldData = list(fieldData)
41+
elif isinstance(fieldData, int):
42+
fieldData = hex(fieldData)
4143

4244
string += f"\n\t{field[0]}: {fieldData}"
4345

tests/run_all_images_multiprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _workerInitializer():
180180
dyldFileCtx = FileContext(f)
181181
dyldCtx = DyldContext(dyldFileCtx)
182182

183-
for index, image in enumerate(dyldCtx.images[2000:], 2000):
183+
for index, image in enumerate(dyldCtx.images):
184184
imagePath = dyldCtx.fileCtx.readString(image.pathFileOffset)[0:-1]
185185
imagePath = imagePath.decode("utf-8")
186186
imageName = imagePath.split("/")[-1]

0 commit comments

Comments
 (0)