Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
imlk0 opened this issue Dec 22, 2021 · 0 comments
Open

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

imlk0 opened this issue Dec 22, 2021 · 0 comments

Comments

@imlk0
Copy link

imlk0 commented Dec 22, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant