Skip to content

Not correctly handling the case where "authored" is null in json #8

@imlk0

Description

@imlk0

What happened?

Every time I move the mouse over a MUL Instruction(e.g. MUL X1, X1, X2), idapython prints this error message

Exception in ida_kernwin.UI_Hooks dispatcher function: SWIG director method error. Error detected when calling 'UI_Hooks.get_custom_viewer_hint'
Traceback (most recent call last):
  File "//xxxxx/ida-pro/plugins/amie.py", line 370, in get_custom_viewer_hint
    hint = self.arch.hint(place.toea(), tag, val)
  File "//xxxxx/ida-pro/plugins/amie.py", line 131, in hint
    desc += "\n\n" + "\n".join(insn["templates"][tmpl_name])
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

Possible reasons

By reading the source code, I think this is because the value of "authored" field of the MUL instruction in aarch64.json is null.

      "MUL_MADD": {
        "authored": null,
        "heading": "MUL",
        "templates": {
          "GENERAL": [
            "MUL  <Wd>, <Wn>, <Wm>",
            "MUL  <Xd>, <Xn>, <Xm>"
          ]
        }
      },

I don't know why "authored" is set to null, it might be a bug with the parser for generating aarch64.josn. But I think it would be good to add the handling of None type in amie.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions