change to blob

This commit is contained in:
cq
2021-11-13 17:19:01 +08:00
parent 8eaa06204b
commit 626b79d21d
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ class QL_OS(IntEnum):
EVM = 207
QNX = 208
MCU = 209
BARE = 210
BLOB = 210
class QL_VERBOSE(IntEnum):
OFF = 0
@@ -90,7 +90,7 @@ loader_map = {
QL_OS.DOS : "DOS",
QL_OS.EVM : "EVM",
QL_OS.MCU : "MCU",
QL_OS.BARE : "BARE"
QL_OS.BLOB : "BLOB"
}
arch_os_map = {
@@ -7,7 +7,7 @@ from qiling import Qiling
from qiling.loader.loader import QlLoader
from qiling.os.memory import QlMemoryHeap
class QlLoaderBARE(QlLoader):
class QlLoaderBLOB(QlLoader):
def __init__(self, ql: Qiling):
super().__init__(ql)
@@ -9,16 +9,16 @@ from qiling.const import QL_ARCH
from qiling.os.fcall import QlFunctionCall
from qiling.os.os import QlOs
class QlOsBare(QlOs):
""" QlOsBare for bare barines.
class QlOsBlob(QlOs):
""" QlOsBlob for bare barines.
For bare binary such as u-boot, it's ready to be mapped and executed directly,
where there is(may be) no concept of os? Currently, some functionalities such as
resolve_fcall_params(), heap or add_fs_mapper() are based on os. To keep the
consistence of api usage, QlOsBare is introduced and placed at its loader temporarily.
consistence of api usage, QlOsBlob is introduced and placed at its loader temporarily.
"""
def __init__(self, ql: Qiling):
super(QlOsBare, self).__init__(ql)
super(QlOsBlob, self).__init__(ql)
self.ql = ql
+1 -1
View File
@@ -51,7 +51,7 @@ class BlobTest(unittest.TestCase):
with open("../examples/rootfs/blob/u-boot.bin.img", "rb") as f:
uboot_code = f.read()
ql = Qiling(code=uboot_code[0x40:], archtype="arm", ostype="bare", profile="profiles/uboot_bin.ql", verbose=QL_VERBOSE.DEBUG)
ql = Qiling(code=uboot_code[0x40:], archtype="arm", ostype="blob", profile="profiles/uboot_bin.ql", verbose=QL_VERBOSE.DEBUG)
image_base_addr = ql.loader.load_address
ql.hook_address(my_getenv, image_base_addr + 0x13AC0)