qiling
qiling copied to clipboard
UEFI does not work with qdb
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'
Hi, I think it should be getattr(self.ql.loader, 'elf_entry', None)
, please let me know if this fix the issue.
Hi, it seems to be OK with that (should be fixed in do_show
and gdb_hook
).
is this fixed?
is this fixed?
Yes qdb works after the fix