@@ -71,7 +71,7 @@ def arch_os_convert(arch: QL_ARCH) -> Optional[QL_OS]:
7171def ql_get_module_function (module_name : str , function_name : str ):
7272
7373 try :
74- imp_module = importlib .import_module (module_name )
74+ imp_module = importlib .import_module (module_name , 'qiling' )
7575 except ModuleNotFoundError :
7676 raise QlErrorModuleNotFound (f'Unable to import module { module_name } ' )
7777 except KeyError :
@@ -313,15 +313,15 @@ def select_loader(ostype: QL_OS, libcache: bool) -> QlClassInit['QlLoader']:
313313 QL_OS .BLOB : r'blob'
314314 }[ostype ]
315315
316- qlloader_path = f'qiling .loader.{ module } '
316+ qlloader_path = f'.loader.{ module } '
317317 qlloader_class = f'QlLoader{ module .upper ()} '
318318
319319 obj = ql_get_module_function (qlloader_path , qlloader_class )
320320
321321 return partial (obj , ** kwargs )
322322
323323def select_component (component_type : str , component_name : str , ** kwargs ) -> QlClassInit [Any ]:
324- component_path = f'qiling .{ component_type } .{ component_name } '
324+ component_path = f'.{ component_type } .{ component_name } '
325325 component_class = f'Ql{ component_name .capitalize ()} Manager'
326326
327327 obj = ql_get_module_function (component_path , component_class )
@@ -352,7 +352,7 @@ def select_debugger(options: Union[str, bool]) -> Optional[QlClassInit['QlDebugg
352352 else :
353353 raise QlErrorOutput ('Debugger not supported' )
354354
355- obj = ql_get_module_function (f'qiling .debugger.{ objname } .{ objname } ' , f'Ql{ str .capitalize (objname )} ' )
355+ obj = ql_get_module_function (f'.debugger.{ objname } .{ objname } ' , f'Ql{ str .capitalize (objname )} ' )
356356
357357 return partial (obj , ** kwargs )
358358
@@ -383,7 +383,7 @@ def select_arch(archtype: QL_ARCH, endian: QL_ENDIAN, thumb: bool) -> QlClassIni
383383 QL_ARCH .RISCV64 : r'riscv64'
384384 }[archtype ]
385385
386- qlarch_path = f'qiling .arch.{ module } '
386+ qlarch_path = f'.arch.{ module } '
387387 qlarch_class = f'QlArch{ archtype .name .upper ()} '
388388
389389 obj = ql_get_module_function (qlarch_path , qlarch_class )
@@ -392,7 +392,7 @@ def select_arch(archtype: QL_ARCH, endian: QL_ENDIAN, thumb: bool) -> QlClassIni
392392
393393def select_os (ostype : QL_OS ) -> QlClassInit ['QlOs' ]:
394394 qlos_name = ostype .name
395- qlos_path = f'qiling .os.{ qlos_name .lower ()} .{ qlos_name .lower ()} '
395+ qlos_path = f'.os.{ qlos_name .lower ()} .{ qlos_name .lower ()} '
396396 qlos_class = f'QlOs{ qlos_name .capitalize ()} '
397397
398398 obj = ql_get_module_function (qlos_path , qlos_class )
0 commit comments