Commit Graph

46 Commits

Author SHA1 Message Date
WerWolv c33d53b728 feat: Add support for Capstone 6, drop support for Capstone 4 2025-11-30 19:49:07 +01:00
WerWolv 9ae233a41c feat: Integrate the interactive help option and add a help text for every view 2025-11-30 16:42:01 +01:00
WerWolv 1d4233514f impr: Add dropdown to disassembler architectures 2025-11-30 14:08:40 +01:00
WerWolv 790c19a1cd patterns: Go back to working pattern language 2025-09-01 22:54:51 +02:00
WerWolv 4cfdbb8095 patterns: Updated pattern language 2025-08-31 13:52:02 +02:00
WerWolv 48af5eb10a impr: Modernize disassembler view 2025-08-16 11:49:35 +02:00
WerWolv fbde2942de build: Refactor ContentRegistry into multiple separate files 2025-08-14 21:22:03 +02:00
WerWolv d920718b44 build: Refactor ImHexAPI into multiple separate files 2025-08-14 20:16:40 +02:00
WerWolv b5a3a8b4c2 impr: Rewrite Localization Manager to use more standard format and load localizations on the fly 2025-08-12 18:00:10 +02:00
WerWolv 9cff9043ee impr: Remove hex::format, improve format and logging type safety 2025-08-06 20:02:23 +02:00
WerWolv aa6e461340 feat: Added support for view-specific menu items and main menus 2025-07-22 22:32:45 +02:00
WerWolv da2aa85a8a build: Fix cppcheck issues 2025-07-10 13:57:08 +02:00
paxcut 6f42c4b3b3
fix: fixes for pattern language dissassembler support (#2314)
Following the documentation (which is not being updated for this type)
on using `hex::type::Instruction` fails to produce any patterns
regardless of how you format the string that is passed to capstone to
select architecture and options.

The error is traced back to mishandling the input string so that the
correct parts are not selected properly. Rather than manually selecting
the parts of the input string from the result of find it is much simpler
to use splitString() (which uses find internally) and does all the work
for us with fewer chances for errors.

There are still problems. The resulting string for the formatter doesn't
return the disassembled instruction and prints the variable name with
the @ used to place it. To view the instruction you need to unseal the
pattern and open the child which then shows the instruction. That only
happens after this fix has been applied.
2025-06-25 03:53:17 -07:00
Stephen Hewitt 4c20ceb94e
Issue 2196 disassembler upper bound (#2272)
Issue #2196: Disassembler region range upper bound not inclusive

### Problem description
The issue is described
[here](https://github.com/WerWolv/ImHex/issues/2196)

### Implementation description
Some off by 1s

Co-authored-by: paxcut <53811119+paxcut@users.noreply.github.com>
2025-06-24 03:51:20 -07:00
WerWolv 145c88db31 patterns: Updated pattern language
Fixes #2266
2025-05-25 11:00:59 +02:00
WerWolv 774eb18a42 impr: Make custom disassemblers reload on run 2025-02-28 12:04:47 +01:00
WerWolv 38d11dacb7 fix: Crash when choosing Edit -> Disassemble Selection without ever opening disassembler view
Fixes #2149
2025-02-27 08:45:24 +01:00
WerWolv 40d74dd633 fix: Crashes when switching disassembler architecture while disassembling 2025-02-24 19:58:40 +01:00
WerWolv 0499807597 fix: Remove unused event unsubscribes in disassembler 2025-02-17 13:07:01 +01:00
WerWolv 1bd9c918f6 fix: Crash when custom disassembler returns no bytes 2025-02-16 21:11:02 +01:00
Justus Garbe 6828c7c077
fix: crash when disassembler encounters invalid instructions (#2116) 2025-02-16 00:52:30 +01:00
WerWolv 645b43e9cc fix: Various MSVC warnings 2025-02-01 20:54:00 +01:00
WerWolv 8d1352ddff fix: Remaining compile errors 2025-01-31 20:23:47 +01:00
WerWolv e6ab2c3b7e impr: Various small fixes and improvements 2025-01-31 19:43:39 +01:00
WerWolv 803ebe34ed build: Update for software defined 128 bit types 2025-01-29 21:37:41 +01:00
WerWolv a55df1d111 fix: Exception being thrown when custom disassembler folders didn't exist 2025-01-03 00:15:52 +01:00
WerWolv 268b495a29 fix: Make capstone use little endian by default 2024-12-31 21:17:19 +01:00
WerWolv 180f4926f8 impr: Make disassembly view contain data per-provider 2024-12-31 21:16:27 +01:00
WerWolv 084c17dc26 fix: Missing endian setting in ARM64 disassembler 2024-12-26 22:39:57 +01:00
WerWolv bf44a1cce6 feat: Added initial support for custom disassemblers 2024-12-26 20:04:45 +01:00
WerWolv a76c6c653d impr: Refactor disassembler system to make it more modular 2024-12-26 18:41:34 +01:00
WerWolv 0454a369e5 fix: Crashes when disassembling data
Fixes #2025
2024-12-25 16:36:53 +01:00
WerWolv 512fcd361b impr: Modernize the disassembler, hashes and yara view 2024-12-24 10:57:09 +01:00
WerWolv 36014b706d fix: Wrong header location in disassembler view 2024-12-15 10:52:11 +01:00
WerWolv ed0a94659e impr: Added load and base address to instruction pl types 2024-12-14 21:52:19 +01:00
WerWolv 6a28de100c impr: Rename font definition files 2024-12-14 20:36:09 +01:00
Nik 040a606b39
feat: Added various custom built-in types to the pattern language (#1991) 2024-12-14 16:52:36 +01:00
WerWolv 21b315b97e impr: Added image load and image base address to disassembler
#1994
2024-12-10 20:33:28 +01:00
WerWolv 1e71d8afc0 feat: Added `Disassemble selection` option to the Edit menu
#1994
2024-12-09 21:35:08 +01:00
BioTheWolff 1b9f4f33de
feat: Added export disassembler results to ASM file (#1987)
### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->
This PR implements the feature request #1781, that suggests adding a
button to export disassembled instructions into an ASM file.

### Implementation description
This adds a button to export the current disassembled instructions to an
ASM file. Said file is suffixed by an `.asm` extension if not specified
at file creation.

*Note: the file is written to for every `Disassembly` item in the
vector, as it was the easiest and most memory-conservative way of doing
it.*

The file creation task is implemented based on IPS patch exports, so it
fits the same pattern.
A `ToastError` is raised when the ASM export could not complete
successfully.

Translations have been implemented for both `en_US` and `de_DE` for the
two new keys:
- `hex.disassembler.view.disassembler.export`: file export button
- `hex.disassembler.view.disassembler.export.popup.error`: error popup
text

### Screenshots
The button is disabled when the disassembler is working, or when the
disassembly vector is empty.

Here is a complete breakdown of the visual changes:

![image](https://github.com/user-attachments/assets/af0ce701-9d77-45f1-9a5a-90d68d00bb0d)

### Additional things
As expected, the exporter writes every item's `mnemonic` and `operators`
to the file, producing an output like this:

`example.asm`
```asm
.byte 0x7f, 0x45, 0x4c, 0x46
andeq r0, r1, r2, lsl #2
andeq r0, r0, r0
andeq r0, r0, r0
eorseq r0, lr, r3
andeq r0, r0, r1
andeq r1, r0, r0, asr #32
andeq r0, r0, r0
andeq r0, r0, r0, asr #32
```

---------

Signed-off-by: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com>
2024-12-05 23:04:38 +01:00
WerWolv d8e1284946 fix: Task names not displaying correctly anymore 2024-07-27 14:09:52 +02:00
WerWolv 07c259c9c1 fix: Multiple issues causing visualizers to crash when used _slightly_ incorrectly 2024-07-10 20:50:58 +02:00
WerWolv 33885b863a fix: Disassembler always using little endian, no matter the setting
Fixes #1763
2024-06-16 15:06:30 +02:00
Nik 339541a56f
impr: Restructure various components much better (#1520) 2024-01-28 22:14:59 +01:00
WerWolv bfafc692db impr: Added icons to all menu items 2024-01-08 21:51:48 +01:00
Nik 61bfe10bc2
refactor: Rework features that use external libraries into optional plugins (#1470) 2023-12-23 21:09:41 +01:00