Skip to content

Import claripy through the angr package - #158

Open
twizmwazin wants to merge 6 commits into
masterfrom
migrate/angr-claripy-import
Open

Import claripy through the angr package#158
twizmwazin wants to merge 6 commits into
masterfrom
migrate/angr-claripy-import

Conversation

@twizmwazin

@twizmwazin twizmwazin commented Jul 8, 2026

Copy link
Copy Markdown
Member

Depends on angr/angr#6550, which merges claripy (clarirs) into the angr package: claripy is no longer importable as a standalone top-level module — it lives at angr.rustylib.claripy and is exposed as angr.claripy.

This PR rewrites every import claripy to from angr import claripy so angrop keeps working with that change (11 files, mechanical; the bound name stays claripy so no call sites change).

Linked PRs (for angr CI cross-checkout):

claripy is no longer importable as a top-level module: it is built into
angr.rustylib and exposed as angr.claripy (see angr/angr#6550). Rewrite
every `import claripy` / `from claripy...` to `from angr import claripy`
/ `from angr.claripy...`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@angr-bot

angr-bot commented Jul 8, 2026

Copy link
Copy Markdown
Member

Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/angrop_158

Follow-up to the import rewrite for angr/angr#6550, replacing claripy
APIs that clarirs does not provide:

- claripy.algorithm.replace(...) -> claripy.replace(...) (same kwargs)
- Base.children_asts() -> a local rop_utils.children_asts(ast) helper
  (clarirs ASTs expose only immediate .args)
- claripy.errors.ClaripyZ3Error -> claripy.errors.ClaripyError in the
  gadget-analysis except clauses (clarirs has no Z3-specific error)
- guard make_initial_state against stack_gsize == 0: clarirs rejects
  claripy.Concat() with an empty operand list, which claripy tolerated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
save_gadgets opened the cache path for writing without ensuring its parent
directory exists, so saving to a cache dir that was removed (e.g. the
stale gadget caches deleted for the claripy migration) raised
FileNotFoundError. Create the directory first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Kyle-Kyle

Copy link
Copy Markdown
Collaborator

we are merging claripy to angr? 👀

@ltfish

ltfish commented Jul 9, 2026

Copy link
Copy Markdown
Member

No. We will have clarirs instead.

@rhelmot

rhelmot commented Jul 9, 2026

Copy link
Copy Markdown
Member

I think the answer to Kyle's question is, strictly speaking, "yes". The reason for this is that claripy is being rewritten in rust (clarirs) and since rust does static linking, if we want the angr rust code to be able to take advantage of the rust claripy code in the angr rust code so these need to be the same shared object.

@Kyle-Kyle

Copy link
Copy Markdown
Collaborator

I see. I like the idea of rewriting claripy in rust. So it'd be super fast with fewer crashes (hopefully)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants