Skip to content

UEFI does not work with qdb #1416

@dotCirill

Description

@dotCirill

The code (emulation of Combined DXE/SMM module):

from qiling import Qiling

if __name__ == "__main__":
    ql = Qiling([
        "files/SuperSMM_DXE_module.efi"
    ], "files")
    ql.debugger = "qdb"


    ql.run()

On 1.4.6 release and current master branch it dies with this error:

... init logs ...
Qdb> *several n (next-steps)*
AttributeError: 'QlOsUefi' object has no attribute 'smm'

backtrace:

# qiling/core.py
debugger(self) # self.os.run is below
# qiling/debugger/qdb/qdb.py
elf.dbg_hook(init_hook)
self.interactive()
self.cmdloop()
...
# qiling/core_hooks.py
hook.call(ql)
# qiling/core_hooks_types.py
self.callback(ql, *args)
# qiling/os/uefi/fncc.py
ql.os.call(pc, f, params, onenter, onexit)
self.fcall.call(func, proto, args, onenter, onexit, passthru)
# qiling/os/fcall.py
func(ql, pc, params)
# qiling/os/uefi/protocols/EfiSmmBase2Protocol.py
ql.log.debug(f'InSmram = {ql.os.smm.active}')

As I understand ql.os.run should be runned but it isn't.

On dev branch I have this backtrace:

ql.run()
# qiling/core.py
debugger = debugger(self) 
# qiling/debugger/qdb/qdb.py
if addr_elf_entry := getattr(self.ql.loader, 'elf_entry'):

AttributeError: 'QlLoaderPE_UEFI' object has no attribute 'elf_entry'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions