Skip to content

UEFI Emulation debugging with gdb doesn't work at latest version of qiling #1241

@kimg00n

Description

@kimg00n

UEFI emulation debugging in qiling v1.4.4 doesn't work but v1.4.3 work

  • I'm still a beginner at qiling, so I don't know qiling well, but UEFI debugging doesn't work in the latest version of qiling.
  • My environment
    • Python 3.8.10
    • WSL2 Ubuntu 20.04

Sample Code

from qiling import *
from qiling.const import QL_VERBOSE

ql = Qiling(["TcgPlatformSetupPolicy_body.efi"], ".", env = "nvram.pickle", verbose=QL_VERBOSE.DEFAULT)
ql.debugger = True
ql.run()

normal behavior

[=]     DXE heap at 0x04000000
[=]     DXE stack at 0x0507fff0
[=]     Global tables:
[=]      | gST   0x04000000
[=]      | gBS   0x04000078
[=]      | gRT   0x040001f0
........
[=]     Running from 0x00100320 of TcgPlatformSetupPolicy_body.efi
[=]     gdb> stopped at entry point: 0x100320
[=]     gdb> listening on 127.0.01:9999

In latest version

[=]     DXE heap at 0x04000000
[=]     DXE stack at 0x0507fff0
[=]     Global tables:
[=]      | gST   0x04000000
[=]      | gBS   0x04000078
[=]      | gRT   0x040001f0
[=]      | gDS   0x04000278
.....
[=]     Running from 0x00100320 of TcgPlatformSetupPolicy_body.efi
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    ql.run()
  File "/home/kimg00n/.local/lib/python3.8/site-packages/qiling/core.py", line 561, in run
    debugger = debugger(self)
  File "/home/kimg00n/.local/lib/python3.8/site-packages/qiling/debugger/gdb/gdb.py", line 109, in __init__
    self.ql.add_fs_mapper(r'/proc/42000/maps',  QlFsMappedCallable(QlProcFS.self_map, self.ql.mem))
  File "/home/kimg00n/.local/lib/python3.8/site-packages/qiling/core.py", line 656, in add_fs_mapper
    self.os.fs_mapper.add_fs_mapping(ql_path, real_dest)
AttributeError: 'QlOsUefi' object has no attribute 'fs_mapper'

Metadata

Metadata

Assignees

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