File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 2626from qiling .exception import QlErrorSyscallNotFound
2727from qiling .os .os import QlOs
2828from qiling .os .posix .const import NR_OPEN , errors
29- from qiling .utils import ql_get_module_function , ql_syscall_mapping_function
29+ from qiling .utils import ql_get_module_function
3030
3131SYSCALL_PREF : str = f'ql_syscall_'
3232
@@ -137,7 +137,7 @@ def __init__(self, ql: Qiling):
137137 }[self .ql .arch .type ](self .ql .arch )
138138
139139 # select syscall mapping function based on emulated OS and architecture
140- self .syscall_mapper = ql_syscall_mapping_function ( self .type , self .ql .arch .type )
140+ self .syscall_mapper = self .__get_syscall_mapper ( self .ql .arch .type )
141141
142142 self ._fd = QlFileDes ()
143143
@@ -150,6 +150,14 @@ def __init__(self, ql: Qiling):
150150
151151 self ._shms = {}
152152
153+ def __get_syscall_mapper (self , archtype : QL_ARCH ):
154+ qlos_path = f'.os.{ self .type .name .lower ()} .map_syscall'
155+ qlos_func = 'get_syscall_mapper'
156+
157+ func = ql_get_module_function (qlos_path , qlos_func )
158+
159+ return func (archtype )
160+
153161 @QlOs .stdin .setter
154162 def stdin (self , stream : TextIO ) -> None :
155163 self ._stdin = stream
Original file line number Diff line number Diff line change @@ -84,15 +84,6 @@ def ql_get_module_function(module_name: str, function_name: str):
8484
8585 return module_function
8686
87- # This function is extracted from os_setup (QlOsPosix) so I put it here.
88- def ql_syscall_mapping_function (ostype : QL_OS , archtype : QL_ARCH ):
89- qlos_name = ostype .name
90- qlos_path = f'qiling.os.{ qlos_name .lower ()} .map_syscall'
91- qlos_func = 'get_syscall_mapper'
92-
93- func = ql_get_module_function (qlos_path , qlos_func )
94-
95- return func (archtype )
9687
9788def __emu_env_from_pathname (path : str ) -> Tuple [Optional [QL_ARCH ], Optional [QL_OS ], Optional [QL_ENDIAN ]]:
9889 if os .path .isdir (path ) and path .endswith ('.kext' ):
You can’t perform that action at this time.
0 commit comments