Skip to content

Add function name option for address reversal - #9

Open
leo385 wants to merge 1 commit into
Dryxio:mainfrom
leo385:feat/function-name-for-address-reversal
Open

Add function name option for address reversal#9
leo385 wants to merge 1 commit into
Dryxio:mainfrom
leo385:feat/function-name-for-address-reversal

Conversation

@leo385

@leo385 leo385 commented Aug 15, 2026

Copy link
Copy Markdown

Summary

Add an explicit --function option for single-address reversal.

This allows callers to provide the function name together with --address and --class, so FunctionTarget receives complete metadata even when the backend only exposes a generic symbol such as FUN_005b8f00.

This is useful for projects where source mappings already identify the real function name, but Ghidra's decompiler output still uses an autogenerated symbol.

Example

re-agent reverse --address 0x005b8f00 --class CVehicleModelInfo --function SetupCommonData

Dry-run output now includes the supplied function name:

Dry run mode — no LLM calls will be made.

Would reverse: 0x005b8f00
  Class: CVehicleModelInfo
  Function: SetupCommonData

Changes

  • Add --function FUNCTION_NAME to the reverse command
  • Pass the explicit function name into FunctionTarget
  • Preserve explicitly supplied class/function metadata when backend symbol detection is incomplete
  • Show the function name in --dry-run output
  • Extend CLI tests to cover the new option

Why

For address-based reversal, the backend may return a generic symbol such as:

FUN_005b8f00

while the source project already knows the real target:

CVehicleModelInfo::SetupCommonData

Providing the function name explicitly gives the reverser more accurate source context instead of relying only on the backend symbol.

Testing

Targeted CLI test:

pytest tests/test_cli/test_main.py::test_reverse_dry_run -v

Result:

PASSED

Full CLI test file on Windows:

8 passed, 1 failed

The remaining failure is an existing Windows-specific YAML path escaping issue in test_status_no_session and is unrelated to this change.

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