Skip to content

Commit c4a046d

Browse files
authored
Merge pull request #1133 from profiles/master
add macho load command 'LC_LOAD_WEAK_DYLIB' support
2 parents b026d58 + 9bde07b commit c4a046d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

.github/workflows/giteesync.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
fetch-depth: 0
1212
- uses: xwings/sync-repo-action@master
1313
with:
14+
run: git config --global --add safe.directory *
1415
ssh_private_key: ${{ secrets.GITEE_KEY }}
1516
target_repo: ssh://[email protected]/qilingframework/qiling.git
1617

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)