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

IDA 7.3 - ValueError: Invalid chooser passed #34

Open
dedmen opened this issue Sep 1, 2019 · 4 comments
Open

IDA 7.3 - ValueError: Invalid chooser passed #34

dedmen opened this issue Sep 1, 2019 · 4 comments

Comments

@dedmen
Copy link

dedmen commented Sep 1, 2019

Kam1n0 v2.1 freshly installed.

Traceback (most recent call last):
  File "J:/Installs/IDA 7.3/plugins\Kam1n0\Manager.py", line 406, in activate
    self.callback(ctx)
  File "J:/Installs/IDA 7.3/plugins\Kam1n0\Manager.py", line 332, in open_cnn_manager
    form = ConnectionManagementForm(self)
  File "J:/Installs/IDA 7.3/plugins\Kam1n0\forms\ConnectionManagementForm.py", line 98, in __init__
    self.listView),
  File "J:\Installs\IDA 7.3\python\ida_kernwin.py", line 6035, in __init__
    raise ValueError("Invalid chooser passed.")
ValueError: Invalid chooser passed.

Ref: danielplohmann/apiscout#8

I tested Kam1n0 in late 2017 and couldn't get it to work, sad that now it again.. doesn't work.

@dedmen
Copy link
Author

dedmen commented Sep 1, 2019

Okey this is weird.

            print (chooser)
            print (isinstance(chooser, Choose))
            print (isinstance(chooser, Choose2))

->
<Kam1n0.forms.ConnectionManagementForm.ConnectionListView object at 0x0000005CEE526668>
False
True

It's creating a Choose2.
But inside ConnectionListView.init
print (IDAUtils.is_hexrays_v7())
prints "True" so it should be loading Choose, not Choose2.

Just editing ConnectionManagementForm.py and removing the is_hexrays_v7 check fixes it.
but that's ofc not a valid fix as that would break 6.x compat

@steven-hh-ding
Copy link
Contributor

Let me check. I am getting an IDA 7.3. Haven't tested on 7.3 yet. It looks like they change the Choose api again. Thanks!

@dedmen
Copy link
Author

dedmen commented Sep 3, 2019

The Choose API is not the problem I think.
https://github.com/McGill-DMaS/Kam1n0-Community/blob/master2.x/kam1n0-clients/ida-plugin/Kam1n0/forms/ConnectionManagementForm.py#L23-L29
This code, loads Choose2.
Even though
print (IDAUtils.is_hexrays_v7())
prints "True"
If I just force it to load Choose instead of Choose2 by just replacing that with

    from idaapi import Choose as Choose
    from ida_kernwin import Form, info
    from ida_idaapi import plugin_t

It works just fine. For some reason that v7 check there doesn't work right.

@MilesQLi
Copy link
Contributor

MilesQLi commented Sep 3, 2019

This could be solved by replacing

   def is_hexrays_v7():
       return idaapi.cvar.inf.version >= 700

with

   def is_hexrays_v7():
       return idaapi.IDA_SDK_VERSION >= 700

in Kam1n0/kam1n0-clients/ida-plugin/Kam1n0/IDAUtils.py

So, the pull request I started on 26 Mar should be able to solve it.

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

3 participants