Code Monkey home page Code Monkey logo

Comments (5)

mz21g avatar mz21g commented on May 22, 2024 1

Update the following lines in the annotator.py

line 384 : dr.sort 			->>			dr.memory_data.sort
line 385 : dr.insn_addr		->>			dr.memory_data.insn_addr
line 385 : dr.content		->>			str(dr.memory_data.content)

Thank you very much, It works, But I found that the second line should be changed to this

> line 385 : dr.insn_addr		->>			dr.ins_addr

because if I change it like you, It will have the following problems

WARNING | 2022-03-03 22:14:43,965 | angr.analyses.cfg.cfg_fast | _tidy_data_references() sees an address 0x804a040 that does not belong to any section or segment.
Traceback (most recent call last):
  File "/Users/chenyanzhi/Documents/angr/test.py", line 21, in <module>
    cfgfastpng("./00_angr_find")
  File "/Users/chenyanzhi/Documents/angr/test.py", line 16, in cfgfastpng
    plot_cfg(cfg, "cfg", format='png', asminst=True, remove_imports=True)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/angrutils/visualize.py", line 34, in plot_cfg
    vis.process(cfg.graph) 
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/bingraphvis/base.py", line 309, in process
    graph = self.pipeline.process(filter=filter)        
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/bingraphvis/base.py", line 286, in process
    c.render(n)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/bingraphvis/base.py", line 126, in render
    an.annotate_content(n, n.content[self.name])
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/bingraphvis/angr/annotator.py", line 385, in annotate_content
    comments_by_addr[dr.memory_data.insn_addr] = str(dr.memory_data.content)
AttributeError: 'MemoryData' object has no attribute 'insn_addr'

from angr-utils.

kaveenliyanage avatar kaveenliyanage commented on May 22, 2024

Update the following lines in the
annotator.py

line 384 : dr.sort 			->>			dr.memory_data.sort
line 385 : dr.insn_addr		->>			dr.memory_data.insn_addr
line 385 : dr.content		->>			str(dr.memory_data.content)

from angr-utils.

mz21g avatar mz21g commented on May 22, 2024

In addition,when I run the sample code, I had the same problem as #32

def main(filename):
    proj = angr.Project(filename, load_options={'auto_load_libs': False})
    main = proj.loader.main_object.get_symbol("main")
    start_state = proj.factory.blank_state(addr=main.rebased_addr)
    cfg = proj.analyses.CFGEmulated(fail_fast=True, starts=[main.rebased_addr], initial_state=start_state)
    plot_cfg(cfg, "ais3_cfg", format='png', asminst=True, remove_imports=True)

ais3_cfg

but I run my code, it will output normally

def cfgfastpng(filename):
    proj = angr.Project(filename, auto_load_libs=False)
    cfg = proj.analyses.CFGFast()
    plot_cfg(cfg, "cfg", format='png', asminst=True, remove_imports=True)

cfg

from angr-utils.

axt avatar axt commented on May 22, 2024

Sorry for my late reply. Thanks for the report and the solution, I will apply the fixes on the weekend.

@mz21g :
When #32 was reported, I've tried to check it, but it worked for me.

Could you maybe figure out what is causing the problem? I wrote some thoughts about how to debug it in the original ticket.

I will also try to retest that on the weekend.

from angr-utils.

axt avatar axt commented on May 22, 2024

I've applied the fix and created a new PyPI version. Thanks for the report!

@mz21g Tried your code to test #32, but it creates the assembly listing for me.

from angr-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.