Skip to content

Add support for Rust architecture hook plugins - #8659

Open
zznop wants to merge 2 commits into
devfrom
test_rust_arch_hooks
Open

zznop wants to merge 2 commits into
devfrom
test_rust_arch_hooks

Conversation

@zznop

@zznop zznop commented Oct 13, 2026

Copy link
Copy Markdown
Member

Adds ArchitectureHook and register_architecture_hook to the Rust API so plugins can override selected behavior of an existing architecture. Unmodified methods delegate to the previous implementation, allowing hooks to be stacked without recursive calls into themselves.

The implementation preserves underlying architecture behavior when forwarding:

  • Retains address normalization, including clearing the ARM Thumb bit.
  • Forwards flag-write operations that Rust cannot represent, such as LLIL_FSUB, with their original arguments to preserve native floating-point flag semantics.
  • Dispatches intrinsic-class queries through the hook override while retaining existing custom-architecture behavior.

For testing / demonstration I used the attached plugin to annotate ARM instructions disabling and enabling interrupts in the attached binary

ra4m1_hello_world.ino.elf.zip
lib.rs.zip

zznop added 2 commits October 13, 2026 11:31
Introduce ArchitectureHook and register_architecture_hook with default
forwarding to the previous implementation. Preserve address normalization
and architecture-specific flag IL and intrinsic classes when delegating.
Forward flag-write operations unsupported by LowLevelILFlagWriteOp to
the previous architecture with their raw arguments intact, preserving
native floating-point flag semantics.

Route intrinsic-class queries through ArchitectureHook::intrinsic_class
while retaining existing custom-architecture behavior.
@zznop zznop added this to the Langara milestone Oct 13, 2026
@zznop
zznop requested a review from emesare October 13, 2026 17:54
@zznop zznop self-assigned this Oct 13, 2026
@zznop zznop added Component: Architecture Issue needs changes to an architecture plugin Component: Rust API Issue needs changes to the Rust API labels Oct 13, 2026

This branch has not been deployed

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

Labels

Component: Architecture Issue needs changes to an architecture plugin Component: Rust API Issue needs changes to the Rust API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant