MCPcopy Index your code
hub / github.com/qilingframework/qiling / select_loader

Function select_loader

qiling/utils.py:297–320  ·  view source on GitHub ↗
(ostype: QL_OS, libcache: bool)

Source from the content-addressed store, hash-verified

295
296
297def select_loader(ostype: QL_OS, libcache: bool) -> QlClassInit['QlLoader']:
298 kwargs = {}
299
300 if ostype is QL_OS.WINDOWS:
301 kwargs['libcache'] = libcache
302
303 module = {
304 QL_OS.LINUX : r'elf',
305 QL_OS.FREEBSD : r'elf',
306 QL_OS.QNX : r'elf',
307 QL_OS.MACOS : r'macho',
308 QL_OS.WINDOWS : r'pe',
309 QL_OS.UEFI : r'pe_uefi',
310 QL_OS.DOS : r'dos',
311 QL_OS.MCU : r'mcu',
312 QL_OS.BLOB : r'blob'
313 }[ostype]
314
315 qlloader_path = f'.loader.{module}'
316 qlloader_class = f'QlLoader{module.upper()}'
317
318 obj = ql_get_module_function(qlloader_path, qlloader_class)
319
320 return partial(obj, **kwargs)
321
322
323def select_component(component_type: str, component_name: str, **kwargs) -> QlClassInit[Any]:

Callers 1

__init__Method · 0.85

Calls 1

ql_get_module_functionFunction · 0.85

Tested by

no test coverage detected