Skip to content

Commit 0b1d25c

Browse files
committed
make unistd file location search dependent on platform
1 parent 6833d57 commit 0b1d25c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/0xtools/psnproc.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,13 @@ def extract_system_call_ids(unistd_64_fh):
322322
def get_system_call_names():
323323
psn_dir=os.path.dirname(os.path.realpath(__file__))
324324
kernel_ver=platform.release().split('-')[0]
325-
unistd_64_paths = ['/usr/include/asm-generic/unistd.h', '/usr/include/asm/unistd_64.h', '/usr/include/x86_64-linux-gnu/asm/unistd_64.h', '/usr/include/asm-x86_64/unistd.h', '/usr/include/asm/unistd.h', psn_dir+'/syscall_64_'+kernel_ver+'.h', psn_dir+'/syscall_64.h']
325+
326+
# this probably needds to be improved for better platform support
327+
if platform.machine() == 'aarch64':
328+
unistd_64_paths = ['/usr/include/asm-generic/unistd.h']
329+
else:
330+
unistd_64_paths = ['/usr/include/asm/unistd_64.h', '/usr/include/x86_64-linux-gnu/asm/unistd_64.h', '/usr/include/asm-x86_64/unistd.h', '/usr/include/asm/unistd.h', psn_dir+'/syscall_64_'+kernel_ver+'.h', psn_dir+'/syscall_64.h']
331+
326332
for path in unistd_64_paths:
327333
try:
328334
with open(path) as f:

0 commit comments

Comments
 (0)