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

Pure Python Implementation #32

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

tmr232
Copy link
Contributor

@tmr232 tmr232 commented Jul 4, 2016

This is a pull request for a pure-Python implementation of the plugin, to solve #3.

It presently only does kernel creation. It looks funny, has unused code, and I did not test notebook support.
That said, connecting using IPython works 😄

@tmr232
Copy link
Contributor Author

tmr232 commented Jul 25, 2016

OK. It seems to work now.
@james91b can you give it a look?

The installation is simpler now:

  1. Install ipythonEmbed.py as a plugin;
  2. Install the kernels.

It seems to work just fine for me.

@james91b
Copy link
Owner

Nice!

I'm having a look now.

Some minor notes:

We can probably remove the try catch around the ipythonEmbed script imports, because it is no longer being called from C and i was getting some namespace errors because of it.

What version of IDA and IDAPython would this require?

We should also probably rename the python script to just be the plugin name.

@tmr232
Copy link
Contributor Author

tmr232 commented Jul 27, 2016

We probably can remove a lot of extra code. I just wanted to make sure it works before beatifying the code.

I think the minimal supported version is 6.7, but I am not sure.

Once you say that it works, I'd be more than happy to give the code a face-lift, removing all the parts that are no longer needed.

@james91b
Copy link
Owner

Seems to work well. I've only really tested the QTConsole so far. I have been having some issues with my python environment. When i have some more time on the weekend to i will look at the notebook.

But it is looking good!

@james91b
Copy link
Owner

Notebook is also looking good!

Would be great to get someone to test in on OSX or Linux as well.

Next Steps?

@tmr232
Copy link
Contributor Author

tmr232 commented Jul 31, 2016

Other than testing on OSX and Linux (volunteers needed) I think all that's left is cleanups.
Just don't count on me for the next 2 weeks.

@proind
Copy link

proind commented Nov 3, 2016

tested on OSX . couldn't get the qtconsole to work. didn't give any error, just wouldn't open.
I suspect it might be an issue with the installation of PyQt .
but opening IDA with the plugin and then typing in terminal : jupyter console --existing "json_file " worked just fine

@proind
Copy link

proind commented Nov 6, 2016

update on OSX : it randomly crashes with the following error

In [1]: /usr/local/lib/python2.7/site-packages/jupyter_console/ptshell.py:571: UserWarning: The kernel did not respond to an is_complete_request. Setting use_kernel_is_complete to False.
warn('The kernel did not respond to an is_complete_request. '
In [1]: In [1]:
Traceback (most recent call last):
File "/usr/local/bin/jupyter-console", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/usr/local/lib/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/usr/local/lib/python2.7/site-packages/jupyter_console/app.py", line 151, in start
self.shell.mainloop()
File "/usr/local/lib/python2.7/site-packages/jupyter_console/ptshell.py", line 463, in mainloop
self.interact()
File "/usr/local/lib/python2.7/site-packages/jupyter_console/ptshell.py", line 448, in interact
code = self.prompt_for_code()
File "/usr/local/lib/python2.7/site-packages/jupyter_console/ptshell.py", line 408, in prompt_for_code
reset_current_buffer=True)
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/interface.py", line 389, in run
self.eventloop.run(self.input, self.create_eventloop_callbacks())
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/eventloop/posix.py", line 153, in run
t()
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/eventloop/posix.py", line 81, in read_from_stdin
inputstream.feed(data)
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/terminal/vt100_input.py", line 390, in feed
self._input_parser.send(c)
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/terminal/vt100_input.py", line 299, in _input_parser_generator
self._call_handler(match, prefix)
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/terminal/vt100_input.py", line 332, in _call_handler
self.feed_key_callback(KeyPress(key, insert_text))
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/interface.py", line 1019, in feed_key
cli.input_processor.process_keys()
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/key_binding/input_processor.py", line 201, in process_keys
self._process_coroutine.send(key_press)
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/key_binding/input_processor.py", line 158, in _process
self._call_handler(matches[-1], key_sequence=buffer)
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/key_binding/input_processor.py", line 228, in _call_handler
handler.call(event)
File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/key_binding/registry.py", line 31, in call
return self.handler(event)
File "/usr/local/lib/python2.7/site-packages/jupyter_console/ptshell.py", line 342, in _
more, indent = self.check_complete(d.text)
File "/usr/local/lib/python2.7/site-packages/jupyter_console/ptshell.py", line 426, in check_complete
more = (code.splitlines()[-1] != "")
IndexError: list index out of range

@tmr232
Copy link
Contributor Author

tmr232 commented Nov 6, 2016

I'd be happy to help, but I don't have IDA for OSX.

@tmr232
Copy link
Contributor Author

tmr232 commented Dec 6, 2016

OK, updated the branch to go atop the recent fixes. Anything else missing here before we can go ahead with pure python?

@proind
Copy link

proind commented Dec 6, 2016 via email

@williballenthin
Copy link

i installed this branch on my new copy of IDA 6.95 (on linux, under wine, actually) and everything worked great! i like how getting the ipython kernel going is simply installing two pip dependencies and moving a .py file moved into plugins/. nice work everyone!

@tmr232
Copy link
Contributor Author

tmr232 commented Feb 12, 2017

So what is the current status?
I think it is wise to merge this even if we have Linux/OSX issues, given that the current version does not support them either.

This required an update to the new menu-creation API (v6.7).
I kept backwards compatibility.
@tmr232
Copy link
Contributor Author

tmr232 commented Jul 11, 2017

@james91b I added support for IDA 7. I'd be really happy for this to make it into the master branch. I've been using it for over a year now and it works perfectly on Windows.
@williballenthin anything from your end?

@williballenthin
Copy link

i've been using your branch for quite a while. i'm more comfortable sticking to pure python, instead of dealing with the binary dependencies.

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

Successfully merging this pull request may close these issues.

4 participants