Skip to content

feat: Add context menu to change calling convention (#3513)#3542

Open
aviralgarg05 wants to merge 3 commits intorizinorg:devfrom
aviralgarg05:fix-3513
Open

feat: Add context menu to change calling convention (#3513)#3542
aviralgarg05 wants to merge 3 commits intorizinorg:devfrom
aviralgarg05:fix-3513

Conversation

@aviralgarg05
Copy link

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've updated the documentation with the relevant information (if needed)
  • I've used AI tools to generate fully or partially these code changes and I'm sure the changes are not copyrighted by somebody else.

Detailed description

This pull request implements the ability to change a function's calling convention directly from the Disassembly view's context menu. Previously, users had to open the "Edit Function" dialog to modify this property.

Key Changes:

  • Added a dynamic "Set calling convention" menu to DisassemblyContextMenu.
  • Implemented isHighlightedWordCC() to detect if the user right-clicked on a calling convention string (e.g., cdecl, stdcall).
  • Populated the menu with available calling conventions for the current architecture using Rizin's analysis engine.
  • Integrated the update logic to immediately refresh the disassembly view after a change.

AI Disclosure:
Some amount of help in understanding the codebase through Antigravity

Test plan (required)

  1. Open any binary in Cutter.
  2. Navigate to a function in the Disassembly view.
  3. Right-click on the calling convention name (e.g., cdecl or fastcall) in the function header.
  4. Verify that a new menu "Set calling convention" appears.
  5. Select a different calling convention from the list.
  6. Expected Outcome: The disassembly view should refresh immediately, and right-clicking again should show the new convention as checked.
  7. Verify the change by opening the Edit Function dialog (Shift + F); the selected convention should match.

Closing issues

closes #3513

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.

Calling Conventions

1 participant