Skip to content

Display branch symbols in the asm/v1 endpoint#747

Open
canova wants to merge 3 commits intomstange:mainfrom
canova:asm-branch-symbols
Open

Display branch symbols in the asm/v1 endpoint#747
canova wants to merge 3 commits intomstange:mainfrom
canova:asm-branch-symbols

Conversation

@canova
Copy link
Contributor

@canova canova commented Feb 3, 2026

This PR changes the asm/v1 endpoint to display branch symbols besides the branch instruction immediate operands. This will help us understand which functions we are branching off to.

This PR depends on #746 the first two commits also belong to it, only 3rd commit belongs to this PR.

This will allow us to see the changes in the following commit.
Both of them had some quirks that we had to overcome differently.

On ARM64, some opcodes can take multiple operands, and the pc offset
operand could be in different positions.

On ARM32, branch offsets are shifted by either 1 or 2. But the immediate
value that is stored inside the yaxpeax_arm Operand enum is a
non-shifted value. So we have to shift them ourselves.
This commit adds branch symbols to the asm/v1 API inside samply-api.

It achieves this by loading the symbol map right before we decode, and
pass it as an argument so we can append the branch symbol besides the
instruction.

Currently we only do this in x86_64, ARM64 and ARM32, and not x86.
@canova canova force-pushed the asm-branch-symbols branch from 42a44a2 to 900c812 Compare February 3, 2026 14:23
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.

1 participant