Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ghida_plugin/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,15 @@ def ghidra_headless(address,
time.sleep(SLEEP_LENGTH)
counter += 1
subprocess.Popen.poll(p)
if os.name != 'posix':
(out, err) = p.communicate()
out = out.decode('utf-8')
err = err.decode('utf-8')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err may sometimes be None, you can fix this with

if os.name != 'posix':
    (out, err) = p.communicate()
    if out is not None:
        out = out.decode('utf-8')
    #else:
    #    print("GhIDA:: [DEBUG] out from process is None")
    if err is not None:
        err = err.decode('utf-8')
    #else:
    #    print("GhIDA:: [DEBUG] err from process is None")


# Process terminated
if p.returncode is not None:
# print("GhIDA:: [DEBUG] ", str(p.stdout.read(), 'utf-8'))
#print("GhIDA:: [DEBUG] ", out)
stop = True
print("GhIDA:: [INFO] Ghidra analysis completed!")
continue
Expand Down