Skip to content

Conversation

kkaempf
Copy link
Contributor

@kkaempf kkaempf commented Oct 3, 2025

This PR fixes issue #4606, replacing (outdated) PR #4812.

Issue #4606 is about supporting processors with PC-relative addressing, where addressing is based on the address of the operand instead of the opcode.

See #4606 (comment) about Sleigh's inability to support this addressing mode.

However, it turns out that Ghidra's varnode does track addresses of operands and which can be accessed via walker.getOffset(-1). This PR makes this value available in Sleigh as the predefined variable "operand_offset".

This commit fixes issue NationalSecurityAgency#4606, replacing (outdated) PR NationalSecurityAgency#4812.

Issue NationalSecurityAgency#4606 is about supporting processors with PC-relative addressing,
where addressing is based on the address of the operand instead of the
opcode.

See NationalSecurityAgency#4606 (comment)
about Sleigh's inability to support this addressing mode.

However, it turns out that Ghidra's varnode does track addresses of
operands and which can be accessed via walker.getOffset(-1).

This PR makes this value available in Sleigh as the predefined
variable "operand_offset".

Signed-off-by: Klaus Kämpf <[email protected]>
This is identical to the previous commit, but covering the Java
implementation of Sleigh.

Signed-off-by: Klaus Kämpf <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature: Decompiler Status: Triage Information is being gathered

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants