laanwj / dwarf_to_c

Tool to recover C headers (types, function signatures) from DWARF debug data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError: 137

Racro opened this issue · comments

When I run the dwarf_to_c.py script with an ELF executable, I get KeyError: 137 because the entry for 137 in the ENum dict does not exist.
I am using ubuntu 20.04 and python v3.8 to run it.

Traceback (most recent call last):
  File "dwarf_to_c.py", line 363, in <module>
    main()
  File "dwarf_to_c.py", line 357, in main
    statements = parse_dwarf(args.input,args.cuname)
  File "dwarf_to_c.py", line 293, in parse_dwarf
    dwarf = DWARF(infile)
  File "/root/dwarf_to_c/src/bintools/dwarf/__init__.py", line 38, in __init__
    self.info = DebugInfoLoader(self)
  File "/root/dwarf_to_c/src/bintools/dwarf/info.py", line 182, in __init__
    cu = CU(dwarf, overall_offset)
  File "/root/dwarf_to_c/src/bintools/dwarf/info.py", line 120, in __init__
    die = DIE(dwarf, self, abbrevs, level)
  File "/root/dwarf_to_c/src/bintools/dwarf/info.py", line 74, in __init__
    a = Attrib(cu, attrib_form)
  File "/root/dwarf_to_c/src/bintools/dwarf/info.py", line 12, in __init__
    self.name = DW_AT[attrib_form.name_id]
  File "/root/dwarf_to_c/src/bintools/utils/__init__.py", line 78, in __getitem__
    return self.dict[key]
KeyError: 137