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

Two one-line patches #23

Closed
RolfRolles opened this issue May 2, 2021 · 2 comments
Closed

Two one-line patches #23

RolfRolles opened this issue May 2, 2021 · 2 comments

Comments

@RolfRolles
Copy link

RolfRolles commented May 2, 2021

Hi, thanks for your plugin; it helped me. I had two small issues with using it, both of which I fixed (with one line of code apiece).

The plugin advertises Python 2.x support. In the current plugin.py, you put import asyncio to apparently get around some issue with tornado. This is not available on Python 2.x (I know, I need to update). I simply commented out this line. You might want to guard it by a version check for 3.0 or above, similar to what you do elsewhere throughout that file. (Edit: I see that PR #13 already addresses this.)

Secondly, in socket_handler.py, I experienced the issue where debugpy attempted to spawn the current process -- that is, the IDA executable -- when listening for connections. I had debug output like:

I+00021.467: debugpy.listen() spawning adapter: [
                 "C:\\Program Files\\IDA Pro 7.6\\ida64.exe", 
                 "C:\\Users\\Dev\\AppData\\Roaming\\Python\\Python27\\site-packages\\debugpy\\adapter", 

That first line is supposed to be the path to the Python interpreter, e.g., settings.PYTHON. After reading through debugpy, I can see that it consults sys.executable to obtain the path to the process that should be spawned. Presumably, this is why you modify this variable in your setup_patches function. However, the debugpy module gets loaded before setup_patches is called, which means that this technique does not work.

It turns out that you can instruct debugpy directly as to which executable to spawn. In socket_handler.py, I added one line of code before the call to listen:

debugpy.configure({"python": settings.PYTHON})

After both patches -- and installing the official Python extension for VSCode, as well as learning about the command pallette -- everything worked for me.

@ioncodes
Copy link
Owner

ioncodes commented May 3, 2021

Thanks a lot, Rolf! I"m currently on birthday vacation but I"ll definitely get this pushed as soon as I"m back (end of this week). :)

ioncodes added a commit that referenced this issue May 18, 2021
@ioncodes
Copy link
Owner

Hey Rolf, can you confirm that the implemented changes reflect your solution?

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

2 participants