Skip to content

Commit 523f0a7

Browse files
committed
Fixed incapability to parse the dyld
1 parent 3a11549 commit 523f0a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parser/file/macho/machoFile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ static inline bool machoFile_handleFunctionStarts(struct machoFile* self, struct
256256
uint32_t offset = macho_maybeSwap(32, bitsReversed, command->dataoff);
257257
uint32_t size = macho_maybeSwap(32, bitsReversed, command->datasize);
258258

259-
const void* bytes = baseAddress + offset;
260-
uint64_t funcAddr = self->addressOffset;
259+
const void* bytes = baseAddress + offset + ((self->linkedit_vmaddr - self->text_vmaddr) - self->linkedit_fileoff);
260+
uint64_t funcAddr = 0;
261261
for (size_t i = 0; i < size;) {
262262
funcAddr += getULEB128(bytes, &i);
263263
vector_uint64_push_back(&self->functionStarts, funcAddr);

0 commit comments

Comments
 (0)