Skip to content

Support for rebasing cached gadgets #154

Description

@chase1k

Description

When attempting to load gadgets from a saved gadget file from an ASLR enabled binary such as libc.so.6, angrop seems not adjust the loaded gadgets to the provided base_addr.

proj = angr.Project(LIBC_PATH, main_opts={'base_addr': libc_base}, auto_load_libs=False)
rop = proj.analyses.ROP()

if os.path.exists(LIBC_GADGETS):
    print("Loading libc gadgets from:", LIBC_GADGETS)
    rop.load_gadgets(LIBC_GADGETS)
else:
    rop.find_gadgets()
    rop.save_gadgets(LIBC_GADGETS)
    print("Gadgets saved to:", LIBC_GADGETS)

chain = rop.func_call(system_addr, [binsh_addr])
rop = chain.payload_str()
File "/home/chase/venv/lib/python3.12/site-packages/angr/engines/vex/lifter.py", line 245, in lift_vex
  raise SimEngineError(f"No bytes in memory for block starting at {addr:#x}.")
angr.errors.SimEngineError: No bytes in memory for block starting at 0x7bbd264ec973.

Then, when checking what my previous run leaked for the libc base, I had:
Libc: 0x7bbd26400000

Alternatives

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions