DYLD is missing, and i cant find it in any repo
DarKDevz opened this issue · comments
*Describe the bug
missing dyld library, and rootfs repo doesnt contain it, not sure what to do
the binary is extracted from a decrypted ipa, its the main executable on it
but it says its missing the /usb/lib/dyld , im on x64 MacOS
i wasnt able to find any info on this, any help is appreciated(even if the solution is using an m1 mac or similar)
File "/Users/icode/Desktop/Research/BsreCheats/BsreCheats/ios/emulate.py", line 17, in
main()
File "/Users/icode/Desktop/Research/BsreCheats/BsreCheats/ios/emulate.py", line 8, in main
ql = Qiling([dylib_path])
File "/Users/icode/Library/Python/3.9/lib/python/site-packages/qiling/core.py", line 190, in init
self.loader.run()
File "/Users/icode/Library/Python/3.9/lib/python/site-packages/qiling/loader/macho.py", line 149, in run
self.loadMacho()
File "/Users/icode/Library/Python/3.9/lib/python/site-packages/qiling/loader/macho.py", line 402, in loadMacho
self.dyld_file = MachoParser(self.ql, self.dyld_path)
File "/Users/icode/Library/Python/3.9/lib/python/site-packages/qiling/loader/macho_parser/parser.py", line 21, in init
self.binary_file = self.readFile(path)
File "/Users/icode/Library/Python/3.9/lib/python/site-packages/qiling/loader/macho_parser/parser.py", line 36, in readFile
with open(path, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: './usr/lib/dyld'
Sample Code
from qiling import Qiling
from qiling.const import QL_VERBOSE
import os
def main():
rootfs = os.path.abspath("")
dylib_path = os.path.join(rootfs, "main")
ql = Qiling([dylib_path])
try:
ql.run()
except Exception as e:
print(f"Error occurred: {e}")
if __name__ == "__main__":
main()Expected behavior
Emulation to work
TL;DR - use: rootfs = r"/" instead of an empty string.
Note that the error states that it cannot find './usr/lib/dyld' (note that dot at the beginning). It looks like you meant to use your host root as rootfs (which is not recommended, but it is your call) but you used the current directory instead (rootfs as empty string equals to current directory).