Compare commits

..

146 commits

Author SHA1 Message Date
Florian Märkl
e9dc99554b Merge branch 'dev' into stable 2026-06-27 12:37:59 +02:00
Anton Kochkov
2f053ddd6c Bump Cutter version to 2.5.0 2026-06-21 14:53:40 +04:00
Anton Kochkov
31413d2d7e Use rz-silhouette v0.9.0-beta4 2026-06-21 14:48:17 +04:00
Anton Kochkov
c71bb46310 Use rz-libswift v0.9.0 2026-06-21 14:45:07 +04:00
Anton Kochkov
d02c98355e Use rz-libyara v0.9.0 2026-06-21 14:42:22 +04:00
Anton Kochkov
cf8a5eeebd Use jsdec v0.9.0 2026-06-21 14:38:42 +04:00
Anton Kochkov
1e8f59f269 Use rz-ghidra v0.9.0 2026-06-21 14:37:07 +04:00
Anton Kochkov
5324efc12a Merge 'dev' branch into stable 2026-06-21 14:35:27 +04:00
Anton Kochkov
a419700f3a Merge branch 'stable' into stable-merge 2026-06-21 14:35:01 +04:00
Karliss
a5f88d10d1 Bump cutter version to 2.4.1 2025-05-09 23:45:18 +03:00
Karliss
e8874be001 Update rizin to 0.8.1 patch. 2025-05-09 23:45:18 +03:00
Karliss
48b3875b2e Update translations. 2025-05-09 18:04:03 +03:00
karliss
2a2fc759a5 Improve disassembly arrow position accuracy. (#3480)
* Improve disassembly arrow position accuracy.

Query line position from textEdit instead of doing naive lineHeight*row. Any differences in rounding logic betwen Qt and Cutter is sufficient to offset arrow by a line or more.
2025-05-09 18:04:03 +03:00
Florian Märkl
6de8b8f491 Add Developer ID signing script for macOS
Additional entitlements are necessary for PCRE2 JIT.
2025-05-09 18:04:03 +03:00
karliss
192c2ac00d Adjust macos dylib references to keep gatekeeper happy. (#3482)
macOS gatekeeper wil block a properly signed/notarized .app from running if it contains absolute rpath references pointing outside the .app.
2025-05-09 18:04:03 +03:00
karliss
8692e63107 Fix windows jsdec install location. (#3469) 2025-05-09 18:04:03 +03:00
karliss
d6c3f3fe4c Update appstream metadata. (#3472)
* missing release versions
* add developer
* remove incorrectly used update_contact
2025-05-09 18:04:03 +03:00
karliss
5c9203b7ec Fix multiple cases of translatable strings not getting recognized (#3470)
* SearchWidget - no default context available in static functions
* MainWindow - unnecesarry macros interfering with context detection
* MainWindow - lupdate getting confused by macro definition that has ternary operator
* Xrefs, Classes, Flags models - missing Q_OBJECT macro

Closes #3458
2025-05-09 18:04:03 +03:00
Anton Kochkov
ec6a6fb142 Use rz-silhouette v0.8.0-beta3 2025-04-26 22:56:25 +04:00
Anton Kochkov
9184085e4d Use rz-libswift v0.8.0 2025-04-25 23:29:26 +04:00
Anton Kochkov
7efb9b2ee3 Use rz-libyara v0.8.0 2025-04-25 23:26:27 +04:00
Anton Kochkov
7d88b0137e Use jsdec v0.8.0 2025-04-25 23:23:07 +04:00
Anton Kochkov
8fface0a4c Use rz-ghidra v0.8.0 2025-04-25 19:27:38 +04:00
Anton Kochkov
de35babfd1 Merge 'dev' branch into stable 2025-04-25 19:24:37 +04:00
Anton Kochkov
47813b55f6 Merge branch 'stable' into stable-merge 2025-04-25 19:24:25 +04:00
Anton Kochkov
209c26b862 Bump version to v2.3.4 2024-03-04 00:18:18 +08:00
Anton Kochkov
90c1bf0826 Update Rizin to the latest stable 2024-03-04 00:16:20 +08:00
Karliss
efa29b63fa Fix multiple crashes related to incorrect rz_iterator usage.
RzAnalysisBytes are owned by the iterator, so returning analysis bytes while destroying iterator owning it is incorrect.
2024-03-04 00:15:04 +08:00
Anton Kochkov
762830d4ac Bump version to v2.3.3 2024-02-24 16:26:59 +08:00
Anton Kochkov
929466c668 Update Rizin to the latest stable 2024-02-24 16:26:59 +08:00
Anton Kochkov
807bbf4032 Use rz-ghidra v0.7.0 2024-02-24 16:26:59 +08:00
Anton Kochkov
e612dcdf33 Merge 'dev' branch into stable 2024-02-24 08:15:30 +08:00
Anton Kochkov
cbb0b805dc Merge branch 'stable' into stable-merge 2024-02-24 08:15:05 +08:00
Anton Kochkov
1d07ebc513 Bump version to v2.3.2 2023-09-14 14:29:16 +08:00
Anton Kochkov
f39540fae4 Update rizin to v0.6.2 2023-09-14 14:29:16 +08:00
Anton Kochkov
9138967ed7 Update translations 2023-09-14 14:29:16 +08:00
frmdstryr
359bd91a21 Seek to first call if multiple references (#3240) 2023-09-14 14:29:16 +08:00
Giovanni
2066a4b3e1 Use tags for jsdec instead of master. (#3231) 2023-09-14 14:29:16 +08:00
Anton Kochkov
58f6c4d6e1 Bump version to v2.3.1 2023-08-20 00:07:39 +08:00
Anton Kochkov
89f53bc073 Update rizin to v0.6.1 2023-08-20 00:04:20 +08:00
Anton Kochkov
fb4c2a1a17 Update translations 2023-08-19 20:20:51 +08:00
Anton Kochkov
ba2c9415a1 Bump version to v2.3.0 2023-08-05 10:53:43 +08:00
Anton Kochkov
eeb2691e42 Update Rizin to latest stable 2023-08-05 10:53:43 +08:00
Anton Kochkov
37fb67a86e Use rz-ghidra v0.6.0 2023-08-05 10:32:25 +08:00
Anton Kochkov
48b35953bb Merge 'dev' branch into stable 2023-08-05 10:27:27 +08:00
Anton Kochkov
351f27d955 Merge branch 'stable' into stable-merge 2023-08-05 10:27:08 +08:00
Anton Kochkov
f4be9a8266 Bump version to v2.2.1 2023-05-15 21:18:17 +08:00
Anton Kochkov
dd216beb9c Use Ubuntu 18.04 docker image (#3180)
Co-authored-by: wargio <wargio@libero.it>
2023-05-15 21:18:17 +08:00
Lucas Hosseini
e523ac8365 Get rid of stale jump arrows in disassembly widget. (#3175)
This commit clears arrows from edited instructions, in order to avoid
stale arrows to remain drawn.

closes #3114
2023-05-14 21:29:26 +08:00
Giovanni
9cbacff329 Fix broken English in UI (#3184) 2023-05-14 21:29:26 +08:00
Anton Kochkov
a96206e7ab Update Hindi, French, Russian translations (#3182) 2023-05-14 21:29:26 +08:00
Giovanni
4191a00965 Fix 'Rizin Graph' widget (#3179) 2023-05-14 21:29:26 +08:00
Anton Kochkov
b6e1778344 Update Japanese, Spanish, Ukranian translations (#3167) 2023-05-14 21:29:26 +08:00
xarkes
546999978e Update IOModesController.cpp (#3166) 2023-05-14 21:29:26 +08:00
xarkes
4f0d8f7e2b Update MapFileDialog.cpp (#3165) 2023-05-14 21:29:26 +08:00
Anton Kochkov
937c01a806 Update Rizin to 0.5.2 2023-05-14 21:29:26 +08:00
Anton Kochkov
c0f260ca69 Fix attaching debugger (#3139)
* Fix attaching debugger
* Fix deadlock on attach

Co-authored-by: wargio <wargio@libero.it>
2023-02-22 23:39:52 +08:00
Anton Kochkov
ef0d69b53a Bump version to v2.2.0 2023-02-22 21:25:45 +08:00
Anton Kochkov
bc979211fe Use rz-ghidra v0.5.0 2023-02-22 21:25:35 +08:00
Anton Kochkov
341d42c3a2 Merge 'dev' branch into stable 2023-02-22 21:24:58 +08:00
Anton Kochkov
6995152366 Merge branch 'stable' into stable-merge 2023-02-22 21:24:30 +08:00
Florian Märkl
8e232bed91 Bump version to 2.1.2 2022-09-11 10:25:39 +02:00
Florian Märkl
2475ffe1a1 Generate and deploy source tarball (Fix #2878) (#3036)
This builds a real tarball, as opposed to the flawed GitHub-generated
one, and also includes the following changes:

Individual builds now have dedicated names like "linux-x86_64". The
structure in the yml is now very similar to how it is in rizin.

Since that means builds are renamed, the filename has also been changed
from the meaningless "ccpp.yml" to "ci.yml", as that would have happened
sooner or later anyway and now will not produce additional intermediate
rename states.

The workflow name inside that file is now also just "CI" since adding
"Cutter" there is redundant.
2022-09-10 17:45:28 +02:00
Edd Barrett
dd4af7e8a0 Fix build on 32-bit systems. (#3032) 2022-09-10 17:45:19 +02:00
Kārlis Seņko
be565f3a88 Do not check "Built from source" in bug report template by default. 2022-09-10 17:44:31 +02:00
Kārlis Seņko
77b93fbab0 Don't leak memory in bb highlighter. 2022-09-10 17:44:13 +02:00
Jeremy Rifkin
fd42ddb0bb Update GraphGridLayout documentation (#3000)
* Updated GraphGridLayout documentation

* Don't use potentially misleading  name "segment tree" .

Not exactly segment tree (although sometimes called that), and for the purpose of high level understanding how graph layout works doesn't matter what it is. Any data structure which provides required queries could be used.

Co-authored-by: Kārlis Seņko <karlis3p70l1ij@gmail.com>
2022-09-10 17:43:28 +02:00
Riccardo Schirone
181506cb1f Mention OBS install mode for Linux (#3006) 2022-09-10 17:43:08 +02:00
Florian Märkl
39dc10a430 Construct and destruct CutterCore singleton locally (Fix #2704) (#2994)
Using Q_GLOBAL_STATIC meant that the CutterCore was destructed late as
part of a binary destructor. It would then free the RzCore, calling for
example the fini callbacks of all plugins. However global destructors in
shared library plugins may have already been run at this point, leading
to for example rz-ghidra's decompiler_mutex being used after
destruction.
Instead of the Q_GLOBAL_STATIC-managed global object, we are now
handling the lifetime of the CutterCore ourselves and only injecting its
instance to be accessed globally. This can also be a first step towards
making the core instance completely local.
2022-09-10 17:42:29 +02:00
Florian Märkl
ba4f8a3024 Add Woodpecker macOS/arm64 CI (#2992)
Package names have also been updated to the scheme used since v2.1.0, to
better represent different architectures.
2022-09-10 17:42:22 +02:00
Florian Märkl
a6dca2956d Update cutter-deps to v15 with macOS/arm64 included (#2990) 2022-09-10 17:42:14 +02:00
Florian Märkl
2529196df0 Remove direct download from update check (#2989)
Hardcoded prediction of filenames for future releases is too prone to
break, which is what happened with v2.1.0.
So better to provide the link to the release page only.
2022-09-10 17:41:21 +02:00
Florian Märkl
bd49557cab Update rizin to stable v0.4.1 2022-09-10 17:40:02 +02:00
Florian Märkl
7eb4311c2b Extend blocksize to work around pdJ printing to few lines (#2984) 2022-06-25 17:21:18 +02:00
Giovanni
70bd668af1 Add back jsdec which was wrongly removed. (#2983) 2022-06-25 17:21:18 +02:00
Florian Märkl
c60a8ee134 Use rz-ghidra v0.4.0 2022-06-25 13:28:40 +02:00
Florian Märkl
e73a4c60e3 Merge 'dev' branch into stable 2022-06-25 10:10:26 +02:00
Florian Märkl
cf15a5761b Merge branch 'stable' into stable-merge 2022-06-25 10:06:07 +02:00
Anton Kochkov
ed47645405 Update Rizin to the latest stable 2022-06-25 10:04:59 +02:00
Riccardo Schirone
f20b59d8ac
Use API instead of ar- and aets- commands (#2980) 2022-06-25 09:15:13 +08:00
Riccardo Schirone
a7d3eaffb0
wcr command does not exist anymore, use API (#2979) 2022-06-25 00:24:43 +08:00
Florian Märkl
84b33d50bd Merge 'dev' branch into stable 2022-06-12 10:33:02 +02:00
Florian Märkl
9e0e094bbb Merge branch 'stable' into stable-merge 2022-06-12 10:32:56 +02:00
billow
d2e2bcd6b6 Convert more commands to rizin APIs (#2964)
`fdj?`, `iRj`, `om.`, `psx`, `p8`, `fj`
2022-06-11 07:08:10 +08:00
Giovanni
05b771b8bb Bump version to 2.1.0 from stable (#2962) 2022-06-09 07:14:25 +08:00
billow
5fd55df710 Convert Rizin command calls to te Rizin APIs (#2960)
* Convert `iCj` call to the API
* Convert `icj` call to the API
* Convert `iij` call to the API
* Convert `iej` call to the API
* Convert `CClj` call to the API
* Convert `iEj` call to the API
* Convert 'ihj' call to the API
* Convert 'iSSj' call to the API
2022-06-09 07:14:25 +08:00
Giovanni
544b904c2c Yara plugin + fix linuxdeployqt plugins (#2924) 2022-06-09 07:14:25 +08:00
Giovanni
266db132aa Download and install sigdb option (#2949)
* Download and install sigdb option and disable swift demangler when libswift is installed
* Remove dir.prefix and use rz_core_analysis_sigdb_list for sigdb
* Use a different color for flirts
* Updated to rizin dev
* Use rz_path_set_prefix to set the prefix path on OSX bundle
2022-06-09 07:14:25 +08:00
Florian Märkl
712709200a Fix null deref in strings loading without any file (#2955) 2022-06-09 07:14:25 +08:00
Islam Bassuni
49cf6555a8 Partially refactor Dashboard to API (#2930)
Also fixes missing NX and PIC bits in Dashboard.
2022-06-09 07:14:25 +08:00
Florian Märkl
832dae38b4 Fix EditVariablesDialog parenting (#2954)
This fixes the dialog being placed weirdly when using the 'Y' shortcut
because it was parented to the DisassemblyContextMenu, which itself
might not be shown at all.
2022-06-09 07:14:25 +08:00
bartoszek
575952d22e Add missing Rizin headers in python bindings (#2943) 2022-06-09 07:14:25 +08:00
Florian Märkl
82f14b5667 Refactor VisualNavbar to use API instead of p-j (#2953)
With the updated rizin, this also fixes any error prints saying
"Cannot alloc for this range" and json errors when no valid range is
available.
2022-06-09 07:14:25 +08:00
billow
b3e74b2dad Convert Rizin commands to the API calls (#2948)
Including wx wr wd ws ww wz ahi ahb aec aecu aecc aecs aes aesb aets+
aets- afc afcl omfg+w oo+ oo p8 aei aeim aeip aecb aeso dbs avj
2022-06-09 07:14:25 +08:00
Giovanni
ebe4ca5072 Fix the lib name on windows (#2950) 2022-06-09 07:14:25 +08:00
billow
cf30b400f3 Convert Rizin commands to the API calls 2022-06-09 07:14:25 +08:00
billow
df8c2749a6 convert to api for dr 2022-06-09 07:14:25 +08:00
billow
fb82370dfc convert to api for aht 2022-06-09 07:14:25 +08:00
billow
6e07f4d97a convert to api for aoj 2022-06-09 07:14:25 +08:00
Paul I
493ff68365 Revert changes in functionAt (#2941) 2022-06-09 07:14:25 +08:00
Giovanni
6345604172 Replace afcf with C api. (#2940) 2022-06-09 07:14:25 +08:00
Jakob Zielinski
e022e44474 Search button disabled and button text changed while search is occurring (#2928) 2022-06-09 07:14:25 +08:00
staz
34b1f01a86 Fixed an invalid index check (#2937) 2022-06-09 07:14:25 +08:00
Islam Bassuni
6fca09d313 Created adding comments option inside Hexdump. (#2927) 2022-06-09 07:14:25 +08:00
billow
7d42a5c7e6 Convert from Rizin commands to the API for w (#2926) 2022-06-09 07:14:25 +08:00
Giovanni
a48399f73b Adds support for RZ_SIGDB path and fixes sorting on some columns (#2923) 2022-06-09 07:14:25 +08:00
rgnter
cbda0ad27e Fixed a segfault during debugging with gdbserver (#2830)
Fixes issue #2829
2022-06-09 07:14:25 +08:00
Islam Bassuni
5440a0ef50 Added report issue button in "About" window (#2908) 2022-06-09 07:14:25 +08:00
tcoyvwac
12721aaa9e widgets: redundant return-break (#2922)
Removed consecutive return-break statements.
2022-06-09 07:14:25 +08:00
billow
46ea1569d2 Convert various debug code to C API (#2913) 2022-06-09 07:14:25 +08:00
Giovanni
f8744d12c2 ‘memDisp’ may be used uninitialized (#2920) 2022-06-09 07:14:25 +08:00
Florian Märkl
ae2ad5d50c Extend cmake config files with deps, version, etc. (#2916)
This improves how the installed CutterConfig.cmake can be used for
native plugin development:
* Transitive dependencies are resolved automatically
* Version file is included
* Cutter_USER_PLUGINDIR is set to a path that plugins can use as a
  default install destination

src/plugins/sample-cpp/CMakeLists.txt is an example for how to use it.
Rizin was also updated to prevent an error with multiple
`find_package()` calls.
2022-06-09 07:14:25 +08:00
Florian Märkl
6629d579c6 Update windows CI to 2019 2022-06-09 07:14:25 +08:00
Giovanni
3e168fb76a Fixed formatting (#2917) 2022-06-09 07:14:25 +08:00
Nirmal Manoj
085f5024b9 Use RzAnnotatedCode from JSDec (pddA) 2022-06-09 07:14:25 +08:00
Florian Märkl
d65ad504ca Rewrite getVariables with API
This also avoids annoying "ERROR: No function found in ..." beging
printed by afvj when right-clicking anywhere outside a function.
The heuristics in functionIn() also have been adjusted to prefer the
function that has its entrypoint at the given addr, if there is any.
2022-06-09 07:14:25 +08:00
Florian Märkl
0dc4e94647 Remove unnessecary str in setToData() (Fix #2901) 2022-06-09 07:14:25 +08:00
Florian Märkl
b6288ecbf6 Fix a strange comparison 2022-06-09 07:14:25 +08:00
Florian Märkl
76c1ab894e Add missing overrides to SectionsModel 2022-06-09 07:14:25 +08:00
SR_team
8ace08b6e0 Update includes compat with KF5.92 on some distributions (#2912)
With KF5.92 headers KSyntaxHighlighting/{header}.h copied to KSyntaxHighlighting/ksyntaxhighlighting/{header}.h. Headers KSyntaxHighlighting/{Header} now include ksyntaxhighlighting/{header}.h instead of {header}.h. Than on some distros like ArchLinux headers KSyntaxHighlighting/{header}.h removed, because it copies of KSyntaxHighlighting/ksyntaxhighlighting/{header}.h and because KSyntaxHighlighting/{Header} now include ksyntaxhighlighting/{header}.h.
2022-06-09 07:14:25 +08:00
alexthesys
21ab0e2a9e Convert if-block to early return 2022-06-09 07:14:25 +08:00
alexthesys
7119017eae Hexeditor: add option to write hex bytes 2022-06-09 07:14:25 +08:00
yossizap
b884fe5f74 Update rizin submodule (#2900)
This is also a partial fix for #2897
2022-06-09 07:14:25 +08:00
Florian Märkl
9d2404b486 Rewrite isWriteModeEnabled() with API
This also introduces a slight behavioral change: Previously, only the
core file with the "raised" io desc was checked, which is RzIO.desc. But
that member is deprecated for good reasons, so now we just check if
there is any core file whose primary fd has write enabled.
2022-06-09 07:14:25 +08:00
Florian Märkl
f26f04b5fe Replace usage of wcj by C API 2022-06-09 07:14:25 +08:00
Florian Märkl
b0c2dea772 Remove unused stats query (#2903)
The views showing this info have been removed in the past, so it was
unused. This also fixes some errors with latest rizin where
zero-argument f does not exist anymore (it's now fl).
2022-06-09 07:14:25 +08:00
Akihiko Odaki
518014ee19 Use rizin instead of Qt to parse JSON (#2902)
Qt truncates integers to 52-bit, corrupting e.g. memory addresses. Use
rizin's JSON parser, which can parse integers whose size is up to 64
bits.
2022-06-09 07:14:25 +08:00
yossizap
ddaa02c0f8 Remove additional 0x prefix in the registers widget (#2896) 2022-06-09 07:14:25 +08:00
Yossi Zap
c95a5d59a5 Bypass meson Popen_safe_legacy() error 2022-06-09 07:14:25 +08:00
Yossi Zap
a4bc803eea Add missing rz_demangler.dll to windows packaging 2022-06-09 07:14:25 +08:00
Theofilos Pechlivanis
cff49fa2a2 Save and load the layout of the Functions widget (#2844) 2022-06-09 07:14:25 +08:00
Petros S
22cb8e7594 Move more common disassembly-previewing functionality to namaspace (#2849) 2022-06-09 07:14:25 +08:00
Segev Finer
f7e6f9466d Enable console redirection on Windows without starting from a console (#2888) 2022-06-09 07:14:25 +08:00
billow
35408be46f Convert rizin commands to C apis (#2861)
* "fr" renameFlag
* "f-" delFlag
* "f" addFlag
* "fsj" getAllFlagspaces
* "fj" getAllFlags
* "afn" renameFunction
* "af-" delFunction
* "af" createFunctionAt
* "eco"
* "ecd"
2022-06-09 07:14:25 +08:00
Segev Finer
cabe3ffb3e Fix crash on Windows when starting from a console (#2885)
Fixes #2877
2022-06-09 07:14:25 +08:00
Giovanni
4f627e9bff Return error when applying a signature fails. (#2882)
* Updated rizin commit to 8282cee287abdbf8664a0b2540bad2b5ea5b819d
* Fix messages based on fail/success result while applying a sig/pat file
2022-06-09 07:14:25 +08:00
Giovanni
453974da35 Add signature widget for flirts (#2881)
* Added flirt view and removed zignature one
* Added menu for apply signature from file and create new sig/pat files
* Updated rizin to dev branch
2022-06-09 07:14:25 +08:00
Giovanni
297b9bb192 Enable support for building rz-libswift on cutter (#2841) 2022-06-09 07:14:25 +08:00
Florian Märkl
893baea832 Fix pdj call in nextOpAddr for disasm scrolling (#2874) 2022-06-09 07:14:25 +08:00
nirkog
5c4ba4891d Add double click to seek to global var in decompiler (#2871) 2022-06-09 07:14:25 +08:00
nirkog
138078a6f4 Added support for ctrl+Enter submission in open shellcode tab (#2851)
* Added support for ctrl+Enter submission in shellcode tab in the new file dialog
2022-06-09 07:14:25 +08:00
Riccardo Schirone
98411b4dbf Update Rizin to dev and use CMake config files (#2855)
API usage has been adjusted.
There are now also cmake config files directly installed by Rizin itself, so we don't need to keep a custom FindRizin.cmake file in Cutter. This remove that file and just uses `find_package(Rizin COMPONENTS Core)`, which will use the cmake files installed on the system.
2022-06-09 07:14:25 +08:00
Anton Kochkov
f5a7a79ee8
Bump Rizin version to v0.3.4 (#2876) 2022-01-10 19:16:51 +01:00
Anton Kochkov
829f4091c5
Update Rizin to 0.3.3 (#2870) 2022-01-07 14:42:53 +01:00
Anton Kochkov
7d50b80d44 Bump Rizin version to v0.3.2 2021-12-30 17:39:13 +08:00
Anton Kochkov
7dfc289660 Update version to 2.0.5 and rizin stable (before 0.3.2) (#2864) 2021-12-26 10:09:38 +01:00
27 changed files with 262 additions and 932 deletions

View file

@ -397,7 +397,7 @@ jobs:
python-version: 3.12.x
output-id: artifact_windows
- name: macos-x86_64
os: macos-15-intel # Must be an x86_64 image: https://github.com/actions/runner-images#available-images
os: macos-14
arch: x86_64
package: true
- name: macos-arm64

View file

@ -19,7 +19,6 @@ set(CUTTER_EXTRA_PLUGIN_DIRS "" CACHE STRING "List of addition plugin locations"
option(CUTTER_ENABLE_DEPENDENCY_DOWNLOADS "Enable downloading of dependencies. Setting to OFF doesn't affect any downloads done by rizin build." OFF)
option(CUTTER_ENABLE_PACKAGING "Enable building platform-specific packages for distributing" OFF)
option(CUTTER_ENABLE_SIGDB "Downloads and installs sigdb (only available when CUTTER_USE_BUNDLED_RIZIN=ON)." OFF)
option(CUTTER_ENABLE_TRANSLATIONS "Build and install translation files" ON)
option(CUTTER_PACKAGE_DEPENDENCIES "During install step include the third party dependencies." OFF)
option(CUTTER_PACKAGE_RZ_GHIDRA "Compile and install rz-ghidra during install step." OFF)
option(CUTTER_PACKAGE_RZ_LIBSWIFT "Compile and install rz-libswift demangler during the install step." OFF)

View file

@ -53,7 +53,7 @@ endif()
# TODO: This version number should be fetched automatically
# instead of being hardcoded.
set (Rizin_VERSION 0.10)
set (Rizin_VERSION 0.9)
set (RZ_LIBS rz_core rz_config rz_cons rz_io rz_util rz_flag rz_mark rz_arch rz_debug
rz_hash rz_bin rz_lang rz_il rz_egg rz_reg rz_search rz_syscall

4
dist/CMakeLists.txt vendored
View file

@ -201,9 +201,9 @@ if(CUTTER_PACKAGE_RZ_GHIDRA)
# installed Cutter.
ExternalProject_Add(rz-ghidra
GIT_REPOSITORY https://github.com/rizinorg/rz-ghidra
#GIT_TAG v0.3.0
GIT_TAG v0.9.0
#GIT_TAG c7a50a2e7c0a95cd52b167c9ee0fa1805223f08e
GIT_TAG dev
#GIT_TAG dev
#GIT_SHALLOW ON # disable this line when using commit hash
CONFIGURE_COMMAND ""
BUILD_COMMAND ""

View file

@ -4,7 +4,7 @@ $plugin_path = "$dist\plugins\native\"
$pathdll = "$plugin_path\jsdec_cutter.dll"
if (-not (Test-Path -Path 'jsdec' -PathType Container)) {
git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch "dev"
git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch "v0.9.0"
}
cd jsdec
$jsdecdir = (Get-Item .).FullName

View file

@ -2,7 +2,7 @@ $dist = $args[0]
$python = Split-Path((Get-Command python.exe).Path)
if (-not (Test-Path -Path 'libswift' -PathType Container)) {
git clone https://github.com/rizinorg/rz-libswift.git --depth 1 libswift
git clone https://github.com/rizinorg/rz-libswift.git --depth 1 --branch "v0.9.0" libswift
}
cd libswift
& meson.exe --buildtype=release --prefix=$dist build

View file

@ -3,7 +3,7 @@ $cmake_opts = $args[1]
$python = Split-Path((Get-Command python.exe).Path)
if (-not (Test-Path -Path 'rz_libyara' -PathType Container)) {
git clone https://github.com/rizinorg/rz-libyara.git --depth 1 --branch main rz_libyara
git clone https://github.com/rizinorg/rz-libyara.git --depth 1 --branch "v0.9.0" rz_libyara
git -C rz_libyara submodule init
git -C rz_libyara submodule update
}

View file

@ -3,7 +3,7 @@ $cmake_opts = $args[1]
$python = Split-Path((Get-Command python.exe).Path)
if (-not (Test-Path -Path 'rz-silhouette' -PathType Container)) {
git clone https://github.com/rizinorg/rz-silhouette.git --depth 1 rz-silhouette
git clone https://github.com/rizinorg/rz-silhouette.git --depth 1 --branch "v0.9.0-beta4" rz-silhouette
}
cd rz-silhouette
& meson.exe --buildtype=release --prefix=$dist build

2
rizin

@ -1 +1 @@
Subproject commit 136a337e1c40236723a58ccca6549aa577e8aaa5
Subproject commit da228d11cfc865b06442bd66b192caeb6e5ff556

View file

@ -5,7 +5,7 @@ set -e
cd $(dirname "${BASH_SOURCE[0]}")/..
mkdir -p cutter-deps && cd cutter-deps
DEPS_BASE_URL=https://github.com/rizinorg/cutter-deps/releases/download/v19
DEPS_BASE_URL=https://github.com/rizinorg/cutter-deps/releases/download/v18
if [ "$CUTTER_QT" == "5" ]; then
DEPS_FILE_linux_x86_64=cutter-deps-q5-linux-x86_64.tar.gz
@ -13,18 +13,18 @@ if [ "$CUTTER_QT" == "5" ]; then
DEPS_BASE_URL=https://github.com/rizinorg/cutter-deps/releases/download/qt5-v17
else
DEPS_FILE_linux_x86_64=cutter-deps-linux-x86_64.tar.gz
DEPS_SHA256_linux_x86_64=b4bebf95c69f6216456d31b345d660ae3347517a6c14a4a4e9d568b03289c3de
DEPS_SHA256_linux_x86_64=204683c44e4824df7cb9925f1939544f081e64b7a701fe95fd03f67125a165b4
fi
echo $DEPS_SHA256_linux_x86_64
DEPS_FILE_macos_x86_64=cutter-deps-macos-x86_64.tar.gz
DEPS_SHA256_macos_x86_64=6f202bd2b18cae780d4fe4ddce662909eebb4f0cd3f1c685e5b2bb6cd46a3e7d
DEPS_SHA256_macos_x86_64=a46c2dee12d4160410237da848075fc87c41c3850021f583d3b469a59c386650
DEPS_FILE_macos_arm64=cutter-deps-macos-arm64.tar.gz
DEPS_SHA256_macos_arm64=fa4b3c58f02e7b57a18c2fe7b8c196dd008187deda72fa1ae685c8ed661e10c6
DEPS_SHA256_macos_arm64=1ca381b562d632a370e05a85b0fe60a591a261bba0f48d97a0e40b4307c2577a
DEPS_FILE_win_x86_64=cutter-deps-win-x86_64.tar.gz
DEPS_SHA256_win_x86_64=3d69280bfedfdd3363fac450f814fc2f09cdd6149f60541dcdaa81f782c3ac76
DEPS_SHA256_win_x86_64=95a3cf676178b8c58442d22ee8b21ce2530bfdae86f514901310490a8f28867a
ARCH=x86_64

View file

@ -9,7 +9,7 @@ SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "$SCRIPTPATH/.."
if [ ! -d jsdec ]; then
git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch "dev"
git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch "v0.9.0"
fi
cd jsdec

View file

@ -108,17 +108,9 @@ resign_dmg() {
notarize_bundle Cutter-rw/Cutter.app
unmount
trap - EXIT
# Remove temporary signing space and restore HFS+ volume consistency.
ee hdiutil resize -size min Cutter-rw.dmg
OUTPUT="${1%.*}-signed.dmg"
echo_step "Creating final read-only ${OUTPUT}"
ee hdiutil convert -format UDZO -o "${OUTPUT}" Cutter-rw.dmg
echo_step "Verifying filesystem in ${OUTPUT}"
ee hdiutil attach "${OUTPUT}" -readonly -nobrowse -noautofsck -mountpoint Cutter-rw
trap unmount EXIT
ee diskutil verifyVolume Cutter-rw
unmount
trap - EXIT
}
case "$1" in

View file

@ -7,7 +7,7 @@ SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "$SCRIPTPATH/.."
if [[ ! -d libswift ]]; then
git clone https://github.com/rizinorg/rz-libswift.git --depth 1 libswift
git clone https://github.com/rizinorg/rz-libswift.git --depth 1 --branch "v0.9.0" libswift
fi
cd libswift

View file

@ -8,7 +8,7 @@ EXTRA_CMAKE_OPTS="$2"
cd "$SCRIPTPATH/.."
if [[ ! -d rz_libyara ]]; then
git clone https://github.com/rizinorg/rz-libyara.git --depth 1 --branch main rz_libyara
git clone https://github.com/rizinorg/rz-libyara.git --depth 1 --branch "v0.9.0" rz_libyara
git -C rz_libyara submodule init
git -C rz_libyara submodule update
fi

View file

@ -8,7 +8,7 @@ EXTRA_CMAKE_OPTS="$2"
cd "$SCRIPTPATH/.."
if [[ ! -d rz-silhouette ]]; then
git clone https://github.com/rizinorg/rz-silhouette.git --depth 1 rz-silhouette
git clone https://github.com/rizinorg/rz-silhouette.git --depth 1 --branch "v0.9.0-beta4" rz-silhouette
fi
cd rz-silhouette

View file

@ -613,9 +613,7 @@ if(CUTTER_ENABLE_PACKAGING)
target_compile_definitions(Cutter PRIVATE CUTTER_ENABLE_PACKAGING)
endif()
if(CUTTER_ENABLE_TRANSLATIONS)
include(Translations)
endif()
include(Translations)
# Install files
install(TARGETS Cutter

View file

@ -4,55 +4,19 @@
#include <QAbstractButton>
#include <QAbstractItemView>
#include <QAbstractTextDocumentLayout>
#include <QComboBox>
#include <QCryptographicHash>
#include <QDockWidget>
#include <QFileInfo>
#include <QFontMetricsF>
#include <QMenu>
#include <QPlainTextEdit>
#include <QString>
#include <QTextBlock>
#include <QTextEdit>
#include <QTreeWidget>
#include <QtCore>
#include <cmath>
namespace {
template<typename TextEditType>
int calculateMaxDisplayedLines(TextEditType *textEdit)
{
qreal lineHeight = 0;
const QTextBlock firstBlock = textEdit->document()->begin();
if (firstBlock.isValid()) {
lineHeight = textEdit->document()->documentLayout()->blockBoundingRect(firstBlock).height();
}
if (lineHeight <= 0) {
const QFontMetricsF fm(textEdit->font());
lineHeight = fm.lineSpacing();
}
qreal availableHeight = textEdit->viewport()->height();
const qreal margin = textEdit->document()->documentMargin();
availableHeight -= margin;
const qreal exactLines = availableHeight / lineHeight;
const qreal floorValue = std::floor(exactLines);
const qreal fractionalPart = exactLines - floorValue;
// If the last line is more than 15% visible then count it, otherwise leave it
// avoids the issue where there is empty space at the bottom of a textedit widget
if (fractionalPart >= 0.15) {
return std::ceil(availableHeight / lineHeight);
}
return floorValue;
}
}
namespace qhelpers {
QString formatByteCount(ut64 bytecount)
@ -210,12 +174,20 @@ void SizePolicyMinMax::restoreHeight(QWidget *widget) const
int getMaxFullyDisplayedLines(QTextEdit *textEdit)
{
return calculateMaxDisplayedLines(textEdit);
const QFontMetrics fontMetrics(textEdit->document()->defaultFont());
return (textEdit->height()
- (textEdit->contentsMargins().top() + textEdit->contentsMargins().bottom()
+ (int)(textEdit->document()->documentMargin() * 2)))
/ fontMetrics.lineSpacing();
}
int getMaxFullyDisplayedLines(QPlainTextEdit *plainTextEdit)
{
return calculateMaxDisplayedLines(plainTextEdit);
const QFontMetrics fontMetrics(plainTextEdit->document()->defaultFont());
return (plainTextEdit->height()
- (plainTextEdit->contentsMargins().top() + plainTextEdit->contentsMargins().bottom()
+ (int)(plainTextEdit->document()->documentMargin() * 2)))
/ fontMetrics.lineSpacing();
}
QByteArray applyColorToSvg(const QByteArray &data, QColor color)

View file

@ -1187,15 +1187,19 @@ void CutterCore::setConfig(const char *k, const RzInterval &itv)
void CutterCore::setConfig(const char *k, const QStringList &list)
{
CORE_LOCK();
RzSetS *set = rz_set_s_new(HT_STR_DUP);
if (!set) {
RzList *rzList = rz_list_newf(free);
if (!rzList) {
return;
}
for (const QString &str : list) {
rz_set_s_add(set, str.toUtf8().constData());
char *dupStr = strdup(str.toUtf8().constData());
if (dupStr) {
rz_list_append(rzList, dupStr);
}
}
rz_config_set_set(core->config, k, set);
rz_set_s_free(set);
rz_config_set_list(core->config, k, rzList);
}
int CutterCore::getConfigi(const char *k)
@ -1222,12 +1226,16 @@ RzInterval CutterCore::getConfigItv(const char *k)
return rz_config_get_interval(core->config, k);
}
QSet<QString> CutterCore::getConfigSet(const char *k)
QStringList CutterCore::getConfigList(const char *k)
{
CORE_LOCK();
RzSetS *set = rz_config_get_set(core->config, k);
QSet<QString> res = convertRzSetS(set);
rz_set_s_free(set);
QStringList res;
RzList *list = rz_config_get_list(core->config, k);
for (const auto *s : CutterRzList<const char>(list)) {
res << QString::fromUtf8(s);
}
rz_list_free(list);
return res;
}
@ -1287,18 +1295,18 @@ QString CutterCore::getConfig(const char *k)
return { rz_config_get(core->config, k) };
}
QSet<QString> CutterCore::getConfigOptions(const char *k)
QStringList CutterCore::getConfigOptions(const char *k)
{
CORE_LOCK();
const RzConfigNode *node = rz_config_node_get(core->config, k);
if (!(node && node->options)) {
return {};
}
QSet<QString> res;
for (auto it = CutterRzIter<const char *>(rz_set_s_as_iter(node->options)); it; ++it) {
res << QString::fromUtf8(*it);
QStringList list;
for (const auto &s : CutterRzList<char>(node->options)) {
list << s;
}
return res;
return list;
}
void CutterCore::setConfig(const char *k, const QVariant &v)
@ -4146,11 +4154,13 @@ QList<EvaluableVarDescription> CutterCore::getAllEvaluableVars()
var.type = EvaluableVarDescription::Interval;
const RzInterval itv = rz_config_var_get_interval(v);
value = QVariant::fromValue(itv);
} else if (RZ_CONFIG_VAR_IS_TYPE(flags, RZ_CONFIG_VAR_TYPE_SET)) {
var.type = EvaluableVarDescription::Set;
RzSetS *set = rz_config_var_get_set(v);
value = QVariant::fromValue(convertRzSetS(set));
rz_set_s_free(set);
} else if (RZ_CONFIG_VAR_IS_TYPE(flags, RZ_CONFIG_VAR_TYPE_LIST)) {
var.type = EvaluableVarDescription::List;
const RzList *list = rz_config_var_get_list(v);
QStringList stringList;
for (const auto *c : CutterRzList<const char>(list)) {
stringList << QString(c);
}
}
if (value.isNull()) {
@ -4158,9 +4168,13 @@ QList<EvaluableVarDescription> CutterCore::getAllEvaluableVars()
}
var.value = value;
const RzSetS *optionsSet = rz_config_var_get_options(v);
if (optionsSet) {
var.options = convertRzSetS(optionsSet);
const RzList *optionsList = rz_config_var_get_options(v);
if (optionsList) {
RzListIter *iter;
char *option;
CutterRzListForeach (optionsList, iter, char, option) {
var.options << QString::fromUtf8(option);
}
}
} else {
const RzConfigNode *node = &entry->node;
@ -4175,8 +4189,10 @@ QList<EvaluableVarDescription> CutterCore::getAllEvaluableVars()
var.value = QString::fromUtf8(rz_config_entry_get_as_string(entry));
if (node->options) {
var.options = convertRzSetS(node->options);
RzListIter *iter;
char *option;
CutterRzListForeach (node->options, iter, char, option) {
var.options << QString::fromUtf8(option);
}
}

View file

@ -495,12 +495,12 @@ public:
bool getConfigb(const QString &k) { return getConfigb(k.toUtf8().constData()); }
RzInterval getConfigItv(const char *k);
RzInterval getConfigItv(const QString &k) { return getConfigItv(k.toUtf8().constData()); }
QSet<QString> getConfigSet(const char *k);
QSet<QString> getConfigSet(const QString &k) { return getConfigSet(k.toUtf8().constData()); }
QStringList getConfigList(const char *k);
QStringList getConfigList(const QString &k) { return getConfigList(k.toUtf8().constData()); }
QString getConfig(const char *k);
QString getConfig(const QString &k) { return getConfig(k.toUtf8().constData()); }
QString getConfigDescription(const char *k);
QSet<QString> getConfigOptions(const char *k);
QStringList getConfigOptions(const char *k);
QStringList getColorThemes();
QHash<QString, QColor> getTheme();
QStringList getThemeKeys();

View file

@ -10,8 +10,8 @@
#include <QColor>
#include <QList>
#include <QMetaType>
#include <QSet>
#include <QString>
#include <QStringList>
#include <QVariant>
struct FunctionDescription
@ -448,11 +448,11 @@ struct EvaluableVarDescription
QString description;
bool readOnly;
enum Type : ut8 { Bool = 0, Int, String, Interval, Set };
enum Type : ut8 { Bool = 0, Int, String, Interval, List };
Type type;
QVariant value; ///< Can be either QString, QSet<QString> or RzInterval depending on type
QSet<QString> options;
QVariant value; ///< Can be either QString, QStringList or RzInterval depending on type
QList<QString> options;
};
Q_DECLARE_METATYPE(FunctionDescription)

View file

@ -1,12 +1 @@
#include "RizinCpp.h"
#include <QSet>
QSet<QString> convertRzSetS(const RzSetS *set)
{
QSet<QString> res;
for (auto it = CutterRzIter<const char *>(rz_set_s_as_iter(set)); it; ++it) {
res << QString::fromUtf8(*it);
}
return res;
}

View file

@ -187,9 +187,9 @@ public:
return *this;
}
operator bool() { return rzIter && rzIter->cur; }
T &operator*() { return *reinterpret_cast<T *>(rzIter->cur); }
T *get() { return reinterpret_cast<T *>(rzIter->cur); }
T *operator->() { return reinterpret_cast<T *>(rzIter->cur); }
T &operator*() { return *reinterpret_cast<RzCoreDecodedBytes *>(rzIter->cur); }
T *get() { return reinterpret_cast<RzCoreDecodedBytes *>(rzIter->cur); }
T *operator->() { return reinterpret_cast<RzCoreDecodedBytes *>(rzIter->cur); }
};
#define CutterHtDef(xx, XX, K, VB) \
@ -219,6 +219,4 @@ public:
CutterHtDef(sp, SP, const char *, void *);
QSet<QString> convertRzSetS(const RzSetS *set);
#endif // RIZINCPP_H

View file

@ -125,7 +125,7 @@ QVariant RizinConfigOptionsModel::data(const QModelIndex &index, int role) const
const auto itv = evalVar.value.value<RzInterval>();
return QString("%1+%2").arg(rzAddressString(itv.addr), rzSizeString(itv.size));
}
if (evalVar.type == EvaluableVarDescription::Set) {
if (evalVar.type == EvaluableVarDescription::List) {
const QStringList list = evalVar.value.toStringList();
if (list.isEmpty()) {
return QString();
@ -344,16 +344,14 @@ QWidget *RizinConfigOptionsDelegate::createEditor(QWidget *parent,
if (evalVar.type == EvaluableVarDescription::Bool
|| evalVar.type == EvaluableVarDescription::Interval
|| evalVar.type == EvaluableVarDescription::Set) {
|| evalVar.type == EvaluableVarDescription::List) {
// handled in lambda connected to ui->treeView::doubleClicked
return nullptr;
}
if (!evalVar.options.isEmpty()) {
auto *comboBox = new QComboBox(parent);
QStringList opts = evalVar.options.values();
opts.sort();
for (const auto &opt : opts) {
for (const auto &opt : evalVar.options) {
comboBox->addItem(opt);
}
return comboBox;
@ -488,7 +486,7 @@ RizinConfigOptionsWidget::RizinConfigOptionsWidget(PreferencesDialog *parent)
return;
}
if (evalVar.type == EvaluableVarDescription::Set) {
if (evalVar.type == EvaluableVarDescription::List) {
StringListDialog dialog(evalVar.value.toStringList(), this);
dialog.setWindowTitle(tr("Edit List for %1").arg(evalVar.name));
@ -598,8 +596,8 @@ void RizinConfigOptionsWidget::handleConfigOptionChanged(const QModelIndex &topL
if (!originalValues.contains(evalVar.name)) {
if (evalVar.type == EvaluableVarDescription::Interval) {
originalValues[evalVar.name] = QVariant::fromValue(Core()->getConfigItv(evalVar.name));
} else if (evalVar.type == EvaluableVarDescription::Set) {
originalValues[evalVar.name] = QVariant::fromValue(Core()->getConfigSet(evalVar.name));
} else if (evalVar.type == EvaluableVarDescription::List) {
originalValues[evalVar.name] = QVariant::fromValue(Core()->getConfigList(evalVar.name));
} else {
originalValues[evalVar.name] = Core()->getConfig(evalVar.name);
}

View file

@ -215,10 +215,6 @@ const QHash<QString, Shortcut> &getDefaultShortcuts()
{ { Qt::Key_Space },
QT_TRANSLATE_NOOP("DisassemblyWidget", "Switch to Graph"),
"DisassemblyWidget" } },
{ "Disassembly.moveLeft",
{ QList<QKeySequence> { Qt::Key_H }
+ QKeySequence::keyBindings(QKeySequence::MoveToPreviousChar),
QT_TRANSLATE_NOOP("DisassemblyWidget", "Move Cursor Down"), "DisassemblyWidget" } },
{ "Disassembly.moveDown",
{ QList<QKeySequence> { Qt::Key_J }
+ QKeySequence::keyBindings(QKeySequence::MoveToNextLine),
@ -227,10 +223,6 @@ const QHash<QString, Shortcut> &getDefaultShortcuts()
{ QList<QKeySequence> { Qt::Key_K }
+ QKeySequence::keyBindings(QKeySequence::MoveToPreviousLine),
QT_TRANSLATE_NOOP("DisassemblyWidget", "Move Cursor Up"), "DisassemblyWidget" } },
{ "Disassembly.moveRight",
{ QList<QKeySequence> { Qt::Key_L }
+ QKeySequence::keyBindings(QKeySequence::MoveToNextChar),
QT_TRANSLATE_NOOP("DisassemblyWidget", "Move Cursor Up"), "DisassemblyWidget" } },
{ "Disassembly.pageDown",
{ QKeySequence::keyBindings(QKeySequence::MoveToNextPage),
QT_TRANSLATE_NOOP("DisassemblyWidget", "Move Cursor Down By Page"),

File diff suppressed because it is too large Load diff

View file

@ -19,8 +19,6 @@ class DisassemblyContextMenu;
class DisassemblyLeftPanel;
class AddressRangeScrollBar;
enum class RefreshMode : ut8 { Append, Prepend, Reset, Keep, None };
/**
* @brief Main widget for showing disassembly of a binary
*
@ -35,67 +33,48 @@ public:
static QString getWidgetType();
QFontMetricsF getFontMetrics();
QList<DisassemblyLine> getLines();
int getStartIndex() const;
int getEndIndex() const;
/**
* @brief Updates the offset and character position where the cursor selection ends
*/
void updateSelectionPos(const QTextCursor &cursor);
/**
* @brief Updates the offset and character position where the cursor selection starts
*/
void updateSelectionAnchor(const QTextCursor &cursor);
public slots:
/**
* @brief Highlights the currently selected line and updates the
* highlighting of the same words under the cursor in the visible screen.
* @return List of selections to be highlighted
* This overrides all previous highlighting.
*/
QList<QTextEdit::ExtraSelection> highlightCurrentLine();
void highlightCurrentLine();
/**
* @brief Adds the PC line highlighting to the other current highlighting.
* This is generally called after highlightCurrentLine
* @return List of selections to be highlighted
* This should be called after highlightCurrentLine since that function
* overrides all previous highlighting.
*/
QList<QTextEdit::ExtraSelection> highlightPCLine();
void highlightPCLine();
void showDisasContextMenu(const QPoint &pt);
void fontsUpdatedSlot();
void colorsUpdatedSlot();
void scrollInstructions(int count, bool clampToScrollBarRange = false);
void seekPrev();
void setPreviewMode(bool previewMode);
QFontMetricsF getFontMetrics();
QList<DisassemblyLine> getLines();
/**
* @brief Forces the transient vertical scrollbar to appear on scroll
*/
void showTransientScrollBar();
void refreshDisasm(RVA offset = RVA_INVALID, RefreshMode mode = RefreshMode::Reset);
protected slots:
void onSeekChanged(RVA offset, CutterCore::SeekHistoryType type);
void refreshIfInRange(RVA offset);
void instructionChanged(RVA offset);
void refreshDisasm(RVA offset = RVA_INVALID);
bool updateMaxLines();
void cursorPositionChanged();
/**
* @brief Copies the currently highlighted disassembly text to the system clipboard
*/
void copySelection();
protected:
DisassemblyContextMenu *mCtxMenu;
DisassemblyScrollArea *mDisasScrollArea;
DisassemblyTextEdit *mDisasTextEdit;
DisassemblyLeftPanel *leftPanel;
QList<DisassemblyLine> lines;
private:
RVA topOffset;
@ -122,31 +101,7 @@ private:
int topOffsetHistoryPos = 0;
QList<RVA> topOffsetHistory;
int startIndex = 0;
int endIndex = 0;
QList<DisassemblyLine> lines;
// Cursor selection related
RVA selectionAnchorRVA = RVA_INVALID;
/**
* @brief metadata lines attached to instruction have the same offset as the instruction itself,
* this keeps track of which metdata line the cursor was at inside the offset block
*/
int selectionAnchorSubIndex = 0;
int selectionAnchorChar = 0;
RVA selectionPosRVA = RVA_INVALID;
/**
* @brief same use-case as @ref selectionAnchorSubIndex but for cursor position instead if
* anchor
*/
int selectionPosSubIndex = 0;
int selectionPosChar = 0;
QList<RVA> breakpoints;
/**
* @brief Set whenever breakpoints have been updated or the screen has been manually refreshed
*/
bool breakpointsDirty = true;
void setupFonts();
void setupColors();
@ -155,53 +110,9 @@ private:
void connectCursorPositionChanged(bool disconnect);
void moveCursorRelative(QTextCursor::MoveOperation op, bool page);
void moveCursorRelative(bool up, bool page);
void jumpToOffsetUnderCursor(const QTextCursor &);
/**
* @brief Visually highlights the text on screen between the selection start (anchor) and the
* current cursor position
*/
void updateSelection();
void updateContextMenuSelection(bool hasSelection);
/**
* @brief Finds the visual line number in the current view for a specific offset
* @param offset The memory address (RVA) to look for
* @param offsetSubIndex The specific sub-line to target if the instructions has metadata
* attached to it
* @return The index of the line, or -1 if not found
*
* @see DisassemblyHelper::getIndexInOffsetGroup()
*/
int getLineIndex(RVA offset, int offsetSubIndex) const;
/**
* @brief Refreshes the background colors in the disassembly view.
* It applies highlights to both the line currently under the user's cursor and the Program
* Counter (PC) line.
*/
void updateLineHighlights();
/**
* @brief Clears the current text selection so nothing is highlighted as selected
*/
void invalidateCursorSelection();
/**
* @brief Metadata lines attached to an instruction have the same offset saved with it as the
* instruction, This function returns the index of the current line within that offset
* group/block
* * e.g:
* * @code
* ; a comment
* ; another comment <------ assume cursor is here
* ; void func1()
* 0x1000 mov rax, rax
* @endcode
*
* Then the returned index is "1"
*/
int getIndexInOffsetGroup(const QTextCursor &cursor) const;
};
class DisassemblyScrollArea : public QAbstractScrollArea
@ -231,30 +142,23 @@ class DisassemblyTextEdit : public QPlainTextEdit
Q_OBJECT
public:
explicit DisassemblyTextEdit(DisassemblyWidget *disasmWidget = nullptr);
explicit DisassemblyTextEdit(QWidget *parent = nullptr)
: QPlainTextEdit(parent), lockScroll(false)
{
}
void setLockScroll(bool lock) { this->lockScroll = lock; }
qreal textOffset() const;
void setCursorVisible(bool visible);
protected:
bool viewportEvent(QEvent *event) override;
void scrollContentsBy(int dx, int dy) override;
void keyPressEvent(QKeyEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
private:
bool lockScroll;
QTimer *blinkTimer;
bool cursorVisible = true;
QColor cursorColor;
DisassemblyWidget *disasmWidget = nullptr;
};
/**

View file

@ -349,16 +349,13 @@ void GraphView::paint(QPainter &p, QPoint offset, QRect viewport, qreal scale, b
p.setBrush(Qt::gray);
// Always draw edges
// TODO: Only draw edges if they are actually visible ...
// Draw edges
for (GraphEdge &edge : block.edges) {
if (edge.polyline.empty()) {
continue;
}
// Skips expensive polyline and arrow rendering if the edge's bounding box
// is completely outside the current viewport.
if (!edge.polyline.boundingRect().adjusted(-1, -1, 1, 1).intersects(windowF)) {
continue;
}
const QPolygonF polyline = edge.polyline;
const EdgeConfiguration ec =
edgeConfiguration(block, &blocks[edge.target], interactive);