GSOC 2026: Adding Cutter Diff; Basic Function diffing and HexDiffWidget#3625
GSOC 2026: Adding Cutter Diff; Basic Function diffing and HexDiffWidget#3625NewtronReal wants to merge 11 commits into
Conversation
|
rebase on dev |
fe979b0 to
28ea7c9
Compare
|
Please fix clang-tidy warnings |
63f2646 to
a7eb734
Compare
|
Think it's ready for review. Waiting for all checks to be green. |
|
what happens when i open 2 big files? do i have a "waiting" dialog ? |
Yes you will have a waiting diolog until the function comparison is finished. This is actually not ideal for thos who just want to diff the hexdump so I was thinking of adding some options to choose what all diffing to be done in the initial options menu. Ex for those who just want to view the hexdump diff may be the unckeck the function comparison. |
|
Not going into the code details yet. 1- "Diff files" option/action should be in "Tools" not in "File" 2- There should be an option to set current file as either "File 1" or "File 2" 3- Also, it would be better to allow user to manually type the filepath aswell - for "File 1" and "File 2" - (same as InitialFileDialog) 4- Not sure why "Match Results" have an odd greyish background
5- "Functions B" shows functions for "File 1" and "Functions A" shows functions for "File 2" for some reason 6- Why name them "File 1" and "File 2" in the initial dialog and then name them "Functions A" and "Functions B"? I think it would be better to name the binary itself instead of "Functions A" if the binary name is too long then you can put and max character limit on it and do string elision based on that (replace last X chars with ...), same with "INFO A" and "INFO B" and any other occurences 7- Function offsets should be in hex not decimal
8- It would be nice if when clicking on a any function entry in "Functions A/B" would switch to Hex Diff and seek to the function offset, same with entries in Match Results, Added and Removed tabs 9- IMO the "Select which files to compare" should be shown when opening "Diff files" through the "tools" menu, seeing and empty widget and clicking "File->Diff new Files" is a lot more work, however "File->Diff new Files" option should be there and it should pre-fill with currently opened binary paths when user does "File-> Diff new Files" 10- When diffing I used "diff -1" as "File -1" and "diff-2" as "File-2" - it correctly showed that "sym.mult" was removed in "diff-2" but if I diff them in opposite order (meaning diff-1 as File-2 and vice versa) it doesn't show that "sym.mult" was Added, both "Added" and "Removed" tabs become empty. I could be misinterpreting something or it could be a rizin issue (will double check this later)
11- When diffing a large file, the waiting dialog blocks the cutter main window as well, meaning user can't use the main cutter app when diffing is happening (if running it in a separate thread we have to make sure whether the diff functions change rizin's internal state or not, if they do then core has to be locked meaning the user can't use the main cutter app properly because no rizin function can be called till diffing is done - I will check more on this and provide an update) 12- Even though I like the appearance of waiting dialog, it doesn't seem consistent with cutter theme. You can leave it as it is for now - we can discuss the appearance of it later Binaries: |
Edit: On rizin side, looks correct.
|
added = new DiffMismatchModel(&listDel, this);
removed = new DiffMismatchModel(&listAdd, this);Problem in the cutter part only will be fixing it. |
clang formatted new changes
clang format
turn off CUTTER_ASAN
new addition unnecesssary unnecessary
new Commit Code notes. clang-format fixed clang-tidy errors changes clang-format
Needed to add colors gui.match.partial and gui.match.perfect on rizin side the pr is still pending review.
Fixed.
Done
Done
Done(on double click it seeks to the function offset and shows hexdiff)
Added(The CutterDiffWindows are now on independent(ie parent = nullptr) and deletes on close.)
This is a rizin side issue where they match every function of A to B means a function in matches multiple times in A(Atleast that's what i think it is am currently checking how analysis_match_functions work in rizin and soon will be fixing it from the qt side.)
Similar fix to that of CutterDiffWindow made it parentless and deleteonclose. Cores are locked in CutterDiff the cores are independent of the CutterCore rzCore. But still used a RAII for future purposes on assumption of other diffing operations may require multiple threads running at same time.
Left as it was for now.
|
|
Initial work on LineDiff had started which requires rizin#6614 as well. |




Your checklist for this pull request
Detailed description
Summary
This PR introduces a way to expose rz-diff features to Cutter as a new tool Cutter Diff. The Cutter Diff window can be opened by File->Cutter Diff. In the opened window user will be able to diff two new files(Can also diff with current open file at main cutter window). User can set analysis levels and compare logic then can run the bindiff for getting diff thread. It also introduces CutterDiff which will be used anlogouse to CutterCore in the CutterDiff window which exposes the rz-diff features as API. CutterDiff will be creating individual instances for each Cutter Diff window which allows user to diff multiple files to the same opened cutter main bin.
Pending work
Comparing to the main core file is also pending.
LineDiff..
The project was becoming so large that i was afraid reviewer might not be able to review it all at once so i opened this draft.
Added Widgets
If added all the widget it will get too long so i listed only the important widgets to be noted.
Test plan (required)
Build Options:
CUTTER_ASAN=ON
CUTTER_USE_BUNDLED_RIZIN=OFF(use https://github.com/NewtronReal/rizin/tree/diffopstringify instead)
Compile and run. Open a file in cutter(an option for opening the Cutter Diff directly is also to be added). Select File A and File B. Select analysis level and compare logic. open the file change the tabs use the functions panel to navigate along the functions(HexDiff)
Screencast_20260620_224325.mp4