Skip to content

Commit 9cab7c3

Browse files
add macho load command 'LC_LOAD_WEAK_DYLIB' support
1 parent 263ad9c commit 9cab7c3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

qiling/loader/macho_parser/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
LC_LOAD_DYLINKER = 0x0000000E
4646
LC_MAIN = 0x80000028
4747
LC_LOAD_DYLIB = 0x0000000C
48+
LC_LOAD_WEAK_DYLIB = 0x80000018
4849
LC_ENCRYPTION_INFO_64 = 0x0000002C
4950
LC_BUILD_VERSION = 0x00000032
5051
LC_DYLD_EXPORTS_TRIE = 0x80000033

qiling/loader/macho_parser/loadcommand.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def get_complete(self):
3939
LC_LOAD_DYLINKER : LoadDylinker,
4040
LC_MAIN : LoadMain,
4141
LC_LOAD_DYLIB : LoadDyLib,
42+
LC_LOAD_WEAK_DYLIB : LoadWeakDyLib,
4243
LC_ENCRYPTION_INFO_64 : LoadEncryptionInfo64,
4344
LC_DYLD_EXPORTS_TRIE : LoadDyldExportTrie,
4445
LC_DYLD_CHAINED_FIXUPS : LoadDyldChainedFixups,
@@ -255,6 +256,11 @@ def get_complete(self):
255256
pass
256257

257258

259+
class LoadWeakDyLib(LoadDyLib):
260+
def __init__(self, data):
261+
super().__init__(data)
262+
263+
258264
class LoadUnixThread(LoadCommand):
259265

260266
def __init__(self, data):

0 commit comments

Comments
 (0)