Shofel2_T124_python/venv/lib/python3.10/site-packages/qiling/host.py

34 lines
707 B
Python
Raw Normal View History

2024-05-25 16:45:07 +00:00
#!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
from functools import cached_property
from typing import Optional
import platform
from qiling import utils
from qiling.const import QL_OS, QL_ARCH
class QlHost:
"""Interface to the hosting platform.
"""
@cached_property
def os(self) -> Optional[QL_OS]:
"""Hosting platform OS type.
"""
system = platform.system()
return utils.os_convert(system)
@cached_property
def arch(self) -> Optional[QL_ARCH]:
"""Hosting platform architecture type.
"""
machine = platform.machine()
return utils.arch_convert(machine)