Skip to content

Commit e223e91

Browse files
author
xwings
committed
update __getdents_common to make macos 11.6 x86 work
1 parent 492bb1b commit e223e91

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

qiling/core_struct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, endian: QL_ENDIAN, bit: int):
3030
self._fmt32s = f'{modifier}i'
3131
self._fmt64 = f'{modifier}Q'
3232
self._fmt64s = f'{modifier}q'
33-
33+
3434
handlers = {
3535
64 : (self.pack64, self.pack64s, self.unpack64, self.unpack64s),
3636
32 : (self.pack32, self.pack32s, self.unpack32, self.unpack32s),

qiling/os/posix/syscall/unistd.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,13 @@ def _type_mapping(ent):
687687
d_type = _type_mapping(result)
688688
d_reclen = n + n + 2 + len(d_name) + 1
689689

690+
# TODO: Dirty fix for X8664 MACOS 11.6 APFS
691+
# For some reason MACOS return int value is 64bit
692+
try:
693+
packed_d_ino = (ql.pack(d_ino), n)
694+
except:
695+
packed_d_ino = (ql.pack64(d_ino), n)
696+
690697
if is_64:
691698
fields = (
692699
(ql.pack(d_ino), n),
@@ -697,7 +704,7 @@ def _type_mapping(ent):
697704
)
698705
else:
699706
fields = (
700-
(ql.pack(d_ino), n),
707+
packed_d_ino,
701708
(ql.pack(d_off), n),
702709
(ql.pack16(d_reclen), 2),
703710
(d_name, len(d_name)),

0 commit comments

Comments
 (0)