ioncodes / idacode

An integration for IDA and VS Code which connects both to easily execute and debug IDAPython scripts.
709 stars 77 forks source link

Cannot debug plugins #44

Open lab313ru opened 6 days ago

lab313ru commented 6 days ago

The problem is in hooks/getcwd_hook() func:

def getcwd_hook():
    global script_folder

    cwd = getcwd_original()
    if cwd.lower() in script_folder.lower() and script_folder.lower() != cwd.lower():
        cwd = script_folder
    return cwd

It checks for cwd in script_folder which is impossible when you're trying to debug your plugin. Because cwd will be the opened binary path, not the specified by set_script_folder() call.

I think to fix that if cwd.lower() in script_folder.lower() part should be removed.

lab313ru commented 6 days ago

And it really works: just remove first part of the condition.