Coder Social home page Coder Social logo

Comments (8)

andreafioraldi avatar andreafioraldi commented on May 28, 2024

Look at https://github.com/andreafioraldi/angrdbg
Specifically at https://github.com/andreafioraldi/angrdbg/blob/master/angrdbg/core.py#L109
Or just use StateShot instead of StateManager to get an angr state and use plain angr API.
More info (a description of a subset of the current API) at chapter 3 of https://github.com/andreafioraldi/bsc-thesis/blob/master/thesis.pdf

from angrgdb.

janbbeck avatar janbbeck commented on May 28, 2024

core.py seems to specify that the expression passed to sim() has to be a register name or memory address. Then I could not actually pass a expression of type rax-0x30. Do I see that right?
A workaround would be to read the current register state and construct the address manually, but
basePointer = gdb.execute("info registers rbp")
does not actually return the result of the gdb.execute command - it just gets printed to screen.

I tried the alternative solution - using the plain angr api - which I would actually like better
project = angr.Project()
initialState = StateShot()
sm = project.factory.simulation_manager(initial_state)
this does not work because it does not know about angr, and importing it does also not work.
A quick example would be appreciated.

from angrgdb.

andreafioraldi avatar andreafioraldi commented on May 28, 2024

sm.sim(sm["rax"]-0x30, 100)

from angrgdb.

andreafioraldi avatar andreafioraldi commented on May 28, 2024

with angr,

state = StateShot()
sym = claripy.BVS("symbol", 100*8)
state.memory.store(state.regs.rax -0x30, sym)

from angrgdb.

janbbeck avatar janbbeck commented on May 28, 2024

Thanks!

from angrgdb.

janbbeck avatar janbbeck commented on May 28, 2024

Actually, in your second example, where do I get the simulation manager from?

from angrgdb.

andreafioraldi avatar andreafioraldi commented on May 28, 2024

load_project().factory.simulation_manager

from angrgdb.

janbbeck avatar janbbeck commented on May 28, 2024

Ok, that works. But without the StateManager() object
how do I do
sm.to_dbg(m.found[0])

from angrgdb.

Related Issues (7)

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.