Skip to content

Rzasm info page enhancement#3595

Merged
notxvilka merged 5 commits intorizinorg:devfrom
tsogp:rzasm-enhancement
Apr 19, 2026
Merged

Rzasm info page enhancement#3595
notxvilka merged 5 commits intorizinorg:devfrom
tsogp:rzasm-enhancement

Conversation

@tsogp
Copy link
Copy Markdown
Contributor

@tsogp tsogp commented Mar 29, 2026

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

Limit default "CPU's'" column width (don't prevent expanding it) or move it to the end. Some of the cpu lists are very long. It took me some time to notice that there are more columns to the right

Lowered the width of the CPU's column, added a tooltip with the style from DisassemblyPreview::getToolTipStyleSheet() to be able to see the whole value when hovering.

Add columns displaying asm plugin capabilities adAE (assemble, disassemble, analyze, esil) and bits similar to La command output.

Extended CutterCore::getRAsmPluginDescriptions() function to return the number of bits and capabilities. The implementation is based on Rizin's const char *has_esil(RzCore *core, const char *name) and void bits_to_string(int bits, char output[32]) from casm.c. I have also added a const V *Find(K k, bool *found = nullptr) method to CutterHt##XX to search for analysis plugins.

Before:

Screencast_20260329_183914.mov
image image

CPU's columns is very long and no 'Capabilities' and 'Bits' columns

After:

Screencast_20260329_184251.mov
image

Test plan (required)

  • Open Cutter with any binary
  • In the 'Open file' dialog press About -> Show Rizin Plugin Information -> RzAsm OR Choose and open a binary -> Edit -> Preferences -> Plugins -> Show Rizin Plugin Information -> RzAsm
  • Verify that CPU's column has smaller width, when hovering you can see values in tooltips
  • Scroll to the right, see the 'Capabilities' and 'Bits' columns

Closing issues
closes #2385

Copy link
Copy Markdown
Contributor

@notxvilka notxvilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Comment thread src/dialogs/RizinPluginsDialog.cpp Outdated
Comment on lines +60 to +61
const QString tooltip =
QString("<html><div style='font-family:%1;font-size:%2pt;'>%3</div></html>")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't like HTML injected into QT. this needs to change.

Copy link
Copy Markdown
Contributor Author

@tsogp tsogp Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wargio Hi, is there any particular reason why is it not good? Because there are some tooltips in the codebase that already do it this way, for example this one

bool DisassemblyPreview::showDisasPreviewAt(QWidget *parent, const QPoint &pointOfEvent, const  RVA offset 
{
    QStringList disasmPreview = Core()->getDisassemblyPreview(offset, 10);
    if (!disasmPreview.isEmpty()) {
        const QFont &fnt = Config()->getFont();
        QString tooltip = QString { "<html><div style=\"font-family: %1; font-size: %2pt; "
                                    "white-space: nowrap;\"><div style=\"margin-bottom: "
                                    "10px;\"><strong>Disassembly Preview</strong>:<br>%3<div>" }
                                  .arg(fnt.family())
                                  .arg(qMax(8, fnt.pointSize() - 1))
                                  .arg(disasmPreview.join("<br>"));

        QToolTip::showText(pointOfEvent, tooltip, parent, QRect {}, 3500);
        return true;
    }

    return false;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these needs to be changed. you need to use native elements, because when injecting HTML, you can introduce XSS vulnerabilities

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wargio Would it be possible for me to keep the tooltip here as is, make a separate issue about removing all the injected HTML and work on it separately? I have been working on it for some days now and there are a lot of changes that are beyond the scope of this PR. I would love to work on that issue too though since I've already started doing it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my point of view - it's okay to do it in a separate PR. Not sure what others think.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sure

@tsogp tsogp changed the title Rzasm enhancement Rzasm info page enhancement Mar 29, 2026
@notxvilka notxvilka added the Waiting-For: Author This issue or PR is awaiting for a response or action from the author label Apr 11, 2026
@notxvilka
Copy link
Copy Markdown
Contributor

@tsogp hi, what is the status of this one?

@tsogp
Copy link
Copy Markdown
Contributor Author

tsogp commented Apr 12, 2026

@tsogp hi, what is the status of this one?

Hi @notxvilka! I'm still working on the HTML tooltips rewrite, it turned out to be much harder to do than I thought since it involves a lot of rich text parsing that was previously handled by HTML. I believe that I will be able to open a draft PR in 2-4 days.

To not leave this PR stale for now and proceed with it, would it be possible for me to temporarily comment out tooltip logic and then uncomment it in the tooltip rewrite PR (or leave it as it is right now)?

@notxvilka notxvilka added this to the 2.5 milestone Apr 16, 2026
@tsogp
Copy link
Copy Markdown
Contributor Author

tsogp commented Apr 17, 2026

@wargio @notxvilka Hi! I have escaped all the data that we pass to html (usually it's the font name) and made sure that all the html structures is correct, so there should be no threats of XSS attacks. The disassemblyPreview data is escaped with CutterCore::ansiEscapeToHtml(const QString &text). Can you please have a look?

@wargio
Copy link
Copy Markdown
Member

wargio commented Apr 17, 2026

update the screenshots.

@tsogp
Copy link
Copy Markdown
Contributor Author

tsogp commented Apr 17, 2026

@wargio Done! I've put them in the PR description

@wargio
Copy link
Copy Markdown
Member

wargio commented Apr 18, 2026

way better

Copy link
Copy Markdown
Contributor

@notxvilka notxvilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase on top of the latest dev. This should fix the CI

@tsogp tsogp force-pushed the rzasm-enhancement branch from 7c19fb1 to 63b6766 Compare April 19, 2026 13:52
@tsogp
Copy link
Copy Markdown
Contributor Author

tsogp commented Apr 19, 2026

@notxvilka Done!

@notxvilka notxvilka merged commit 013a766 into rizinorg:dev Apr 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Waiting-For: Author This issue or PR is awaiting for a response or action from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Rizin plugin RzAsm page

3 participants