Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error message #4

Open
croghostrider opened this issue Apr 22, 2019 · 5 comments
Open

Error message #4

croghostrider opened this issue Apr 22, 2019 · 5 comments

Comments

@croghostrider
Copy link

Hi
if I try to run the binwalk or the yara script I receive the following message in the console:

yara.py> Running...
CRC32_poly_Constant /root/winbin/test.exe
Failed
'NoneType' object has no attribute 'setComment'
yara.py> Finished!
@ettermyra
Copy link

Got the same 'NoneType' object has no attribute 'setComment' error for the binwalk extension
Running Ghidra 9.0.2

@citizenstaar
Copy link

Got the same error. Running Ghidra 9.1

@Te-k
Copy link
Contributor

Te-k commented Jul 2, 2020

Same here with Ghidra 9.1.2.

The error come from a bad conversion from physical address to logical address : yara returns a physical address in the binary, while you need the logical address to add bookmark and comment. The conversion here addr = currentProgram.minAddress.add(addr_int) does not work

@Te-k
Copy link
Contributor

Te-k commented Jul 3, 2020

I have opened a ticket to check with Ghidra devs if there is a way to do that NationalSecurityAgency/ghidra#2067

Te-k added a commit to Te-k/ghidra_scripts that referenced this issue Jul 3, 2020
@CarlOlson
Copy link

CarlOlson commented Nov 23, 2020

Same issue on Ghidra 9.2

yara.py> Running...
Found : Big_Numbers0 - 0xdadb97 - 0x140db0197L
Traceback (most recent call last):
  File "/home/carl/git/ghidra_scripts/yara.py", line 53, in <module>
    add_bookmark_comment(vaddr, current_rule)
  File "/home/carl/git/ghidra_scripts/yara.py", line 30, in add_bookmark_comment
    cu.setComment(CodeUnit.EOL_COMMENT, text)
AttributeError: 'NoneType' object has no attribute 'setComment'
yara.py> Finished!

It works if I change yara.py:30 to this:

currentProgram.getListing().setComment(gaddr, CodeUnit.EOL_COMMENT, text)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants