Compare commits

...

1716 Commits

Author SHA1 Message Date
WerWolv
25e7ce5750 impr: Disable exception wrapping as it causes a lot of slowdowns
(cherry picked from commit 8fc2d6b225)
2026-01-03 22:16:43 +01:00
WerWolv
3b602eaaee fix: Error message rendering of visualizers
(cherry picked from commit 051cdfa305)
2026-01-03 22:16:43 +01:00
paxcut
954bee635e fix: Text highlighter crash (#2595)
The assumption that the number of lines of colors will be equal to the
number of lines in the input signal is incorrect. As issue #2594 shows,
erroneous input can cause the lexer to end processing the input file
prematurely thus being unable to create tokens past the line where the
error occurred which in turn implies that no colors can be found beyond
those lines.

To fix the crash (the underlying problem is user caused and can't be
fixed) is to use the size of the vectors containing the first token
index of each line since that size must be equal to the number of lines
stored in token sequence.

Fixes #2594

(cherry picked from commit 5756105347)
2026-01-03 22:16:20 +01:00
paxcut
3d797b3c26 fix: Division by zero in sound visualizer. (#2593)
Can happen if input is less than 2400*channels number of points. The fix
is detecting it and throwing an error.

(cherry picked from commit ed583d8bd1)
2026-01-03 22:15:47 +01:00
WerWolv
dfd8391382 fix: Goto setting hex editor scroll position to imprecise value for large addresses
#2599

(cherry picked from commit 731cf10207)
2026-01-03 22:15:47 +01:00
iTrooz
5e09f4ec23 ci: remove Fedora 41, 42 builds and AlmaLinux 9
(cherry picked from commit cb898ce8cf)
2026-01-03 22:15:47 +01:00
iTrooz
7daee7ca74 ci: update workflow to manually download cache key
(cherry picked from commit 892334e31a)
2026-01-03 22:15:47 +01:00
iTrooz
211e03ca66 ci: add workflow to manually download cache key
(cherry picked from commit a16e16853f)
2026-01-03 22:15:47 +01:00
WerWolv
9dc6879be3 patterns: Update pattern language
Fixes #2589

(cherry picked from commit 42da24e31d)
2026-01-03 22:14:55 +01:00
WerWolv
1537e98d80 fix: Another use of ssize_t
(cherry picked from commit 5b9b5d4f1f)
2026-01-03 22:14:55 +01:00
paxcut
35e8c73f7c fixing isEmpty again. (#2591)
hopefully the last time.

(cherry picked from commit 5332a26294)
2026-01-03 22:14:55 +01:00
WerWolv
0c48aef5ee fix: Build on MSVC, properly handle empty files
(cherry picked from commit 54d9f8ec5c)
2026-01-03 22:14:53 +01:00
WerWolv
4a7544b9e7 feat: Allow opening special files with no specific size
(cherry picked from commit 73a17308cc)
2026-01-03 22:14:47 +01:00
paxcut
87ebcff525 fix: Unable to delete empty lines in text editor (#2588)
fixes for issue #2587

(cherry picked from commit b835c48a0c)
2026-01-03 22:14:35 +01:00
WerWolv
f0f6a22391 fix: ImGui-internal shortcuts not working correctly with native macOS menu bar enabled 2025-12-29 19:31:54 +01:00
WerWolv
f76ea2a677 web: Let ImHex Web run more standalone 2025-12-29 17:48:51 +01:00
WerWolv
7a8c57a9a0 fix: Exit code getting in forwarder not working
(cherry picked from commit 8b53b36b20)
2025-12-29 15:05:49 +01:00
WerWolv
831f7e75ce patterns: Update pattern language 2025-12-29 14:03:05 +01:00
WerWolv
a20f165421 fix: Race condition causing old patterns to stick around in the pattern drawer
(cherry picked from commit da6e7240d6)
2025-12-29 13:44:17 +01:00
WerWolv
5fa5bef467 impr: Replace Patreon links with Ko-Fi
(cherry picked from commit 3e1a797ea7)
2025-12-29 13:44:09 +01:00
WerWolv
db401ddf8e impr: Replace achievement icons with font icons
(cherry picked from commit b23ce7ba18)
2025-12-29 13:44:05 +01:00
WerWolv
2e0cbd7285 impr: Don't show crash popup when sending ^C to command line
(cherry picked from commit d6d70ca076)
2025-12-29 13:43:34 +01:00
WerWolv
bcfc9249d5 impr: Use settings icon as everywhere else for hex editor settings
(cherry picked from commit 33c4dc3347)
2025-12-29 13:43:00 +01:00
WerWolv
c74c123e44 fix: Pattern Editor content getting reset to default comment when opening new data source
(cherry picked from commit 6d976fb785)
2025-12-29 13:42:54 +01:00
WerWolv
38a59aff20 fix: Various warnings related to AutoReset variables
(cherry picked from commit 1dba144fca)
2025-12-29 13:42:30 +01:00
WerWolv
214c00ace9 fix: Pattern children not getting sorted properly
(cherry picked from commit ebc1b531ff)
2025-12-29 13:42:19 +01:00
WerWolv
0b5ab0bb1e fix: Hidden patterns getting used for pattern parent highlighting
(cherry picked from commit 5ecf122686)
2025-12-29 13:42:06 +01:00
WerWolv
49abdf1b10 fix: Theme view not being scrollable anymore
(cherry picked from commit 86c555d053)
2025-12-29 13:41:56 +01:00
WerWolv
c51f68d0fb fix: File provider not erroring out correctly when selecting a folder to open
(cherry picked from commit 8e7bd4b98a)
2025-12-29 13:41:47 +01:00
WerWolv
b55e71e0a6 fix: Make sure updater properly exists after launching update process
(cherry picked from commit e28f3b75a4)
2025-12-29 13:41:24 +01:00
WerWolv
f2e7d25429 fix: Use of non-atomic variables
(cherry picked from commit bff78704cc)
2025-12-29 13:39:23 +01:00
iTrooz
0a194d5893 chore: update my email
(cherry picked from commit 40651e8dfd)
2025-12-29 13:37:58 +01:00
WerWolv
246ad5d80d fix: Forwarder not correctly returning return code on Windows
(cherry picked from commit 4e628826c3)
2025-12-29 13:37:58 +01:00
WerWolv
34bc55a648 git: Fix AUR release CI not having repo available anymore 2025-12-21 20:09:50 +01:00
WerWolv
76cf877115 build: Disable ARM msi signing because it doesn't work 2025-12-21 16:04:44 +01:00
WerWolv
8e4ccef52f build: Don't fail release CI if tag is empty 2025-12-21 14:54:33 +01:00
WerWolv
b78a1024c1 fix: Duplicate artifact name in release CI 2025-12-21 14:33:16 +01:00
WerWolv
fbae871d65 build: Bump version to 1.38.1 2025-12-21 14:00:33 +01:00
WerWolv
1a9fa0875b patterns: Update pattern language 2025-12-21 13:02:07 +01:00
WerWolv
96232c2d80 impr: Better updater experience on macOS
(cherry picked from commit 428fbddbbb)
2025-12-21 12:53:31 +01:00
WerWolv
6405c75242 fix: Updater architecture check on MSVC
(cherry picked from commit 5774837a6e)
2025-12-21 12:51:59 +01:00
WerWolv
5a853569e6 fix: Fedora 43 not being updatable 2025-12-19 19:16:57 +01:00
WerWolv
ea9d965ffe fix: Linux aarch64 detection in the updater
(cherry picked from commit 155465b8c6)
2025-12-19 19:08:05 +01:00
WerWolv
8b84c47b73 fix: Updater not detecting architecture on Windows correctly
(cherry picked from commit 6f49bbdd41)
2025-12-19 18:15:26 +01:00
iTrooz
a3cd6e6a40 ci: cancel old workflows when pushing a new commit
(cherry picked from commit 3badaa5cba)
2025-12-19 18:15:26 +01:00
iTrooz
2f707afa67 ci: build dependencies in different step than configuring cmake (#2574)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->

### Implementation description
<!-- Explain what you did to correct the problem -->

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->

(cherry picked from commit a66747a0d0)
2025-12-19 18:15:26 +01:00
iTrooz
765c8f4fe2 chore: update invalid comments in arm64 Dockerfile
(cherry picked from commit c376759be0)
2025-12-19 18:15:26 +01:00
iTrooz
4120e10a95 fix: DiskProvider::open() default result on Windows (#2573)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->

### Implementation description
<!-- Explain what you did to correct the problem -->

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->

(cherry picked from commit 1c17f3ee43)
2025-12-19 18:15:26 +01:00
paxcut
67ec26b22a patterns: update pattern language (#2572)
for the ghost break point bug

(cherry picked from commit 5f549cc8aa)
2025-12-19 18:15:26 +01:00
WerWolv
937ca4a327 fix: Disk provider still using old open() api on windows
(cherry picked from commit 2d82776e62)
2025-12-18 00:15:53 +01:00
WerWolv
96587415f6 fix: Test Provider still using old open function signature
(cherry picked from commit fdee0ac3e3)
2025-12-18 00:15:53 +01:00
iTrooz
b2f062cf10 chore: use cleaner yaml format for clang-tidy
(cherry picked from commit 2047a41498)
2025-12-18 00:15:53 +01:00
iTrooz
91ef40ec99 chore: disable all clang-tidy checks in third_party libraries
(cherry picked from commit f88890a052)
2025-12-18 00:15:53 +01:00
WerWolv
684a9b3009 fix: Inverted logic when opening files from the command line
(cherry picked from commit 5500faa57e)
2025-12-18 00:15:53 +01:00
WerWolv
51d773cf14 impr: Handle provider opening more centrally, switch to existing provider if same file is being opened again
(cherry picked from commit 89004574d3)
2025-12-18 00:15:53 +01:00
iTrooz
cae063985a build: do not bundle SDK in snap and flatpak packages (#2567)
(cherry picked from commit c11c05a399)
2025-12-18 00:11:23 +01:00
WerWolv
798bd25202 fix: Make sure providers returned by createProvider don't get deleted unexpectedly
(cherry picked from commit baa3329e7f)
2025-12-18 00:11:23 +01:00
WerWolv
11df253fd3 fix: Pattern files not getting truncated correctly when saving
Fixes #2566

(cherry picked from commit 932c281223)
2025-12-16 10:03:26 +01:00
WerWolv
a44278b1fe impr: Make most windows non-scrolling by default
(cherry picked from commit 858fe0384e)
2025-12-16 10:03:22 +01:00
WerWolv
cd7705664d fix: Inverted sorting of find view table
Fixes #2564

(cherry picked from commit e904cd749f)
2025-12-16 10:03:17 +01:00
WerWolv
23e484c468 fix: Typo in crash popup
(cherry picked from commit c161a5c71b)
2025-12-16 10:03:05 +01:00
WerWolv
c4c8c46c11 patterns: Update pattern language
(cherry picked from commit 76ccdbccea)
2025-12-15 10:11:09 +01:00
WerWolv
f633c3f33a fix: Only enable widgets in pattern data view when there's actually any patterns available
(cherry picked from commit 553ee89787)
2025-12-15 10:11:09 +01:00
WerWolv
b8bcb815c8 fix: Crash when using @ command palette command
Fixes #2563

(cherry picked from commit cb6247b16e)
2025-12-15 10:11:09 +01:00
WerWolv
81826df897 impr: Unionize exception and assertion handling
(cherry picked from commit cfac7ff0ba)
2025-12-15 10:11:09 +01:00
iTrooz
f6b2251205 build: remove IMHEX_PLUGINS_IN_SHARE option + only allow AppImage to load plugins from inside itself
Rationale: The `IMHEX_PLUGINS_IN_SHARE` is a hack to prevent the appimage from loading plugin from system imhex installation, like /usr/lib/imhex/

In reality, I do not think people compile plugins specifically for the AppImage (plugins must be compiled for the specific imhex & compiler version the imhex binary is used), and this lets us remove the hack

(cherry picked from commit 49bbe7dc77)
2025-12-15 10:11:09 +01:00
iTrooz
1a7fefbc22 build(web): add BUILD_TYPE arg to Dockerfile
(cherry picked from commit 07b6fa0e2e)
2025-12-15 10:11:09 +01:00
iTrooz
fdc1434cc6 chore: fix web Dockerfile ARG syntax
(cherry picked from commit 67396f2009)
2025-12-15 10:11:09 +01:00
iTrooz
230568f681 chore: update comment
(cherry picked from commit a20ff87cc9)
2025-12-15 10:11:09 +01:00
iTrooz
48c869fc89 chore: remove version attribute from web compose.yaml
(cherry picked from commit e02e57a729)
2025-12-15 10:11:09 +01:00
iTrooz
4222904be9 build(appimage): use https when querying repos
(cherry picked from commit 225dc53795)
2025-12-15 10:11:09 +01:00
iTrooz
20b4630faa build: do not bundle plugin SDK in AppImage
(cherry picked from commit e7404376db)
2025-12-15 10:11:09 +01:00
iTrooz
6ddf2bb9fd build(web): make a shallow clone of vcpkg
(cherry picked from commit d6aec341fe)
2025-12-15 10:11:09 +01:00
iTrooz
77f049f0aa build: add defaults to AppImage build for x86
(cherry picked from commit 3a3c2fb204)
2025-12-15 10:11:09 +01:00
iTrooz
588412543c build: fix IMHEX_INCLUDE_PLUGINS defined check
(cherry picked from commit e9b5cdbccf)
2025-12-15 10:11:09 +01:00
iTrooz
9939007fcf chore(web): allow nginx to access files in development docker image
(cherry picked from commit 3f30e63d95)
2025-12-15 10:11:09 +01:00
iTrooz
119f6f78b9 build: require all plugins that builtint depends on to be present
(cherry picked from commit f9c6866c7b)
2025-12-15 10:11:09 +01:00
iTrooz
e2e397f188 chore: organise cmake build flags
(cherry picked from commit 388dccfd9f)
2025-12-15 10:11:09 +01:00
paxcut
60e2c32ae0 Various fixes for pattern editor (#2561)
- Fix for vertical scroll bar being too far to the left.
- Fix constructor not initializing from const char pointer properly
- maxcolumn not being set for console text lines causing crashes on
empty pattern evaluation
- A replacement using replace all is now undone in one step.
- Find/replace no longer need to have enter or return key to accept
text. You can use arrows or shortcuts.
- More efficient search replace implementation with plans to add even
faster.
- Tooltips added to find/replace window
- Providers now save both horizontal and vertical scroll positions when
switching to another one and restore them when switching back. This is
independent to the cursor position which is also saved.
- Pattern editor no longer takes focus when changing providers via a tab
click. This has the effect that menus won't change by just clicking on a
tab.
- Small fixes and code refactoring.

(cherry picked from commit 1676342e28)
2025-12-15 10:11:09 +01:00
WerWolv
febd46ec58 fix: Gaps in-between hex editor highlighting on specific scalings
(cherry picked from commit 62732de227)
2025-12-15 10:11:09 +01:00
WerWolv
bb9a0517fe impr: Intercept glibc++ assertion handler
(cherry picked from commit 63e777c84c)
2025-12-15 10:11:09 +01:00
WerWolv
e03d3d9f36 fix: Minimap not allowing scrolling as far as the scroll bar
(cherry picked from commit ab95cdf3e5)
2025-12-15 10:11:09 +01:00
WerWolv
08daaec380 patterns: Update pattern language
(cherry picked from commit 827b5b01dd)
2025-12-15 10:11:09 +01:00
paxcut
5a9f44e696 impr: Various fixes and improvements to the pattern editor (#2559)
- fixed crash when utf8 chars were present in text editor
- fixed unable to scroll when cursor at line 1
- removed dependencies on thext editor that were not being used.

I had to go back to the old code (old for me) and fit in the changes
that were applied to the new code.That was only possible by
incorporating some of the new structural differences to the text editor.
This created new bugs and crashes that I ve have fixed but there may be
ones that I couldn't find in the very small amount of time I could spend
testing so that this commit wouldn't be delayed. If more crashes are
found due to the mixing of old and new code they should be resolved when
the new code is brought in.

(cherry picked from commit bfa9788099)
2025-12-15 10:11:09 +01:00
WerWolv
c95cbc5933 fix: Extended ASCII display being enabled by default
(cherry picked from commit 21e61bfce6)
2025-12-12 13:15:32 +01:00
WerWolv
516a2f119e build: Update libwolv
(cherry picked from commit 82e168c438)
2025-12-12 13:15:32 +01:00
WerWolv
99e81b53af build: Go back to WiX 4 again for ARM64 support
(cherry picked from commit 48583a2b6e)
2025-12-11 23:41:57 +01:00
WerWolv
8bce2b072c build: Update dependencies
(cherry picked from commit 0db0982fa7)
2025-12-11 23:24:33 +01:00
WerWolv
539a00ae5d fix: Off-by-one of starts of process memory regions
(cherry picked from commit f234103320)
2025-12-11 23:23:51 +01:00
WerWolv
38075a1438 fix: Crash when canceling creation of SSH provider
Fixes #2557

(cherry picked from commit fb7ef61d06)
2025-12-11 23:23:51 +01:00
WerWolv
2c82d561c0 build: Force-set REINSTALLMODE=amus for WiX installer
(cherry picked from commit 2586645d02)
2025-12-11 23:23:51 +01:00
WerWolv
48e72a88c2 build: Use WiX 3 for packaging
(cherry picked from commit e23cb5509d)
2025-12-11 23:23:51 +01:00
WerWolv
95c9168e25 build: Fix version stripping issues
(cherry picked from commit 5cbd53ae7a)
2025-12-11 23:23:51 +01:00
WerWolv
64cbc16f78 build: Only build the version stripper on mingw
(cherry picked from commit a4ee590875)
2025-12-11 23:23:51 +01:00
WerWolv
b5f63e899c build: Force-remove all version information from libwinpthread
(cherry picked from commit 495608ed7c)
2025-12-11 23:23:51 +01:00
WerWolv
0a994d61b3 build: Manually set FILEVERSION of libwinpthread to 0.0.0.0
#2550

(cherry picked from commit 4d10d9a195)
2025-12-11 23:23:51 +01:00
WerWolv
a8237326ad build: Fix WiX patch
(cherry picked from commit 4914a34dd9)
2025-12-11 23:23:51 +01:00
WerWolv
1253d68256 fix: Reset selected row after checking it
(cherry picked from commit ab0fb3131d)
2025-12-11 23:23:51 +01:00
WerWolv
c944750f4d build: Try to force-overwrite libwinpthread
(cherry picked from commit 7922d3b3cb)
2025-12-11 23:23:51 +01:00
WerWolv
fb21f11554 fix: Editing of WString, String16, String32 in data inspector
(cherry picked from commit e6eee55810)
2025-12-11 23:23:51 +01:00
WerWolv
d8e54e535b impr: Allow Esc to clear editing and selected state in data inspector
(cherry picked from commit 77b9e3eac8)
2025-12-11 23:23:51 +01:00
WerWolv
59afa06bf4 impr: If there's multiple foreground highlighting providers, only evaluate until a color is found
(cherry picked from commit 790487eea6)
2025-12-11 23:23:51 +01:00
WerWolv
358f961f50 build: Remove file version from main executable to make msi installer not skip it
(cherry picked from commit 9ba8754f97)
2025-12-11 23:23:51 +01:00
WerWolv
fc1b30eef2 build: Fix deb package referring to incorrect md4c library package
Fixes #2548

(cherry picked from commit 2b3abd06db)
2025-12-07 16:26:54 +01:00
WerWolv
596564ec48 fix: Post-pone file opening till everything has been initialized
(cherry picked from commit 3f9ce561b9)
2025-12-07 16:26:54 +01:00
WerWolv
a652b95816 impr: Show proper error message if nethost header can't be found
(cherry picked from commit 347fc3ed9f)
2025-12-07 16:26:54 +01:00
WerWolv
0e3ce90db7 impr: Make icons look slightly nicer at low resolutions
(cherry picked from commit 0488c996e9)
2025-12-07 16:26:54 +01:00
WerWolv
a3f31da365 git: Make release CI more reliable
(cherry picked from commit 37bfd97d93)
2025-12-07 16:26:54 +01:00
WerWolv
27518cc584 Merge branch 'feature/code-signing'
(cherry picked from commit c8652b0576)
2025-12-07 16:26:42 +01:00
WerWolv
3bcce0a243 git: Fix issues with the release CI
(cherry picked from commit 1208d2eb5e)
2025-12-07 16:26:36 +01:00
WerWolv
83650c908d git: Fix invalid renaming logic 2025-12-06 22:24:07 +01:00
WerWolv
afa297bb53 build: Fix macOS and Snap builds not bundling latest patterns 2025-12-06 20:57:51 +01:00
WerWolv
00986d0ea8 build: Bump version to 1.38.0 2025-12-06 19:56:30 +01:00
WerWolv
633914316a build: Fix wrong name of cli launcher script 2025-12-06 19:14:53 +01:00
WerWolv
205bb81a0a patterns: Update pattern language 2025-12-06 16:50:49 +01:00
WerWolv
60a69e3a54 patterns: Update pattern language 2025-12-06 16:26:52 +01:00
WerWolv
5c629494da build: Update libwolv 2025-12-06 16:12:04 +01:00
WerWolv
95f010395c fix: Pressing enter while in insert mode not behaving correctly 2025-12-06 16:11:28 +01:00
WerWolv
d575d0f724 patterns: Update pattern language 2025-12-06 16:11:28 +01:00
WerWolv
bdbdb46005 fix: Menu items with the ShowOnWelcomeScreen shortcut modifier not producing a valid shortcut on macOS 2025-12-05 22:56:16 +01:00
WerWolv
efc28a3177 pattern: Update pattern language 2025-12-05 22:23:17 +01:00
WerWolv
5d50653495 patterns: Update pattern language 2025-12-05 21:34:13 +01:00
WerWolv
24c55beb9c build: Fix broken FindmbedTLS script 2025-12-05 20:32:47 +01:00
WerWolv
04547ad6af build: Add CMake Debug option to run configuration 2025-12-05 20:32:32 +01:00
WerWolv
d2951d06b2 build: Update capstone 2025-12-05 20:23:40 +01:00
WerWolv
926910bf6e feat: patterns: Update pattern language
Fixes #2538
2025-12-05 20:23:34 +01:00
WerWolv
6652750044 build: Add preliminary build support for mbedTLS 4 2025-12-05 20:20:11 +01:00
WerWolv
ab3853eb9d build: Properly link against the homebrew llvm libc++ library on macOS 2025-12-05 19:26:09 +01:00
WerWolv
4f4af83699 build: Fix more macOS build issues 2025-12-05 18:06:51 +01:00
iTrooz
df3200f936 refactor: move hex editor popups to their own files (#2536) 2025-12-05 12:04:49 +01:00
iTrooz
7374a06faa fix: Linux SDK looking for files in the wrong place + update doc on building SDK (#2537) 2025-12-05 12:02:39 +01:00
WerWolv
22b13f5ba6 build: Fix another llvm20 instance 2025-12-05 00:08:06 +01:00
WerWolv
031301e1bb git: Fix macOS clang paths 2025-12-04 23:54:49 +01:00
WerWolv
3ad508c6fc build: Update llvm version on macOS 2025-12-04 23:50:24 +01:00
WerWolv
c3421aef8c fix: Initializing std::atomic_flag makes no sense 2025-12-04 21:04:48 +01:00
WerWolv
f2e8d402dd impr: Calculate hashes in a background thread 2025-12-04 20:57:06 +01:00
WerWolv
ab54acb176 fix: Find results staying behind until new search has finished 2025-12-04 17:29:45 +01:00
WerWolv
7585e191d0 build: Fix Windows 32 bit build 2025-12-04 17:29:18 +01:00
WerWolv
a4f6795a44 build: Update macOS ARM docker to latest clang version and macOS 15 SDK 2025-12-04 17:28:54 +01:00
WerWolv
3529bce009 build: Update dependencies 2025-12-04 17:28:09 +01:00
WerWolv
bc3afbb271 build: Upgrade emscripten to latest release 2025-12-03 21:33:32 +01:00
WerWolv
a0d0621725 build: Start using std::from_chars 2025-12-03 20:48:22 +01:00
WerWolv
c2d70dbd50 fix: Build issues on clang 2025-12-03 19:51:35 +01:00
WerWolv
e2fdd91956 feat: Add option to access remote files using raw SSH 2025-12-03 19:23:42 +01:00
WerWolv
2a84534ced impr: Don't hide entire data inspector UI anymore if no bytes are selected 2025-12-03 19:21:47 +01:00
WerWolv
94b53592d9 impr: Only show remaining Open File / New File menu options when they make sense 2025-12-03 19:21:23 +01:00
WerWolv
09006588fc feat: Allow integer literals to be used in binary patterns 2025-12-03 19:20:45 +01:00
WerWolv
9d5cdaeb33 fix: Tutorial highlights not always being visible still 2025-12-02 23:03:02 +01:00
WerWolv
d4df465633 feat: Replace useless constants view with a constant search option in the Find view 2025-12-02 23:02:44 +01:00
WerWolv
da0c1674a6 patterns: Update pattern language 2025-12-02 20:05:52 +01:00
WerWolv
18aa11117a impr: Fix fixed point inspector row requiring the correct number of bytes to be selected 2025-12-02 20:01:46 +01:00
WerWolv
ed32439645 impr: Only add stacktrace to exceptions thrown in main thread 2025-12-02 20:00:19 +01:00
WerWolv
5c890e710e build: Improve info in metainfo file 2025-12-02 19:59:24 +01:00
Nik
d15b7862b8 fix: Build error due to size_t not being u64 on macOS 2025-12-02 08:08:19 +01:00
WerWolv
0e5136196a fix: Potential infinite loop while wrapping text 2025-12-01 22:57:49 +01:00
WerWolv
46fdbd5bc0 fix: String inspector rows not displaying the correctly decoded value 2025-12-01 22:38:56 +01:00
WerWolv
da755ec75b feat: Added pattern context menu for copy and edit 2025-12-01 21:25:57 +01:00
WerWolv
d610f787b9 Revert "build: Enable color cli output for ninja builds"
This reverts commit a2ce89af32.
2025-12-01 20:36:36 +01:00
WerWolv
1ab1f7ada0 fix: Comparison between literal and optional 2025-12-01 20:35:55 +01:00
WerWolv
56cb1f2747 fix: Pattern auto loading not working anymore
Fixes #2531
2025-12-01 19:54:55 +01:00
WerWolv
413c6b5116 fix: Some interactive help regions not being highlighted 2025-12-01 19:38:19 +01:00
WerWolv
f4753a5bd8 feat: Added hex editor minimap option to shade cells based on the byte's value 2025-12-01 19:37:36 +01:00
WerWolv
980438008c fix: Crashes and usability issues with the pattern tree filter 2025-12-01 19:35:22 +01:00
WerWolv
8f57dd86af fix: Typos 2025-12-01 19:33:21 +01:00
WerWolv
a2ce89af32 build: Enable color cli output for ninja builds 2025-12-01 19:32:49 +01:00
WerWolv
67008288e2 fix: Clear pattern editor change flag after setting help text 2025-11-30 23:57:52 +01:00
WerWolv
4caa0ce570 fix: Turn cli file path into absolute path before passing it on 2025-11-30 23:57:22 +01:00
WerWolv
4e2dcef7d7 fix: Crash when an error occurrs when opening a file through the cli 2025-11-30 23:14:02 +01:00
WerWolv
f47a248768 build: Properly link mbedtls in brewfile 2025-11-30 23:01:49 +01:00
WerWolv
862462c5bb build: Keep using mbedTLS 3 on macOS 2025-11-30 22:39:35 +01:00
WerWolv
375471160f build: Fix capstone license path on AlmaLinux 2025-11-30 21:42:23 +01:00
WerWolv
4000e7c886 build: Upgrade to macOS 15 due to GitHub Actions deprecation 2025-11-30 21:32:57 +01:00
WerWolv
48095671c3 build: Put launcher shell script into share folder 2025-11-30 21:12:36 +01:00
WerWolv
c96b47f345 feat: Added RGBA8 and RGB565 minimap visualizer 2025-11-30 21:01:20 +01:00
WerWolv
b250172bb5 fix: Wrong localization keys for some MIPS disassembler options 2025-11-30 20:41:48 +01:00
WerWolv
257b248f34 build: Add imhex launcher shell script to rpm 2025-11-30 20:40:43 +01:00
WerWolv
a8fe63ee93 impr: Better name and icons for recent files 2025-11-30 20:34:00 +01:00
WerWolv
d359a21a66 impr: Add icons to welcome screen description buttons 2025-11-30 20:33:38 +01:00
WerWolv
e5cdf22753 build: Update capstone to latest alpha tag 2025-11-30 19:50:05 +01:00
WerWolv
c33d53b728 feat: Add support for Capstone 6, drop support for Capstone 4 2025-11-30 19:49:07 +01:00
WerWolv
e5829a316b impr: Remove the constants view from the views menu as it's still pretty much useless 2025-11-30 16:43:24 +01:00
WerWolv
569bf474bd impr: Replace the data information "Analyze page" button with an "Analyze" button 2025-11-30 16:42:46 +01:00
WerWolv
06ecd5d571 feat: Add support for markdown to the comments of bookmarks 2025-11-30 16:42:20 +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
989f7f7678 impr: Add option to ShortcutManager to get a shortcut by its name 2025-11-30 16:40:23 +01:00
WerWolv
a75947e611 fix: Show auto backup button not being translatable 2025-11-30 14:36:09 +01:00
WerWolv
1d4233514f impr: Add dropdown to disassembler architectures 2025-11-30 14:08:40 +01:00
WerWolv
fa780e9706 impr: Add some help text to the pattern editor by default 2025-11-30 14:08:21 +01:00
WerWolv
cba93e87eb fix: Issues with drawing interactive tutorial 2025-11-30 14:07:57 +01:00
WerWolv
f3a2fe5b0d build: Update ImGui 2025-11-30 14:04:38 +01:00
WerWolv
ebee8ff0a6 build: Include a launcher shell script with the executables
Closes #2528
2025-11-30 12:03:12 +01:00
WerWolv
34971162cb fix: Crash in some cases when starting ImHex with --open 2025-11-30 12:03:12 +01:00
WerWolvTranslationBot
58eec483c9 lang: Translations update from Weblate (#2480)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: liushuyu <liushuyu011@gmail.com>
2025-11-29 13:02:09 +01:00
David Given
c57f071f0c impr: Add hooks to let Views to get notified when they are opened or closed (#2493)
This is a trivial change which adds virtual methods to View, `onOpen()`
and `onClose()`, which are called when the view is opened or closed.

This information is already tracked inside the View, but not exposed via
the API. There is `didWindowJustOpen()` and `didWindowJustClose()`, but
these fetch and then reset the flag, so they can't be used more than
once in a frame (and are sometimes called by the frame, meaning the flag
has already been consumed by the time the View's draw callback gets
called).

The use case here is that I have a View which needs to do some work
every time it's shown.
2025-11-29 13:01:38 +01:00
Stefan
b30e2bcfa4 lang: Fix typo in German language file (#2525) 2025-11-29 13:00:37 +01:00
WerWolv
b56c3c5a46 git: Add retry for downloading mesa 2025-11-29 11:11:53 +01:00
WerWolv
120c4202b4 git: Fix CodeQL CI failing 2025-11-29 10:58:33 +01:00
WerWolv
1f257290ab impr: Manually parse time auto backup time strings as std::chrono::parse is not available everywhere 2025-11-29 10:57:40 +01:00
WerWolv
4d585d17de fix: Achievements re-triggering in cases where an achievement is triggered before its save is loaded 2025-11-29 09:07:37 +01:00
WerWolv
2c7da65242 impr: Add auto backups to crash restore popup 2025-11-29 09:06:49 +01:00
WerWolv
95ff52b025 build: Update dependencies 2025-11-29 09:06:25 +01:00
iTrooz
b1e2185966 fix: Always order recent providers (#2490) 2025-10-31 21:01:30 +00:00
iTrooz
5d77402211 fix: add newly created projects to "Recent" (#2492)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->
Projects weren't being saved as recent when a new project was saved.
They were only added as recent when re-opening the project

### Implementation description
<!-- Explain what you did to correct the problem -->
I also save projects as recent when saving them (I don't make a
difference between saving existing and new projects)

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->
2025-10-31 20:34:29 +01:00
iTrooz
f762cc2906 ci: add support for Fedora 43 (#2489) 2025-10-31 20:34:14 +01:00
paxcut
7ca2e558c9 patterns: updated pattern language (#2483) 2025-10-23 04:25:02 -07:00
WerWolv
e388d0c5e8 impr: Remove unnecessary moves in the task manager 2025-10-18 00:01:27 +02:00
WerWolv
05f8d9302d impr: Add proper move constructors to UnlocalizedString 2025-10-17 23:47:03 +02:00
WerWolvTranslationBot
8f277f00a4 lang: Translations update from Weblate (#2472)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Yaroslav <mrikso821@gmail.com>
2025-10-17 23:25:59 +02:00
WerWolv
59f9da59e2 impr: Less unnecessary copying 2025-10-17 23:23:48 +02:00
WerWolv
8d4415fe15 patterns: Updated pattern language
Fixes #2478
2025-10-17 23:23:33 +02:00
WerWolv
fd54b2b803 fix: Don't try to move a const reference 2025-10-17 19:33:27 +02:00
WerWolv
ba6953fda4 fix: Color picker slider moving around when dragging them 2025-10-17 19:33:08 +02:00
WerWolv
c0f667ce20 patterns: Updated pattern language 2025-10-17 19:32:49 +02:00
WerWolv
c93c15563a build: Bump macOS minimum version in all places 2025-10-14 22:56:34 +02:00
WerWolv
d0340c13dc build: Bump macOS minimum version to 13.3 2025-10-14 22:16:29 +02:00
WerWolv
c6caa1d067 git: Fix nightly release runner running when there's nothing to do 2025-10-14 22:11:55 +02:00
WerWolv
2f0efa1197 build: Updated libwolv 2025-10-14 21:55:13 +02:00
WerWolv
a76eae2c11 build: Updated libwolv 2025-09-25 18:01:53 +02:00
WerWolv
b82c1f051c build: Update libwolv 2025-09-24 21:20:56 +02:00
WerWolv
1b6a150624 build: Move jthread library to libwolv 2025-09-24 20:48:50 +02:00
WerWolv
265360229f fix: ImGui assert due to trying to select tab bar button 2025-09-24 20:37:15 +02:00
WerWolv
98e9729267 fix: Preview fonts not being properly reset during soft-restarts 2025-09-21 22:11:28 +02:00
WerWolv
cfe16ee2c5 build: Updated dependencies 2025-09-21 12:47:45 +02:00
WerWolv
c9f856b219 build: Updated libwolv 2025-09-21 11:31:56 +02:00
Zackary Newman
3c167c3306 feat: Add keyboard shortcuts to jump to the prev/next differences in diff view (#2445)
Adds keyboard shortcuts (currently `n` and `N`) in the diffing plugin
view to jump to the next/prev difference in the list.

IMPORTANT NOTE: Depends on changes made in a library submodule. [This
PR](https://github.com/WerWolv/libwolv/pull/34) must be accepted first.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2025-09-21 10:39:37 +02:00
WerWolv
fedbce6f9e build: Fix emscripten build issues 2025-09-20 12:11:25 +02:00
WerWolv
28be4cea97 build: Move X11 library linking to backend, make X11 not required 2025-09-20 11:44:31 +02:00
WerWolv
05fb2bfd23 impr: Use better icon for the download update button 2025-09-19 18:22:35 +02:00
WerWolv
3905335c53 build: Update Tabler icons 2025-09-19 18:22:06 +02:00
WerWolv
4dc3f9e033 build: Update ImGui Test Engine 2025-09-19 18:21:57 +02:00
WerWolv
07a6a9b7d4 build: Update ImGui backend 2025-09-19 18:21:02 +02:00
WerWolv
fac7dff77f build: Updated ImGui to v1.92.3 2025-09-17 22:19:02 +02:00
WerWolv
60c7ced335 build: Change AppImage sourceline to noble 2025-09-17 21:59:05 +02:00
WerWolv
8f981e7707 fix: Prevent providers to be created via "Open Recent" menu while tasks are running 2025-09-17 20:56:28 +02:00
WerWolv
725cc10a92 lang: Un-hide Ukrainian language 2025-09-17 20:53:47 +02:00
WerWolvTranslationBot
d3896ccfda lang: Added Ukrainian language (#2444)
Translation by @RutarAndriy
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Rutar Andriy <RutarAndriy@gmail.com>
2025-09-17 20:52:24 +02:00
WerWolv
de3e532a5c build: Go back to Ubuntu 24.04 for AppImages since AppImageBuilder doesn't support 25.04 2025-09-17 20:47:14 +02:00
WerWolv
98369600c3 impr: Various rendering performance improvements 2025-09-17 20:46:15 +02:00
WerWolv
d9aaef29d2 git: Make Snap upload errors not fail CI 2025-09-17 12:03:58 +02:00
WerWolv
48f4410a2a build: Remove EoL Ubuntu 24.10 builds, Update AppImage runner to use 25.04 2025-09-17 12:01:29 +02:00
WerWolv
ca0b232ada fix: Data inspector not updating when reloading file changes
Fixes #2451
2025-09-16 23:34:38 +02:00
WerWolv
75efe39298 fix: Pattern Data table not retaining column settings in all cases 2025-09-16 23:28:31 +02:00
WerWolv
84342f7a7b git: Added Jetbrains to sponsors section 2025-09-14 19:28:20 +02:00
Zackary Newman
67efea6444 Fix segfault when opening recent file with pattern sync; Don't show p… (#2448)
…attern selection popup when pattern is already open

This PR does two things. Most importantly, it fixes a segfault that can
be caused by opening a recent file with pattern sync enabled.
Secondly, it makes it so that the pattern selection popup does not
appear if you already have text in the pattern editor for a given
provider (due to CLI args, a project file, pattern sync, etc.). If you
open a file normally, that text field is empty and the popup will appear
so you can select a pre-made pattern like usual.
2025-09-13 21:10:38 -07:00
WerWolv
f08b182bf2 impr: Make sure pattern settings window doesn't go off-screen anymore
Fixes #2446
2025-09-13 11:30:13 +02:00
WerWolv
3c83a62aef git: Add note for people with push access 2025-09-13 10:22:28 +02:00
WerWolv
821db4d2a1 impr: Allow hiding unfinished languages in non-debug mode 2025-09-12 22:47:17 +02:00
WerWolv
3c661842a2 lang: Added empty files for Ukrainian 2025-09-12 22:15:10 +02:00
WerWolv
920578003e lang: Added skeleton structure for Ukrainian language
#2443
2025-09-12 21:55:53 +02:00
WerWolvTranslationBot
22aadcc1ae lang: Translations update from Weblate (#2442)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
2025-09-12 21:11:59 +02:00
WerWolv
efc65479c6 git: Added sponsorship section and note to comply with SignPath's terms 2025-09-12 21:09:00 +02:00
Zackary Newman
dcbba9cbfc impr: Rework command line argument parsing (#2440)
The current CLI argument parsing did not work as documented and had a
number of issues related to multi-flag (subcommand) parsing. I've
reworked the logic in such a way that should maintain full compatibility
with any existing scripts/use-cases but with added functionality.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2025-09-12 21:07:33 +02:00
WerWolvTranslationBot
6169078c04 lang: Translations update from Weblate (#2437)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Francisco J. Solis <siscomagma@gmail.com>
2025-09-11 20:12:02 +02:00
WerWolv
955f48f532 impr: Use better icons for data inspector buttons 2025-09-11 20:11:25 +02:00
Shadow775711
d7a830ca95 lang: Update Polish translation (#2420)
Unfortunately, I had to create a new fork and branch because GitHub kept
rejecting my push due to the workflow files (nightly_release.yml and
release.yml), even though they were not intentionally modified.

I only made changes in two language files and added a helper script
Formatter.py.

Please test if everything works correctly in the interface.

Thanks for the project, and I’m happy to help further if needed.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2025-09-11 20:10:53 +02:00
sonorousfreq
96b27645d6 feat: Add region sidebar list to Intel Hex and Motorola SREC providers (#2417)
Add block list for intel hex and motorola srec

TEST: Load various hex and srec files
 - Test search capability
 - Test jump to section

### Problem description
The intel-hex/motorola formats can be loaded but not quite ideally,
including there is no list of segments/blocks that
can be extracted from file layout (metadata).

### Implementation description
I implemented similar feature as process monitor provider does, to
extract chunks while parsing the file and show
them as a sidebar list

### Screenshots
Looks like this:
<img width="1893" height="897" alt="image"
src="https://github.com/user-attachments/assets/c37d46cb-d129-4f9a-bb9a-d8969f397c6e"
/>



### Additional things
There are some improvements that could be made:
1. There is currently no API to jump to address, which would be useful
to jump to beginning of a hex/srec segment.
2. When jumping with setSelection, jumping backwards makes the first
visible line the jump address/line, however, when jumping forward, the
jump address is at the bottom (see image).
3. Unsure about convention for searches, should we search elements as
startsWith given user string, or contains or including 0x prefix or not,
whether to keep prefix zeros since the region size is 8 bytes, but
addresses should be <= 32 bits, etc.
2025-09-11 09:50:38 +00:00
WerWolv
8b6346ae41 feat: Allow jumping to Yara rule matches
Fixes #2439
2025-09-10 21:06:28 +02:00
WerWolv
c1619820c7 impr: Jump to top of selection instead of the bottom
Fixes #2354
2025-09-10 20:50:27 +02:00
WerWolv
88ccb0e075 fix: Plugin features display not working correctly 2025-09-10 19:44:46 +02:00
WerWolv
12564dd78f impr: Fix layout of pattern settings popup 2025-09-10 19:13:47 +02:00
WerWolv
b0c4db7a64 fix: Invalid localization string for pattern settings popup 2025-09-09 23:40:36 +02:00
WerWolv
310ca6c6dc fix: Custom data processor node name ID collisions 2025-09-09 23:37:22 +02:00
WerWolv
32e3a4e74f impr: Move items from pattern editor console area to more appropriate places 2025-09-09 22:30:29 +02:00
WerWolv
be66e3fe79 impr: Simplify and standardize resizable console window in pattern editor 2025-09-08 21:24:01 +02:00
WerWolv
d794734f1d git: Fix nightly tag getting put on non-master branches 2025-09-08 20:14:03 +02:00
WerWolv
8661b6551d fix: Opening pattern sections not working 2025-09-08 19:53:51 +02:00
WerWolv
a0326c4371 impr: Properly align buttons in pattern data view 2025-09-08 19:52:12 +02:00
WerWolv
b039bc14c6 fix: Only first opened popup appearing properly 2025-09-08 19:51:58 +02:00
paxcut
d08853df8c fix: No scrolling on jumping to error source. (#2438)
When I implemented the changes to allow creating breakpoints without
losing focus in the pattern editor and without forcing it to scroll to
the cursor position I broke the code that ensures the cursor is visible
after being moved to the source code that caused the error. All I needed
to do is to explicitly set the argument because the default is to not
scroll to the cursor when focus is given to the pattern editor
2025-09-07 12:31:09 -07:00
paxcut
d8dd287cdf fix: Fixed ImHex crashing when using ctrl-backspace on empty file. (#2433)
Editor was attempting to delete non-existent chars which is UB. Fixed by
checking before deleting. Also fixed was a problem created by having to
press enter to change the search string which advanced the selection to
the first match. In the next step one would expect that pressing enter
on the replace field would replace the selected item but was replacing
the item found after he first.

This was fixed by always replacing the current selection first. If the
replacement is the same as the searched term then replacing won't
advance the cursor, but if they are different then the current match
will no longer exist so it would search fora new one.
2025-09-05 02:28:11 -07:00
paxcut
d62b64c27a Fixes for next release. (#2430)
I forgot I also had comments switched to italics done easily thanks to
WerWolv's addition that lets you push and pop them.
2025-09-02 17:29:33 -07:00
paxcut
52952652de Fixes for next release. (#2429)
Attempt to fix WerWolv's strange off by one problem when using the
mouse. Added a popup question for files that contain long lines (>1024
bytes). Also improved the handling of large lines, so it won't stall the
app. May also contain other smaller issue fixes.
2025-09-02 15:30:50 -07:00
WerWolv
790c19a1cd patterns: Go back to working pattern language 2025-09-01 22:54:51 +02:00
WerWolv
9659381378 git: Fix IMHEX_VERSION env var not getting set in snap CI 2025-09-01 17:56:49 +02:00
WerWolv
4598fc098d fix: ImGui ID not getting popped correctly 2025-08-31 22:17:36 +02:00
WerWolv
2f6fde1e61 build: Rename cmake project to ImHex 2025-08-31 22:17:00 +02:00
WerWolv
16dc199431 fix: Achievement popup setting only being read once at startup 2025-08-31 17:31:16 +02:00
WerWolv
715e970d99 fix: Last column in text editor not being selectable 2025-08-31 16:59:40 +02:00
WerWolv
53535ab9be build: Updated lunasvg 2025-08-31 15:15:37 +02:00
WerWolv
24f9df90b8 impr: Added proper help text to ImHex updater 2025-08-31 15:11:35 +02:00
WerWolv
4cfdbb8095 patterns: Updated pattern language 2025-08-31 13:52:02 +02:00
WerWolv
fe4cb8575f impr: Sort View menu alphabetically 2025-08-31 11:22:40 +02:00
WerWolv
06ac7eb85f impr: Make Hex Editor view always be focused by default 2025-08-31 11:22:26 +02:00
WerWolv
0e14ff5a3d git: Fix naming and uploading of snap artifacts 2025-08-31 10:33:50 +02:00
WerWolv
c65015fcc7 fix: Make sure crash handling operations happen in the right order 2025-08-31 10:23:19 +02:00
paxcut
c8caf6124e Fix: Very long lines in text editor could make it hang. (#2426)
Fixed by only processing text that's visible.

Also fixed the cursor jumping to breakpoint line when selected by
clicking the line number and added highlighting of the current editing
line. An optimization that caches the number of utf-8 chars in each line
was included as well.
Finally, an error that caused ImHex to crash if a pattern was saved as
itself was also fixed.
2025-08-30 20:01:05 -07:00
WerWolv
76bb0e420d fix: Rename font_size setting to not cause issues during upgrade 2025-08-30 18:11:06 +02:00
WerWolv
d2c1b2a31b impr: Resume logging before printing crash logs 2025-08-30 14:35:29 +02:00
WerWolv
e30f073809 build: Properly link against libpthread on mingw 2025-08-30 14:27:40 +02:00
WerWolv
e1079d751a fix: Handle uncaught exceptions more gracefully 2025-08-30 14:24:39 +02:00
WerWolv
a9d45d837f fix: Missing pthread include 2025-08-30 11:21:09 +02:00
WerWolv
bcbe5eb105 fix: Use Win32 functions to terminate thread on Windows 2025-08-30 11:19:40 +02:00
WerWolv
6ab1f8e4e2 git: Fix snap version getting reset back 2025-08-30 10:56:59 +02:00
WerWolv
90f26d53d3 impr: Make viable pattern search properly abortable 2025-08-30 10:51:05 +02:00
WerWolv
281921d1de fix: Crashes in non-main threads causing freezes 2025-08-30 10:32:24 +02:00
WerWolv
9135153dc9 impr: Throw error if no data could be read with read node 2025-08-30 10:32:24 +02:00
WerWolv
c70b505b3a fix: Make RGBA8 visualizer node only copy the data it needs 2025-08-30 10:32:24 +02:00
WerWolv
cde9dc37e5 fix: Wrong localization for Add button in hashes view 2025-08-30 10:32:24 +02:00
WerWolv
ab1e5eb359 build: Updated libfmt to trunk for compatibility with Clang 21.1.0 2025-08-29 23:40:00 +02:00
WerWolv
aec9f7a145 impr: Use more muted colors in advanced text encoding column 2025-08-28 23:22:50 +02:00
WerWolv
bf08ed563a feat: Added Hex Editor "Decode as Encoding" option 2025-08-28 23:22:26 +02:00
WerWolv
ff70518882 fix: Hang when setting window title from non-main-thread 2025-08-28 23:22:02 +02:00
WerWolv
72364db768 fix: Build errors 2025-08-28 22:31:27 +02:00
WerWolv
92fa72eac7 fix: More hashes view layout issues 2025-08-28 22:29:30 +02:00
WerWolv
9e2c1de0f5 fix: Provider dirtying not changing window title 2025-08-28 22:20:39 +02:00
WerWolv
57ac73b9d4 impr: Properly vertically center search icon in search bar 2025-08-28 22:17:19 +02:00
WerWolv
2757c577e4 impr: Modernize yara view 2025-08-28 21:44:59 +02:00
WerWolv
704af30421 impr: Clean up hashes view 2025-08-28 21:22:47 +02:00
WerWolv
1e8a005d0e impr: Make data inspector view more compact 2025-08-28 20:13:51 +02:00
WerWolv
8a04d2f477 feat: Added fixed-point row to data inspector 2025-08-28 19:57:51 +02:00
WerWolv
a7c37bfb93 fix: Load ImHex logo at correct resolution 2025-08-28 17:28:13 +02:00
WerWolv
d1801ea438 build: Added CLion build target definition file 2025-08-28 17:25:29 +02:00
WerWolv
f6f856cd56 build: Added note for MSVC and Emscripten if vcpkg is not configured 2025-08-28 17:25:09 +02:00
WerWolv
8515cd43fa impr: Added note to Advanced Yara Information section if no matches were found 2025-08-28 17:24:51 +02:00
WerWolv
8a4cdbb371 impr: Slightly nicer layout for data information view 2025-08-28 17:24:14 +02:00
WerWolv
7fef133505 git: Add emoji to nightly release runner 2025-08-28 17:23:53 +02:00
WerWolv
5f206a33e2 build: Remove old OSX SDK setting 2025-08-28 17:23:24 +02:00
WerWolv
228385ceaa fix: Undefined behaviour when setting task bar progress 2025-08-28 00:01:49 +02:00
WerWolv
bd9e9a7dcf impr: Make crash handling from non-main threads more resilient 2025-08-27 23:53:46 +02:00
WerWolv
abffb8c138 fix: Text in toasts getting cut off very quickly 2025-08-27 23:34:16 +02:00
WerWolv
e353802e9f impr: Added more OpenGL version information to logs 2025-08-27 23:34:01 +02:00
WerWolv
130055af22 fix: Crash when force-exiting on macOS 2025-08-27 23:33:44 +02:00
WerWolv
db573840b0 fix: Incorrect word wrap calculation after ImGui update
#2325
2025-08-27 23:14:07 +02:00
WerWolv
e0fccacc32 fix: Nightlies always having an update available, even if we're already on latest 2025-08-27 23:05:00 +02:00
WerWolv
18890f47b6 build: Don't clone ImHex-Patterns during install step if it exists already 2025-08-27 22:58:14 +02:00
WerWolv
204cc1ccb3 build: Make sure updater gets properly bundled on macOS 2025-08-27 22:57:57 +02:00
WerWolv
a063eb96c6 fix: Markdown elements overflowing window width 2025-08-27 21:27:47 +02:00
WerWolv
145c8ff804 impr: Update about page 2025-08-27 21:27:06 +02:00
WerWolv
f0d2f94aef git: Only add run number on nightly builds 2025-08-27 17:35:31 +02:00
WerWolv
0c12cb683a git: Add workflow run number to snap version number 2025-08-27 17:33:33 +02:00
WerWolv
56b5d026df fix: Patterns only starting to execute when pattern editor was visible 2025-08-25 21:45:20 +02:00
WerWolv
40ccbd0d86 feat: Added pattern-provided file information to information view 2025-08-25 21:44:59 +02:00
WerWolv
c1a14cb4d4 impr: Ensure that wrapped text doesn't end up wrapping at every character 2025-08-25 21:22:43 +02:00
Nik
df2448e121 fix: Web version not starting anymore due to WebGL only supporting OpenGL 3.0 2025-08-25 07:29:36 +02:00
Nik
ca323c392b fix: Format string security issue 2025-08-25 07:27:08 +02:00
WerWolv
395dd37d33 fix: Pattern data section context menu not opening correctly 2025-08-24 22:13:01 +02:00
WerWolv
e91689a715 impr: Unlock frame rate during blocking task progress 2025-08-24 21:38:24 +02:00
WerWolv
861988f8dc fix: Compile errors 2025-08-24 21:35:50 +02:00
WerWolv
f26f1298cf impr: Added localization for save editor view 2025-08-24 21:24:39 +02:00
WerWolv
66efcf91d3 feat: Added file information command line option and fullscreen view 2025-08-24 21:21:34 +02:00
WerWolv
0178ba014a fix: Region picker widget overflowing in many views 2025-08-24 16:29:36 +02:00
WerWolv
254bd88e6b fix: macOS initialising very low OpenGL version by default 2025-08-24 16:10:13 +02:00
WerWolv
3808b78487 impr: Add styles and colors from newer ImGui versions to theme system 2025-08-24 14:11:38 +02:00
WerWolv
a80c35aa94 fix: Icon offsets being scaled incorrectly 2025-08-24 13:55:02 +02:00
WerWolv
d0f51d0462 fix: Undo invalid scaling 2025-08-24 13:31:45 +02:00
WerWolvTranslationBot
013fa85c1c lang: Updated localization (#2412)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: OctopuSSX <vladik0701@gmail.com>
2025-08-24 13:07:16 +02:00
WerWolv
fcda856198 fix: Font being scaled too large if main screen DPI is higher than secondary screen DPIs
#2419
2025-08-24 12:57:56 +02:00
WerWolv
e385487a6b build: Added simple Nix Flake 2025-08-24 12:49:05 +02:00
WerWolv
f8fa029ee3 patterns: Updated pattern language
Fixes #2280
2025-08-24 11:57:29 +02:00
WerWolv
d1a0f8ec97 impr: Use faster way of finding matching pattern files for loaded file 2025-08-24 10:54:27 +02:00
WerWolv
d02e147dc3 impr: Move most of the implementations of the pattern editor view to the cpp file 2025-08-24 10:34:07 +02:00
WerWolv
5c481d4247 impr: Add separator above connect button of tty view 2025-08-24 10:18:58 +02:00
WerWolv
f4cbdde8f6 fix: One too many menu item being shown in the overflow menu 2025-08-24 10:18:23 +02:00
WerWolv
0ac09fc57b impr: Modernize TTY console view 2025-08-23 23:44:49 +02:00
WerWolv
99c28c93b4 impr: Better diff view table headers 2025-08-23 23:44:39 +02:00
WerWolv
0e800723f5 impr: Store points instead of pixels for font size in settings 2025-08-23 20:56:34 +02:00
WerWolv
fc2ed47676 dist: Added featured snap banner 2025-08-23 11:04:41 +02:00
WerWolv
5c2309bcf7 fix: OpenGL detection not working correctly 2025-08-23 11:04:41 +02:00
WerWolv
ba71a300ec fix: Semantic version comparison only working in one direction 2025-08-23 11:04:41 +02:00
WerWolv
393451eed5 fix: Crash with libgl getting unloaded twice 2025-08-22 18:16:25 +02:00
WerWolv
b0b20bcb9b git: Fix snap credentials 2025-08-22 12:00:31 +02:00
WerWolv
8e8c553da4 build: Fix external plugins linking with plugin libraries 2025-08-21 23:19:31 +02:00
WerWolv
c83173098c feat: Added improved ASCII table 2025-08-21 19:45:20 +02:00
WerWolv
16c52f4008 fix: Crash when opening release notes about page 2025-08-21 19:45:07 +02:00
WerWolv
d207d98a82 patterns: Updated pattern language 2025-08-21 19:44:53 +02:00
WerWolv
5a1f3d40a7 git: Upload nightly snaps to edge channel 2025-08-21 19:44:44 +02:00
WerWolv
a667a1b6a9 git: Fix changelogs of nightlies 2025-08-21 19:44:17 +02:00
WerWolv
cfe3c5b6df fix: Still do minimum OpenGL version verification 2025-08-20 22:42:04 +02:00
WerWolv
b49e2eeac4 fix: Too new OpenGL version getting requested on Windows 2025-08-20 22:31:40 +02:00
Nik
d012ad08f8 feat: Added proper Markdown renderer (#2415) 2025-08-20 20:37:44 +02:00
WerWolv
b83f3d6cbf build: Always set snap grade to stable 2025-08-20 18:14:25 +02:00
Nik
a8be74ebb7 git: Added Privacy Policy 2025-08-19 08:30:29 +02:00
WerWolv
b5bf9f1486 fix: Don't close modals on focus change 2025-08-18 20:49:27 +02:00
WerWolv
b3d07b4573 fix: Properly ignore return value of std::system 2025-08-18 20:38:15 +02:00
WerWolv
b602fcc485 fix: Popups sometimes not opening until clicking on the window again 2025-08-18 20:37:12 +02:00
WerWolv
0908d040fa fix: Prevent multiple getStackTrace functions from running at the same time 2025-08-18 20:36:54 +02:00
WerWolv
530bd6dac4 build: Updated libwolv 2025-08-18 20:06:53 +02:00
WerWolv
441dcea705 impr: Cleanup popup creation handling 2025-08-18 20:06:42 +02:00
WerWolv
c5e0951def fix: Crash if platform backend doesn't have GetWindowFocus function defined yet 2025-08-18 20:06:06 +02:00
WerWolv
4bea8f4c65 fix: Linux toast creation code 2025-08-18 20:04:44 +02:00
WerWolv
7f5ae41d8a fix: Welcome screen quick settings executing handler more than once 2025-08-18 20:04:20 +02:00
WerWolv
35a357f1a8 fix: UTF-8 string search not working correctly 2025-08-18 20:03:45 +02:00
WerWolv
8b384ef1f9 fix: Make File -> Open File show up on Welcome Screen again 2025-08-18 20:03:27 +02:00
WerWolv
7588a84e86 fix: Only update font size after letting go of slider 2025-08-17 23:36:02 +02:00
WerWolv
d8f8e61a11 fix: Use modern notification API on macOS 2025-08-17 23:35:48 +02:00
WerWolv
3c9aa97f6c feat: Added function to show toast messages, moved native error message function to libimhex 2025-08-17 22:46:38 +02:00
WerWolv
6c28adbd24 fix: Count/Value labels swapped in the byte distribution graph 2025-08-17 20:45:12 +02:00
WerWolv
cf5b9da45e fix: Disable focus handling on the web version since the GLFW_FOCUSED attribute doesn't work 2025-08-17 20:21:36 +02:00
WerWolv
01f24d2f2f fix: Properly clear last focused window after focus was restored 2025-08-17 18:36:30 +02:00
WerWolv
592eea1bfd fix: Messed up languages file 2025-08-17 18:34:49 +02:00
WerWolv
16a4a67886 fix: Prevent data processor view from scrolling 2025-08-17 18:10:39 +02:00
WerWolv
dd3b6a47d2 fix: Remove non-existent include 2025-08-17 18:10:28 +02:00
WerWolv
fa8102f93d fix: getOSLanguage issues on macOS and the Browser 2025-08-17 17:59:56 +02:00
WerWolv
ef3678bfaf fix: Missing <mutex> include 2025-08-17 17:48:49 +02:00
WerWolv
599b339e5d tests: Check if all registered languages properly exist 2025-08-17 17:04:06 +02:00
WerWolv
682aae1497 fix: OOBE always showing up on launch 2025-08-17 15:50:43 +02:00
WerWolv
4ade751caf feat: Added support for choosing the system-native language 2025-08-17 15:50:27 +02:00
WerWolv
9f24b35b1f impr: Look and feel of OOBE 2025-08-17 14:34:24 +02:00
WerWolv
769087d139 impr: Allow forcing of OOBE through an env var 2025-08-17 14:34:12 +02:00
WerWolv
3b1f32d68d impr: Don't catch event exceptions in debug mode 2025-08-17 14:33:47 +02:00
WerWolv
4fc1f0491e fix: Various font loading issues and Weblate fuck ups 2025-08-17 14:33:34 +02:00
WerWolv
89b94ebbf9 fix: Buttons near the edges of the Window not reacting correctly to clicks
#2413
2025-08-17 10:33:26 +02:00
WerWolv
5666baf2bc impr: On/Off state of dimmed toggles easier to see 2025-08-16 20:43:41 +02:00
WerWolv
9d05f487e6 git: Updated system requirements 2025-08-16 16:47:35 +02:00
WerWolv
8b72ea81c0 fix: More window focus event issues 2025-08-16 16:47:23 +02:00
WerWolv
23085372a1 fix: Don't run migration tasks on first launch 2025-08-16 11:51:40 +02:00
WerWolv
1761033cee fix: Crash when changing find filter too quickly 2025-08-16 11:49:55 +02:00
WerWolv
48af5eb10a impr: Modernize disassembler view 2025-08-16 11:49:35 +02:00
WerWolv
d2233af8a0 impr: Make find view settings collapse when any items were found 2025-08-16 11:49:26 +02:00
WerWolv
a411d489c1 fix: Weird widget overlap with prefix inputs 2025-08-16 11:48:51 +02:00
WerWolv
3b48f537f1 git: Reduce the max ccache cache size for Fedora builds 2025-08-15 22:01:34 +02:00
WerWolv
7755e95db0 fix: Command palette content display not being displayed anymore 2025-08-15 21:57:33 +02:00
WerWolv
ac66f80a0d build: Install git as dependency on msys2 2025-08-15 21:45:56 +02:00
WerWolv
13111e2940 build: Create ImHex-Patterns folder path if needed 2025-08-15 21:37:14 +02:00
WerWolv
d0af46b175 build: Remove ImHex-Pattern folder before cloning if it exists already 2025-08-15 21:35:07 +02:00
WerWolv
18e6a5d6d2 fix: Remove unused capture 2025-08-15 21:28:31 +02:00
WerWolv
1f1d127822 build: Make ImHex-Pattern clone command error on failure 2025-08-15 21:28:03 +02:00
WerWolv
8a0639ced2 build: Don't silence the ImHex-Pattern clone command 2025-08-15 20:18:50 +02:00
WerWolv
762eacb7c8 feat: Allow any custom content to be displayed in the command palette 2025-08-15 20:17:58 +02:00
WerWolv
0ebe4150ae fix: ImHex getting stuck in unlocked FPS mode when some events are blocking 2025-08-15 19:25:25 +02:00
WerWolv
e8f799d010 impr: Make nightly commit hash easier to read 2025-08-15 19:24:48 +02:00
WerWolv
926cddd69f impr: Allow settings columns to be resized 2025-08-15 19:24:25 +02:00
WerWolv
ec2a01dfae feat: Expose tools through the command palette 2025-08-15 17:30:48 +02:00
WerWolv
f921742dcc fix: Window not being properly resizable from the top right on Windows 2025-08-15 17:30:23 +02:00
WerWolv
ce0c97e6d5 feat: Add ImGuiExt::InputPrefix 2025-08-15 17:30:07 +02:00
WerWolv
1c54e7e38b fix: Focus loss getting triggered when a popup was selected 2025-08-15 17:29:49 +02:00
WerWolv
9928439f4f impr: Modernize the base converter tool 2025-08-15 17:29:11 +02:00
WerWolv
3ed7834945 feat: Allow custom UIs to be drawn in the command palette 2025-08-15 17:29:00 +02:00
WerWolv
5853cb5ad5 build: Try to fix ImHex-Patterns install path in CI 2025-08-15 17:28:25 +02:00
WerWolv
1b476e235b build: Fix ImHex-Patterns branch in nightly builds 2025-08-15 00:00:46 +02:00
WerWolv
ef8f5c67bd build: Fix error during install in offline builds 2025-08-14 23:57:58 +02:00
WerWolv
0664937c1e build: Remove check if ImHex-Patterns repo was downloaded 2025-08-14 23:44:19 +02:00
WerWolv
aada2c1fe6 build: Only move parts of ImHex-Patterns download logic to install step 2025-08-14 23:41:51 +02:00
WerWolv
870bce2bf8 build: Fix last MSVC build errors 2025-08-14 23:39:54 +02:00
WerWolvTranslationBot
908d879a1e lang: Updated translation (#2404)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
2025-08-14 22:51:40 +02:00
WerWolv
5147d8ab63 fix: More missing includes 2025-08-14 22:49:02 +02:00
WerWolv
8a1531fc71 build: Fix install location for ImHex-Patterns content 2025-08-14 22:48:53 +02:00
WerWolv
09918041f8 build: Properly substitute ${SNAP_GRADE} env var in snap manifest 2025-08-14 22:22:55 +02:00
WerWolv
165d00dad3 build: Fix more missing includes 2025-08-14 22:22:32 +02:00
WerWolv
fa99069951 build: Move ImHex-Patterns downloading to install step 2025-08-14 21:58:20 +02:00
WerWolv
babd9584a6 build: Fix a few remaining build errors 2025-08-14 21:58:07 +02:00
WerWolv
20df023137 build: Updated libwolv 2025-08-14 21:23:27 +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
4ca429e389 impr: Allow post-processing shaders to be set dynamically 2025-08-14 17:11:37 +02:00
WerWolv
49c56e28b4 build: Improve snapcraft manifest and CI 2025-08-14 17:10:33 +02:00
WerWolv
3ec4f086ec build: Remove unused resource file 2025-08-14 17:09:53 +02:00
WerWolv
3cb5dd226c build: Updated ImGui to v1.92.2b 2025-08-13 22:46:27 +02:00
WerWolv
6a1aa2c13e impr: Close context menus on focus loss 2025-08-13 22:17:50 +02:00
WerWolv
4b73e1a184 fix: Search bar icon being too high up on macOS 2025-08-13 21:08:03 +02:00
WerWolv
5fa9aaa6a6 fix: Crash when opening provider after warm-restarting ImHex 2025-08-13 20:35:25 +02:00
WerWolv
63711f652f fix: Fonts being scaled twice as big by default on macOS 2025-08-13 20:24:00 +02:00
WerWolv
d07b4417d7 build: Updated libwolv 2025-08-13 17:32:52 +02:00
WerWolv
95ae5a26ed fix: Don't load workspaces from non-writable places since they can't be updated then 2025-08-13 17:32:04 +02:00
WerWolv
d8ad23630a build: Revert back to old way of installing vcpkg packages 2025-08-12 23:27:48 +02:00
WerWolv
c03d9301e2 build: Fetch vcpkg commits before install 2025-08-12 22:42:31 +02:00
WerWolv
6ec6851a8a build: Revert back vcpkg baseline commit 2025-08-12 21:36:55 +02:00
WerWolv
a7d3a916cc tests: Update localization key checker script for new language files 2025-08-12 21:07:30 +02:00
WerWolv
e1d1c4acca build: Fix vcpkg mess 2025-08-12 21:04:46 +02:00
WerWolvTranslationBot
bd17e0edc1 lang: Remove remaining unused keys (#2403)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

---------

Co-authored-by: Weblate <noreply@weblate.org>
2025-08-12 20:54:41 +02:00
WerWolv
6e88d08c17 git: Fix langtool 2025-08-12 20:30:16 +02:00
WerWolvTranslationBot
278babe7f2 lang: Initial Weblate re-integration (#2402)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

---------

Co-authored-by: Weblate <noreply@weblate.org>
2025-08-12 20:24:59 +02:00
WerWolv
b23f33ab6c build: Update vcpkg baseline commit 2025-08-12 19:22:54 +02:00
WerWolv
50b25882cd fix: MSVC build errors 2025-08-12 19:21:00 +02:00
WerWolv
28bfceab6c build: Updated ImGui to v1.92.2 2025-08-12 18:01:04 +02:00
WerWolv
6febe9982b impr: Significantly reduce memory usage 2025-08-12 18:00:47 +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
25c8f4b588 fix: Jump to certain array-member patterns not working
Fixes #2398
2025-08-11 21:46:47 +02:00
WerWolv
09b2e20a3d impr: Save most of the hex editor settings
#2398
2025-08-11 21:03:18 +02:00
WerWolv
e9d95c78f6 fix: Store install issues when paths are symlinked 2025-08-11 17:45:17 +02:00
WerWolv
ad2a36676c fix: Issues when running the updater on Linux 2025-08-11 17:44:49 +02:00
WerWolv
43da36a957 build: Use vcpkg manifest instead of manually installing deps 2025-08-11 17:44:20 +02:00
WerWolv
71e9f7b239 build: Add option to exclude bundling the SDK 2025-08-11 17:43:53 +02:00
WerWolv
b566d31f28 build: Don't modify CMAKE_XXX_FLAGS directly 2025-08-11 17:43:31 +02:00
paxcut
c4d167f8d4 fix: Highlighter can fail to update a files contents. (#2400)
If you project has two patterns and one is very big, switching providers
while the big file is being highlighted makes the small one skip its own
coloring. The error was caused by a failure to interrupt the ongoing
lengthy highlighting process in a timely manner. It appears that calling
task interrupt allows the task to run to completion and when the task
runs to completion then the retrying mechanism is not trigger and the
small pattern never has a task assigned for coloring.

This was fixed by creating a variable that signals the intention to
interrupt the current highlighting process. The most used function in
the highlighter (used to update the current token) checks the variable
and throws an out of range exception causing the interruption of the
current highlighter and triggering the retry mechanic.
2025-08-10 23:57:17 -07:00
paxcut
50f1fe2b2d improv: moved text editor to the ui plugin. (#2397)
Reorganized source code into files named in the fashion of imhex and
split large functions into smaller ones. Moved all function definitions
out of the header except for one-liners. All variable types were
switched to use imHex standard (u8,...) and removed duplicated functions
that were needed when the text editor was isolated.

Minor improvements to find/replace while making sure they still worked
with utf-8 chars.
2025-08-10 14:35:21 -07:00
WerWolv
75e73ddcd9 fix: Properly clean up plugin features 2025-08-10 22:45:50 +02:00
WerWolv
3616c3ad7b fix: Move jthread include 2025-08-10 22:41:06 +02:00
WerWolv
23d673f920 fix: Multiple FreeBSD build and run errors 2025-08-10 22:38:12 +02:00
WerWolv
8c9f3fa569 impr: Slightly modernize hashes view 2025-08-10 20:05:07 +02:00
WerWolv
80003a4843 impr: Condense and modernize find view 2025-08-10 20:04:36 +02:00
WerWolv
12785c00bd impr: Condense and modernize data inspector view 2025-08-10 18:25:06 +02:00
Remik1r3n
8f94b46149 fix: Chinese translate error for Windows context menu setting (#2396)
### Problem description
In current Chinese translation, "Windows context menu entry" in General
settings has been tranlated to 窗口上下文菜单项. and for Traditional Chinese,
it's 視窗內容功能表項目 (basically the same).

The previous translations were not conveying the correct meaning
associated with the term "Windows context menu entry". They were too
literal and did not clearly describe the functionality related to the
Windows Explorer context menu.

"窗口" in Chinese means a physical window, **not the Microsoft Windows
OS**. The Windows OS is usually referred to as "微软视窗" (rare) or left as
"Windows".

"上下文菜单" is a very "direct" translation of "Context menu" that is hard to
understand for most users. Chinese user usually call it "右键菜单", which is
"Right-Click Menu".

### Implementation description
I've changed it to 添加到文件资源管理器右键菜单 for Simplified Chinese, and
加至檔案總管的環境選單 for Tranditional Chinese.
2025-08-10 14:27:15 +02:00
WerWolv
73a59fe5c1 impr: Modernize Tools view 2025-08-10 12:36:11 +02:00
WerWolv
5028b354cc impr: Clean up window setup code 2025-08-10 12:34:03 +02:00
WerWolv
3e98d0a0f8 fix: Updater crashing if APPIMAGE env var isn't defined 2025-08-10 09:41:52 +02:00
WerWolv
902c8dcd8d git: Retry snap installation a few times in case of network issues 2025-08-10 00:20:04 +02:00
WerWolv
66e407549e fix: Missing return value in update function 2025-08-09 23:49:59 +02:00
WerWolv
0870ab4d3c feat: Add option to check for updates to the Extras menu 2025-08-09 23:46:15 +02:00
WerWolv
6be0eeff72 impr: Allow more release types to be updated 2025-08-09 23:31:07 +02:00
WerWolv
9246d040ad fix: Remove another unused lambda capture 2025-08-09 22:40:10 +02:00
WerWolv
549866bfd9 fix: Remove unused lambda capture 2025-08-09 22:09:26 +02:00
Goomii
d81f0668a1 feat: Improved usability of the TCP Client/Server tool (#2175)
### Problem description
Messages in the TCP tool were only visible as a text string in the
messages list and unable to be opened in the hex view.
There was also no way to send data other than as a typed in text string
in the input field.

### Implementation description
* Added the ability to double-click on a message in the messages list to
open it in a provider tab.
* Added a new button to the client tab to send the current provider to
the connected server.
* Updated the list look to show the message index in a column

### Screenshots



https://github.com/user-attachments/assets/198d78c7-7c94-4f48-ac8c-3581e2ac12e4

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2025-08-09 22:07:58 +02:00
kur$
6b4fef806c fix: Added protection against deleting symlinks (#2288)
This PR improves the safety and reliability of the deleteOldFiles()
function by:

Preventing symlink attacks

Uses std::filesystem::canonical() to resolve all paths, eliminating ./..
and symlinks
Verifies each file is actually inside the target directory before
deletion
Safer file operations
Explicitly skips non-regular files (directories/symlinks)

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2025-08-09 19:58:36 +02:00
WerWolv
4e5b2675a0 fix: Remove unused if 2025-08-09 19:53:32 +02:00
WerWolv
f3d9f224b7 fix: Fixes for previous PR merge 2025-08-09 19:53:22 +02:00
Zephyr Lykos
ae8a12fa27 impr: Show external frames when using std::stacktrace backend (#2302)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
`std::stacktrace` backend in `hex::trace` does not show frames for
external libraries.

### Implementation description
If `dlfcn.h` is available, use `dladdr` to retrieve external symbol
information.

### Screenshots
Before:
```
[02:33:46] [FATAL] [main | Main]               Printing stacktrace using implementation 'std::stacktrace'
[02:33:46] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/lib/trace/source/stacktrace.cpp:34) | hex::trace::getStackTrace()
[02:33:46] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/crash_handlers.cpp:75) | printStackTrace
[02:33:46] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/crash_handlers.cpp:125) | hex::crash::handleCrash(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[02:33:46] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/crash_handlers.cpp:211) | operator()
[02:33:46] [FATAL] [main | Main]                 () | ??
[02:33:46] [FATAL] [main | Main]                 () | ??
[02:33:46] [FATAL] [main | Main]                 () | ??
[02:33:46] [FATAL] [main | Main]                 () | ??
[02:33:46] [FATAL] [main | Main]                 () | ??
[02:33:46] [FATAL] [main | Main]                 () | ??
[02:33:46] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/lib/third_party/imgui/backend/source/imgui_impl_glfw.cpp:844) | ImGui_ImplGlfw_UpdateMouseData
[02:33:46] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/window/window.cpp:353) | hex::Window::frameBegin()
[02:33:46] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/window/window.cpp:241) | hex::Window::fullFrame()
[02:33:46] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/window/window.cpp:297) | hex::Window::loop()
[02:33:46] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/init/run/native.cpp:43) | hex::init::runImHex()
[02:33:46] [FATAL] [main | Main]                 () | ??
[02:33:46] [FATAL] [main | Main]                 () | ??
[02:33:47] [FATAL] [main | Main]                 () | ??
[02:33:47] [FATAL] [main | Main]                 () | ??
```

After:
```
[02:30:19] [FATAL] [main | Main]               Printing stacktrace using implementation 'std::stacktrace'
[02:30:19] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/lib/trace/source/stacktrace.cpp:41) | hex::trace::getStackTrace()
[02:30:19] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/crash_handlers.cpp:75) | printStackTrace
[02:30:19] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/crash_handlers.cpp:125) | hex::crash::handleCrash(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[02:30:19] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/crash_handlers.cpp:211) | operator()
[02:30:19] [FATAL] [main | Main]                 (/lib64/libc.so.6) | libc.so.6+0x00019bef
[02:30:19] [FATAL] [main | Main]                 (/lib64/libc.so.6) | libc.so.6+0x00073c2c
[02:30:19] [FATAL] [main | Main]                 (/lib64/libc.so.6) | gsignal+0x1d
[02:30:19] [FATAL] [main | Main]                 (/lib64/libc.so.6) | abort+0x25
[02:30:19] [FATAL] [main | Main]                 (/lib64/libc.so.6) | libc.so.6+0x00001638
[02:30:19] [FATAL] [main | Main]                 (/lib64/libglfw.so.3) | libglfw.so.3+0x00002275
[02:30:19] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/lib/third_party/imgui/backend/source/imgui_impl_glfw.cpp:844) | ImGui_ImplGlfw_UpdateMouseData
[02:30:19] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/window/window.cpp:353) | hex::Window::frameBegin()
[02:30:19] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/window/window.cpp:241) | hex::Window::fullFrame()
[02:30:19] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/window/window.cpp:297) | hex::Window::loop()
[02:30:19] [FATAL] [main | Main]                 (/home/mochaa/ghq/github.com/WerWolv/ImHex/main/gui/source/init/run/native.cpp:43) | hex::init::runImHex()
[02:30:19] [FATAL] [main | Main]                 (/lib64/libc.so.6) | libc.so.6+0x000035b4
[02:30:19] [FATAL] [main | Main]                 (/lib64/libc.so.6) | __libc_start_main+0x87
[02:30:19] [FATAL] [main | Main]                 (./build/imhex) | imhex+0x0000cd94
[02:30:19] [FATAL] [main | Main]                 (??) | +0xffffffffffffffff
```

### Additional things
None
2025-08-09 19:46:01 +02:00
Artem Garmash
de7d549fc6 feat: Added skipping sequences of repeating bytes (#2228)
This PR implements a neat little feature I missed - the ability to jump
to the next/previous differing byte, skipping the chunk of repeating
bytes. Very useful when you analyze a raw flash dump and want to skip
the large sections of `0x00`s/`0xFF`s.

Some implementation details worth validating:
- I wasn't sure what is the correct place to put the new menu entries
into. The possible candidates were `File -> Go to address...` and `Edit
-> Follow selection`. I chose the former, although the latter may be a
better fit since it already states that the action is related to the
selection. Overall, it may be a good moment to refine these menu entries
in general.
- I didn't add any tests since I'm not sure what is the project's policy
for those. Please let me know if I need to add some!
- I added the machine-generated translations for the new menu entries
which may be considered a questionable thing. Please let me know if
you're unhappy with those, I'll drop the commit.
 
Also, thanks for such a nice tool, I use it a lot and was glad to build
a new feature for it!
2025-08-09 19:40:04 +02:00
WerWolv
d925c8216d impr: Allow ImHex to be used without subpixel rendering on Windows if only OpenGL 3 is available 2025-08-09 19:13:45 +02:00
WerWolv
e6f46747b6 fix: Add missing Updates path to About screen 2025-08-09 17:59:01 +02:00
WerWolv
c30830a8ff impr: Added Tabler Icons font 2025-08-09 17:55:39 +02:00
WerWolv
45b08b6010 impr: Enable some of the new ImGui configs 2025-08-09 16:22:07 +02:00
WerWolv
c88fc43032 fix: Crash on exit if update folder doesn't exist 2025-08-09 16:21:51 +02:00
Artem Garmash
08a08c2b3a impr: Better "File too large" banner wording (#2394)
Improve the wording of the localized string
2025-08-09 15:08:05 +02:00
WerWolv
411e971ba7 impr: Properly delete old update files 2025-08-09 14:28:48 +02:00
WerWolv
dbc5819bc4 fix: Handling of unchanged shortcut keys 2025-08-09 14:23:36 +02:00
Ivor Wanders
93a71120d4 fix: Initialise splash window with correct size (#2390)
With an initial Window size of 1 by 1, the program aborts during launch
on my Debian 12 (bookworm) system running the Mate Desktop environment
on X11.


The exception from X is the following:
```
$ ./imhex
[18:36:33] [INFO]  [main | Main]                Welcome to ImHex 1.38.0.WIP!
[18:36:33] [INFO]  [main | Main]                Compiled using commit master@59c6d30
[18:36:33] [INFO]  [main | Main]                Running on Linux 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) (x86_64)
[18:36:33] [INFO]  [main | Main]                Linux distribution: Debian GNU/Linux 12 (bookworm). Version: 12
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  18 (X_ChangeProperty)
  Resource id in failed request:  0x5400009
  Serial number of failed request:  152
  Current serial number in output stream:  163
```

The culprit is in `hex::init::WindowSplash::initGLFW()`, specifically
the `glfwCreateWindow` call with a window size of 1 by 1, that's the
last call in the ImHex codebase, after that it's libglfw and libX11.

The issue can be worked around by inhibiting the splash screen using the
`IMHEX_SKIP_SPLASH_SCREEN=1` environment variable, setting the window to
be a size larger than 1 by 1 also seems to resolve the situation.

My hunch is that an underflow occurs somewhere with the smaller values,
but I did no further investigation into analysing the root cause.

----
Above the line is the commit message.

### Problem description
See https://github.com/WerWolv/ImHex/issues/2215, which I think is the
same problem, and commit description above. Edit; I did another search
in the issues, I wouldn't be surprised if #2233 is a duplicate of the
2215 issue.

### Implementation description
Please see the commit message.

Analysis was done by setting an X11 error handler, making that throw and
running it in a debugger. This is available in this dev commit;
4a24e16a2ef100a9417e572f6b16c4a95711e94e.

### Screenshots
No apparent glitches if I make the splash window stick around with
`return std::nullopt;` in the `loop()` function. I don't know if there's
an issue at the beginning, but given that the window is set to
transparent before it is created and resized I don't expect any.

Here's a compulsory screenshot of the splash screen over an editor;

<img width="1247" height="666" alt="image"
src="https://github.com/user-attachments/assets/8ce05565-f207-4134-892d-9c074c4c840c"
/>


### Additional things
> Anything else you would like to say

Yes! I don't use ImHex often, but it's really useful when I do, thank
you!
2025-08-09 14:12:22 +02:00
WerWolv
d683c04519 fix: ID and layout issues with static array members in the pattern data view
Fixes #2393
2025-08-09 14:09:32 +02:00
WerWolv
a403980976 feat: Added update to Nighly/Stable release option 2025-08-09 12:25:22 +02:00
WerWolv
5c3dfa08b2 impr: Open correct release page in browser if updater fails 2025-08-09 12:15:40 +02:00
WerWolv
fd2d50508b fix: Update nightly update detection logic to work with release changes 2025-08-09 12:10:25 +02:00
paxcut
14ee688629 fix: fixes for issues #2388 and #2389. (#2392)
Tab insertion was not being recorded for undoing and the shift-backspace
shortcut did not exist. This PR addresses both issues directly.
2025-08-09 03:03:08 -07:00
WerWolv
9e4557d90d git: Rename snap artifacts to match the naming of all other artifacts 2025-08-09 11:31:11 +02:00
WerWolv
d9810982ad git: Don't pull all submodules 2025-08-09 11:10:46 +02:00
WerWolv
282d950423 git: Move into correct folder to do git operations 2025-08-09 11:01:15 +02:00
WerWolv
cd5b16cce5 fix: Another missing include 2025-08-09 10:34:09 +02:00
WerWolv
cc1ac95af6 fix: Missing include 2025-08-09 10:23:35 +02:00
WerWolv
b14fa24836 git: Don't always create a new release for every nightly 2025-08-09 10:22:22 +02:00
WerWolv
59c6d3090b fix: Clang doesn't support std::chrono::parse() yet 2025-08-08 23:32:07 +02:00
WerWolv
1e809214b2 git: Updated readme 2025-08-08 23:07:10 +02:00
WerWolv
56ec07e316 build: Improve LTO and PCHs 2025-08-08 22:56:50 +02:00
WerWolv
ce66f3a98a build: Fix remaining missing includes 2025-08-08 22:56:21 +02:00
WerWolv
5d180bdbfb build: Fix multiple missing includes 2025-08-08 22:48:31 +02:00
WerWolv
d922dbe04c impr: Make Bold and Italic button icons configurable though localizations 2025-08-08 22:46:47 +02:00
WerWolv
1fc6ec28c2 impr: Added search icon to the search bar button 2025-08-08 22:37:51 +02:00
WerWolv
ec6ff1d7d5 impr: More consistent look for the bookmark view 2025-08-08 22:36:58 +02:00
WerWolv
ad87f005fe feat: Added command line palette option to open/focus views 2025-08-08 22:36:46 +02:00
paxcut
df1e97af0a improv: further reformatting of text editor in an effort to bring it into the ui plugin. (#2385)
Added the ui namespace and broke the main rendering function into a set
of smaller functions. Reorganized the header code separating functions
into rough groups that eventually will be in separate files.
2025-08-08 12:47:52 -07:00
WerWolv
82ceb2e11f impr: Better auto updater, added support for updating nightlies 2025-08-08 21:25:52 +02:00
WerWolv
9698232f69 git: Fix nightly release notes generation 2025-08-08 19:09:41 +02:00
WerWolv
b1867aac92 build: Fixed precompiled header build 2025-08-08 17:47:48 +02:00
WerWolv
09bc5b92f6 impr: Make font bold icon look more bold 2025-08-08 17:47:24 +02:00
WerWolv
725462b222 fix: Diffing task not being properly cancelable
Fixes #2383
2025-08-08 17:47:15 +02:00
WerWolv
a9faba5cec git: Properly set version variable in nightly release CI 2025-08-08 17:46:11 +02:00
WerWolv
5a318da8ca git: Fix nightly release action file paths 2025-08-07 23:53:12 +02:00
WerWolv
5bc8366749 git: Checkout repo properly in nightly release CI 2025-08-07 23:46:54 +02:00
WerWolv
6200036014 git: Don't fail if artifacts.tar doesn't exist 2025-08-07 23:43:28 +02:00
WerWolv
38b891bd62 git: Added nightly release CI 2025-08-07 23:40:15 +02:00
WerWolv
a22c606e42 impr: Swap byte distribution graph X and Y axis, remove mouse text 2025-08-07 21:48:37 +02:00
WerWolv
dc0473e48d impr: Replace mentions of "Providers" with "Data Sources" for clarity 2025-08-07 21:30:16 +02:00
WerWolv
71f5373ea8 impr: Added recent entry tooltips 2025-08-07 21:29:58 +02:00
WerWolv
bd4ce72800 impr: Replace store buttons with icon buttons 2025-08-07 17:09:29 +02:00
WerWolv
d39d33de32 fix: Inconsistent look of welcome screen hyperlinks 2025-08-07 17:09:07 +02:00
WerWolv
7c07f70afd fix: AlmaLinux doesn't seem to support fmt::println yet 2025-08-07 17:08:38 +02:00
WerWolv
de67d5942b fix: Broken formatting in unit tests 2025-08-07 08:26:35 +02:00
WerWolv
f358069cc1 feat: Allow plugins to add their own welcome screen quick settings, improve UI 2025-08-06 22:51:59 +02:00
aoqia194
cf87294a8c feat: Add EventViewClosed event (#2377)
Where one door opens, another one closes (said someone) and in this
situation i mean view, because there's no event for closing a view only
opening one, so please add this :c

### Problem description
Simply adds an **EventViewClosed** to match the pre-existing
**EventViewOpened**. Also fixes the issue where EventViewOpened wouldn't
trigger for windows that were popups (even if they are technically a
View.

### Implementation description
I mirrored the current functionality of EventViewOpened for closing.

---------

Co-authored-by: paxcut <53811119+paxcut@users.noreply.github.com>
2025-08-06 22:22:46 +02:00
WerWolv
40b48f6460 fix: Use proper format specifiers for SetItemTooltip 2025-08-06 22:21:02 +02:00
WerWolv
31322bcc76 fix: Unavailable menu items still being visible in the command palette 2025-08-06 22:20:31 +02:00
WerWolv
abe13d9ff9 impr: Make reset button of color settings widgets look nicer 2025-08-06 22:20:03 +02:00
WerWolv
064b21a264 impr: Added icons to providers, improved the quick settings 2025-08-06 21:37:57 +02:00
WerWolv
5be6297bac fix: Few more build issues 2025-08-06 20:49:23 +02:00
WerWolv
dda32ef0f9 fix: Build issues due to bad log calls 2025-08-06 20:09:27 +02:00
WerWolv
9cff9043ee impr: Remove hex::format, improve format and logging type safety 2025-08-06 20:02:23 +02:00
paxcut
d429424f67 improv: refactor text editor to follow imhex style. (#2382)
Also fixes two bugs:
1) error messages not staying visible
2) uncaught exception when struct name is duplicated.

A lot of the code using coordinates for start and end has been moved to
use Selections instead. Created more string manipulation code that uses
utf8 indices aka Coordinates directly. This makes implementing editing
functions easier by not having to go back and forth from string indices
to char indices and back. Currently, the substring, erase and []
operator support coordinates and str indices.
2025-08-06 01:01:07 -07:00
WerWolv
750f91dbbc fix: Builtin plugin detection on Web build 2025-08-06 00:12:37 +02:00
WerWolv
c0ee243d64 fix: Various build issues 2025-08-06 00:03:18 +02:00
WerWolv
e05825b9f4 feat: Added extended/unprintable ASCII character display toggle to hex editor 2025-08-05 23:33:02 +02:00
WerWolv
018c61890c impr: Use icon buttons for bold and italic font settings 2025-08-05 23:32:44 +02:00
WerWolv
263c5f6830 impr: Added icons to all tools 2025-08-05 23:32:27 +02:00
WerWolv
a27b10f69a impr: Draw settings tooltips under the setting value 2025-08-05 22:20:06 +02:00
WerWolv
3cf7622707 impr: Make font size a multiplicative value 2025-08-05 22:19:43 +02:00
WerWolv
327195573e fix: Non-Unix build errors 2025-08-05 22:19:19 +02:00
WerWolv
baebfe96ba impr: Make banners easier to read 2025-08-05 22:19:04 +02:00
WerWolv
5b06702dee feat: Allow plugins to be dynamically turned on and off 2025-08-05 22:16:39 +02:00
WerWolv
95465e2fc3 fix: Tree expand working differently for favorites and static arrays in the pattern data view 2025-08-05 17:57:59 +02:00
WerWolv
388f5354a1 fix: ImHex being displayed as "Main" in some task managers on Linux 2025-08-05 17:57:26 +02:00
WerWolv
c3cd4edbf9 impr: Various small ssh provider improvements 2025-08-05 17:56:10 +02:00
paxcut
b9c36cfd2f feat: added paren and quote autocompletion. (#2381)
Also fixed  tab insertion on selections.
2025-08-04 17:28:38 -07:00
paxcut
b3deeb29b3 fix: typing t< on pattern editor spams the log infinitely (#2379)
The error was caused when the search for the closing delimiter extended
past the last token in the sequence, which happened because the initial
increments before the loop starts were not being accounted for in the
loop ending condition. This was fixed by decrementing the limit of
possible steps to account for the initial steps taken.
2025-08-04 04:59:33 -07:00
paxcut
136cabedb4 fix: Menu items greyed out when they shouldn't (#2378)
Problem was that a recent commit allowed any subview window to become
the current subview with focus which also included the context menu
popup. The fix is to list all the subviews that can acquire focus so
that they are the only ones that will be detected by the menu condition.
2025-08-04 03:23:24 -07:00
WerWolv
9fc9eb1425 fix: EventViewOpened only getting called for undocked windows 2025-08-03 17:57:46 +02:00
WerWolv
71a39ff2fd build: Remove legacy GL emulation in web build 2025-08-03 17:56:01 +02:00
WerWolv
3d01b78ba0 build: Allow building and running on 32 bit Windows 2025-08-03 17:55:32 +02:00
WerWolv
452e7d7c5f fix: Gist save editors not working correctly in web version 2025-08-03 14:27:57 +02:00
WerWolv
1a8e09d549 patterns: Updated pattern language 2025-08-03 13:47:19 +02:00
WerWolv
ea072296cf feat: Added save editor mode 2025-08-03 13:47:19 +02:00
paxcut
56d1e2670e fix: segment numbers are still being cutoff. (#2370)
I noticed that an earlier fix was missing parenthesis, so I checked a
file of a big size and used a segment size of 1 and only 3 digits were
being displayed in spite of needing 6.
2025-08-02 23:44:35 -07:00
paxcut
bc953592f0 fix: console selects word on click. (#2372)
The problem was that the console was calling select word under cursor
when no selection was done. Fixed by removing the call.
2025-08-02 23:42:23 -07:00
paxcut
b2f188fa4b fix: shortcuts is subviews of pattern editor are duplicated in the main text editor. (#2371)
The error occurred because only one of two subviews (the text editor or
the console) were allowed to report having focus. By extending this
functionality to all subviews, each one can use its own set of shortcuts
thus fixing the problem.
2025-08-02 19:48:48 -07:00
WerWolv
7575f85bdf fix: Crash when selecting regex replacer tool output 2025-08-03 00:09:01 +02:00
WerWolv
685a2e3cf2 fix: Crash when selecting UNIX permission tool output 2025-08-03 00:05:40 +02:00
WerWolv
2db85ced59 fix: High background GPU usage on Windows if window is minimized 2025-08-02 23:35:47 +02:00
WerWolv
693a0f2516 impr: Better reset icon for shortcut settings 2025-08-02 23:07:40 +02:00
WerWolv
b81328ac1a fix: Web build not properly starting up anymore 2025-08-02 23:07:20 +02:00
WerWolv
2440acda07 impr: Small performance improvements 2025-08-02 17:30:58 +02:00
WerWolv
29354f0bcb fix: Hex Editor segment numbers being cut off 2025-08-02 17:30:49 +02:00
paxcut
a9eb7b2d25 fix: fixed auto save projects not being done after the first one. (#2366)
Currently setting the time interval to auto save the project has no
effect other than creating one initial save if the input file is
unsaved. When a file is created and not saved it remains in a dirty
state which prevented setting the state of the autosaved project to
needing to be saved. Fixed by decoupling the state of the provider from
the state of the autosave. When a provider is detected as being dirty it
always makes the autosave as being needed once the time interval has
elapsed.

feat: Implemented the menus on the main menu bar that will be available
when the text editor has focus. It allows you to load and save patterns
using open and save and will tack changes if files on disk are modified
externally. It also only opens the file chooser the first time you save
a pattern file and subsequent changes save to the same file.

If you want to save into another file and have the new file be tracked
you can use Save As. Finally, export doesn't track the file on disk at
all. this feature uses the same changes tracker class used elsewhere in
imHex.

fix: Changed the defaults of various shortcuts that were using Alt + a
key to avoid possible problems with some keyboards. Shouldn't affect end
users as their shortcuts are loaded from internal file but those who
complain about the Alt key misbehaving will be asked to reset the keys
to the new defaults. In addition, all globally accessible shortcuts were
added the Allow while typing flag so that they can be used in any field
that accepts text.

New menu entries were added for debugging to make the pattern editor and
the hex editor menus more like each other.

Finally, the call to RegisterMainMenuEntries() when initializing views
was moved to occur after the call to registerViews() so that menus are
not repeated when set for different views.
2025-08-02 01:29:34 -07:00
WerWolv
05a06fe7a3 build: Allow LTO to work again 2025-08-02 01:14:09 +02:00
WerWolv
f73866b86e impr: Speed up initial resource loading and event handling slightly 2025-08-02 01:14:00 +02:00
WerWolv
1e18abc598 patterns: Updated pattern language 2025-08-01 01:08:13 +02:00
WerWolv
a2c4aefced fix: Crashes when font failed to be loaded 2025-07-31 23:13:50 +02:00
WerWolv
bb6ea5f1e5 fix: User folder settings icon buttons being too small 2025-07-31 21:05:32 +02:00
WerWolv
0e855e10db fix: Slightly adjust icon positions again 2025-07-31 20:54:56 +02:00
WerWolv
1594c712a8 fix: Settings onChange handlers not being called correctly 2025-07-31 20:38:23 +02:00
WerWolv
7b6d5d2686 impr: Cleanup splash screen, make hex highlights look nicer 2025-07-31 20:33:55 +02:00
WerWolv
44f12587f3 impr: Cleanup and simplify subpixel rendering patches 2025-07-31 20:33:21 +02:00
WerWolv
fd8bdbdc90 fix: Icons being too big for regular text 2025-07-31 20:32:59 +02:00
WerWolv
9557041c3a fix: Open file in explorer not working on Windows 2025-07-31 00:24:54 +02:00
WerWolv
1804caba02 feat: Added first/last element button to the data inspector 2025-07-30 23:52:40 +02:00
WerWolv
c1f0d60f49 impr: Declutter pattern editor and data processor footer 2025-07-30 23:17:44 +02:00
WerWolv
83d92dde35 build: Update VSCode Icons font 2025-07-30 23:17:13 +02:00
WerWolv
ac98e4e0b5 fix: Use after free when checking for frame render condition 2025-07-30 22:33:59 +02:00
WerWolv
5c99974202 impr: Only show fonts in the font picker that can actually be used 2025-07-30 22:33:32 +02:00
WerWolv
280dea23d0 fix: Font point calculation not respecting framebuffer scale 2025-07-30 22:33:16 +02:00
WerWolv
6fcc3e8cb3 build: Move all demangler uses into the trace library 2025-07-30 20:57:53 +02:00
WerWolv
ec9461741c feat: Added goto command palette command 2025-07-30 20:21:26 +02:00
WerWolv
896e05331c feat: Preload fonts to display them in the font picker 2025-07-30 17:44:12 +02:00
WerWolv
4c930b190e fix: Last character of font names being missing on Windows 2025-07-30 17:43:45 +02:00
WerWolv
6ab3353a15 fix: Font memory leak 2025-07-30 17:43:28 +02:00
WerWolv
a31760eecb patterns: Updated pattern language 2025-07-30 17:43:08 +02:00
WerWolv
4c89a79dc3 feat: Added full-screen views for use with subcommands in the future 2025-07-30 17:42:56 +02:00
WerWolv
2c3d8d4c0b fix: CppCheck issues 2025-07-30 17:41:45 +02:00
WerWolv
e71e026da0 patterns: Updated pattern language 2025-07-29 21:32:16 +02:00
WerWolv
f239b0c6d7 fix: Incorrect progress bar on splash screen 2025-07-28 18:02:33 +02:00
WerWolv
8a7f232198 fix: Properly set default font for ImGui to use 2025-07-28 18:02:33 +02:00
WerWolv
a3c71b3955 fix: Settings onChange handlers running more than once in some cases 2025-07-28 18:02:33 +02:00
WerWolv
46b13b6606 impr: Nicer font registering API 2025-07-28 18:02:33 +02:00
WerWolv
a40c420b70 patterns: Updated pattern language 2025-07-28 00:23:50 +02:00
WerWolv
8470334d6d fix: Reduce CPU usage when FPS is unlocked 2025-07-28 00:23:01 +02:00
WerWolv
f42ae97f14 impr: Added more generic way to unlock frame rate when needed 2025-07-27 16:25:10 +02:00
WerWolv
c7b2f26bd5 impr: Make main menu items look a bit nicer 2025-07-27 15:39:38 +02:00
WerWolv
ec424ac16e fix: Assert when plugins failed to load 2025-07-27 15:11:01 +02:00
WerWolv
72501edc9a fix: GTK assertions when running AppImage on some distros 2025-07-27 15:10:48 +02:00
bb010g
9554889964 build: Move back to upstream edlib (#2357)
### Problem description
The current edlib submodule references a commit that's not present in
<https://github.com/blawrence-ont/edlib>. This throws off submodule
initialization and makes building an ImHex Flatpak using upstream Git
HEAD require some nasty Git bodges.

### Implementation description
Switching to <https://github.com/Martinsos/edlib> in `.gitmodules` is
all that is necessary, since
<0ddc23ea06>
properly exists.

### Screenshots
_This section was intentionally left blank._

### Additional things
For those curious, I'm currently working around this by manually
appending
```gitconfig
[url "https://github.com/Martinsos/edlib"]
	insteadOf = "https://github.com/blawrence-ont/edlib"
```
to
`${flatpak_builder_state}/git/https_github.com_blawrence-ont_edlib/config`
after `flatpak-builder` has cloned the repository and failed. I know
this is a brittle solution.
2025-07-27 09:35:54 +02:00
paxcut
7ff1e72093 fix: find next and find previous not working on console. (#2358)
With only one menu entry and having set it to use the text editor then
the console losses that functionality. Since both the console and the
text editor are on the same view, it follows that they must share the
menu entries. In some cases it is necessary to determine which of the
two editors needs to be processed inside the menu entry itself.

Also an error that caused the creation of invalid coordinates when
console is still empty was fixed by setting coordinates to 0,0 for empty
files. Another problem was that left clicking on the console didn't
select the word under the cursor but it does when left clicking on the
text editor. Now it works in both.

The menu entries on the console were removed completely and swapped with
a call to obtain the default 'edit' menu for the context popup. Also,
the console in write-only, so some of the entries like `Paste` or
`Replace` must be greyed out.

This PR is only to fix the bugs that exist currently. More work is still
needed for:
1) Removing the remaining shortcuts and creating new menu entries for
them and
2) Adding support for `Open` and `Save` in the pattern editor with path
tracking.

I tested all combinations of menus and shorcuts with console and pattern
editor and there were no problems I could detect.
2025-07-26 21:41:43 -07:00
WerWolv
3d3674d405 fix: Find and replace pattern editor menu options being grayed out when they shouldn't be 2025-07-26 23:51:22 +02:00
WerWolv
d08152a824 impr: Cleanup splash screen, speed up ImHex launching even further 2025-07-26 23:48:03 +02:00
WerWolv
12087b51cb tests: Properly remove removed tests 2025-07-26 23:05:37 +02:00
WerWolv
66ec1de625 fix: Splash screen progress bar not updating properly 2025-07-26 23:03:34 +02:00
WerWolv
7f09d61eb8 tests: Remove tests for functions that no longer exist 2025-07-26 21:57:00 +02:00
WerWolv
f5c24cee67 build: Disable SVG fonts again until they work on Fedora 2025-07-26 21:50:43 +02:00
WerWolv
2abedbe4ad impr: Slightly increase gap between title bar buttons and menu items on macOS 2025-07-26 21:50:03 +02:00
WerWolv
80eb72c5f9 fix: Remove duplicate pattern editor shortcuts 2025-07-26 17:49:21 +02:00
WerWolv
88da6c10e0 fix: Another linux build error 2025-07-26 17:49:02 +02:00
WerWolv
49771766e7 fix: Replace one more splitString function 2025-07-26 17:16:57 +02:00
WerWolv
9b20092428 build: Updated libwolv 2025-07-26 16:49:42 +02:00
WerWolv
e3551b3045 fix: Properly distinguish view specific toolbar items in the settings 2025-07-26 16:03:40 +02:00
WerWolv
68d7e99a80 fix: Rename pattern editor menu options to not overlap in the toolbar items 2025-07-26 16:03:08 +02:00
WerWolv
a8d61ed534 impr: Remove (TrueType) from the end of all font names on windows 2025-07-26 16:00:25 +02:00
WerWolv
a67788ac52 feat: Added support for SVG glyphs in fonts 2025-07-26 15:59:56 +02:00
WerWolv
bc644e324a impr: Add extra suffixes for regular / bold / italic font variations 2025-07-26 14:30:30 +02:00
WerWolv
8782be593d feat: Added ability to draw Bold and Italic text 2025-07-26 14:22:50 +02:00
WerWolv
2998cc0fd7 impr: Cleanup font loading 2025-07-26 14:01:31 +02:00
WerWolv
e85216d9a6 impr: Remove duplicated string functions and use libwolv ones instead 2025-07-26 13:35:08 +02:00
WerWolv
e22923a980 build: Updated libwolv 2025-07-26 11:58:38 +02:00
WerWolv
be6a90675b fix: Some cell visualizer types not updating their values correctly 2025-07-26 11:58:30 +02:00
WerWolv
94527345b9 dist: Added scripts for pre-processing future icon fonts 2025-07-25 23:06:44 +02:00
WerWolv
c1545b57c9 impr: Cleanup font loading API, fix CJK glyphs being rendered way too large 2025-07-25 23:06:44 +02:00
paxcut
8f3d07ea69 fix: imported patterns used for inheritance were not highlighted. (#2356)
The problem was that imported files didn't have token sequences to
obtain the UDT variables. The fix was to create maps from the file name
to the token sequence and then process each imported file to obtain all
the variables needed. Function variables are skipped since they can be
part of the code.
There are also some minor code style corrections and a fix in the text
editor where the last line of a selection was not being deleted.
2025-07-25 12:16:02 -07:00
WerWolv
68804a357d git: Make sure Web build doesn't fail in forks 2025-07-25 19:49:28 +02:00
Jonathan Wright
78a449d6d3 git: Fix rpm ccache (#2355)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->

### Implementation description
<!-- Explain what you did to correct the problem -->

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->

Co-authored-by: Nik <werwolv98@gmail.com>
2025-07-25 18:20:43 +02:00
WerWolv
366c631e26 build: Remove json diagnostics again 2025-07-25 17:13:55 +02:00
WerWolv
da8be3ec3c fix: Scrolling and ID collision in simplified pattern value editor 2025-07-25 14:44:24 +02:00
WerWolv
820b833bbc fix: Window close event handlers not getting called correctly 2025-07-25 10:52:11 +02:00
WerWolv
574c039cc8 fix: Add missing language key, make sure simple pattern value editor sorting is stable 2025-07-24 23:42:02 +02:00
WerWolv
e0180b718f feat: Added simplified pattern value editor 2025-07-24 23:29:13 +02:00
WerWolv
ca82fafac5 build: Add more debug information to nlohmann::json error messages 2025-07-24 21:38:10 +02:00
WerWolv
a9ce71c481 impr: Make close button on macOS close providers if any are open instead of closing ImHex 2025-07-24 21:37:49 +02:00
Nik
2e200a2ab8 git: Properly verify that plugins built from the plugin template can be loaded by ImHex (#2352) 2025-07-24 20:35:02 +02:00
WerWolv
0e720a1e02 fix: Hex editor insert mode inserting or removing too many bytes 2025-07-24 19:28:46 +02:00
WerWolv
601b13cf42 fix: Crash when opening selection view 2025-07-24 18:32:30 +02:00
WerWolv
f6860015eb fix: Rendering of insert cursor in hex editor 2025-07-24 18:13:02 +02:00
WerWolv
99a9752ee9 fix: bfloat16 language key 2025-07-24 14:39:42 +02:00
WerWolv
518ada6dae git: Remove ccache show stats again from rpm runner 2025-07-24 14:39:26 +02:00
WerWolv
3c1c9c13d8 git: Undo rpm changes 2025-07-24 13:23:09 +02:00
WerWolv
baa4e82b92 git: Don't install ccache separately 2025-07-24 13:16:22 +02:00
WerWolv
116f5a57eb git: More ccache fixes 2025-07-24 13:08:21 +02:00
WerWolv
4c8c383378 git: More ccache fixes for Snap and RPM 2025-07-24 12:35:16 +02:00
WerWolv
e5e867db22 build: Make sure ARM64 AppImages get the right libraries bundled
#2350
2025-07-24 12:13:30 +02:00
WerWolv
2b72d08e39 build: Fix and re-enable Web build 2025-07-24 10:52:08 +02:00
WerWolv
32adb99f3d git: Fix snap uploading 2025-07-24 02:43:23 +02:00
WerWolv
799175c94e git: Call snapcraft directly 2025-07-24 00:57:32 +02:00
WerWolv
e79116499e git: Build snaps in destructive mode 2025-07-24 00:47:50 +02:00
WerWolv
e1a91d179a git: Enable ccache for snap builds 2025-07-24 00:33:42 +02:00
WerWolv
e0910cd2f4 git: Let the RPM builds use the ccache plugin again 2025-07-24 00:21:16 +02:00
Jonathan Wright
295c751b60 git: Sync RPM CIs with Fedora's repos (#2349)
Gets RPM builds back in sync with Fedora/EPEL and changes to mock
instead of fedpkg (slight efficiency improvement since fedpkg is a
wrapper around mock).

---------

Co-authored-by: WerWolv <werwolv98@gmail.com>
2025-07-23 21:49:14 +00:00
WerWolv
851f7b4b8c build: Update metainfo file 2025-07-23 22:54:40 +02:00
WerWolv
9b3a157b41 fix: Workspaces not being reloaded correctly 2025-07-23 20:27:13 +02:00
WerWolv
8f2638be30 fix: Wrong menu items getting triggered when same shortcut is defined in multiple views 2025-07-23 20:06:53 +02:00
WerWolv
0634b41092 build: Add cmake flag for enabling hardening flags 2025-07-23 15:24:09 +02:00
WerWolv
2ce5acb8d3 git: Disable DNF caching to prevent the cache from filling up too quickly 2025-07-23 14:55:32 +02:00
WerWolv
48980a1e0c build: Always set CMAKE_MSVC_DEBUG_INFORMATION_FORMAT 2025-07-23 14:12:26 +02:00
WerWolv
b68d0704e7 git: Downgrade docker cache action again 2025-07-23 00:53:28 +02:00
WerWolv
af7eaae399 git: Allow for better ccaching caching in more runners 2025-07-23 00:03:22 +02:00
WerWolv
a3eb057215 build: Allow ccache to properly cache msvc builds 2025-07-22 23:47:24 +02:00
WerWolv
59695dcad6 fix: Content store still displaying updates after updating 2025-07-22 23:03:31 +02:00
WerWolv
aa6e461340 feat: Added support for view-specific menu items and main menus 2025-07-22 22:32:45 +02:00
WerWolv
737d71ee13 git: Don't upload flatpak build twice 2025-07-22 18:40:54 +02:00
WerWolv
2b7fe26bf1 git: Pre-install freedesktop runtime in flatpak CI 2025-07-22 18:15:39 +02:00
WerWolv
8593bf5f55 git: Add flathub repository to flatpak CI 2025-07-22 18:07:24 +02:00
WerWolv
7bfc3f44c9 git: Added Flatpak CI 2025-07-22 18:02:35 +02:00
WerWolv
b9f79833b6 git: Added snap release CI 2025-07-22 16:19:44 +02:00
Nik
9bed8f792a build: Added snap package (#2348) 2025-07-22 15:19:21 +02:00
paxcut
e18d583a00 feat: Added experimental external editor support. (#2347)
Users can now synchronize the content of the pattern editor with a file
on disk when exporting a pattern. Any modifications made in the pattern
editor are automatically saved to the file and when the pattern editor
gains focus it will automatically load any changes to the file on disk.
This feature is brand new and can have unforeseen problems so test it
fully before risking losing work.

Added major changes to how the text editor handles utf8 characters with
the added ability to obtain them using the [] operator and column
coordinates as indices. Sanitize coordinates was renamed to Set
Coordinates and can be used instead of the constructor to guarantee no
out of range asserts and/or exceptions. Improved move left and right
readability and cursor accuracy when clicking. Fixed single character
selection by double-clicking it. Deleted old and unused code and other
changes that I can't remember about atm.
2025-07-22 11:52:44 +02:00
WerWolv
244f7b55ee build: Update to fork of appimage-builder 2025-07-22 11:52:38 +02:00
WerWolv
ee6d72562b build: Explicitly set AppImage compression to zstd 2025-07-21 22:47:41 +02:00
WerWolv
90c2667028 fix: Detached window headers not getting scaled 2025-07-21 22:36:14 +02:00
WerWolv
9c6926a1fb build: Update AppImageBuilder and appimagetool 2025-07-21 22:25:36 +02:00
WerWolv
22c9d77909 fix: Don't draw the same pattern tooltip multiple times 2025-07-21 12:43:47 +02:00
WerWolv
55b3b3a188 impr: Display all patterns in hover tooltip when hovering over a larger hex editor cell 2025-07-21 11:19:49 +02:00
WerWolv
c93e5ba183 git: Put remote plugin under LGPLv2.1 to support the cases where libssh2 is using OpenSSL internally 2025-07-21 09:55:22 +02:00
paxcut
5df8ec78aa improv: removing tabs (#2345)
These changes are part of an effort aimed at removing tabs from ImHex
that started some time ago. Here text preprocessing is removed from all
the places were it was done before and moved to the places where files
are read that go in the pattern editor with two notable exceptions.
1) Pattern import reads patterns in order to present a list that can be
filtered.That can safely ignore preprocessing since only needs to get
information needed to filter.
2) The pattern editor can incorporate text from the clipboard so that
needs to be preprocessed as well.

find/replace is unable to add tabs or carriage returns so this should
cover all angles.
2025-07-20 13:10:45 -07:00
WerWolv
cc6590d780 fix: Remove unused variable 2025-07-20 11:36:34 +02:00
WerWolv
9ce18d1a42 feat: Added bfloat and fp24 data inspector entries 2025-07-20 11:11:51 +02:00
WerWolv
9ff8d42143 fix: Reordering of toolbar items not working correctly
Fixes #2343
2025-07-20 11:07:47 +02:00
WerWolv
1ff838daa7 git: DIsable stale issue CI for now 2025-07-20 10:23:25 +02:00
WerWolv
17ab429a8c fix: Intel Hex and Motorola SREC providers always being at least 1 byte long 2025-07-20 00:46:20 +02:00
WerWolv
5df50ef380 fix: Make Banner button more visible 2025-07-20 00:44:08 +02:00
WerWolv
8da007af6c impr: Make version info in about screen selectable
#2341
2025-07-20 00:40:33 +02:00
WerWolv
f053b94f68 impr: Replace reload provider icon with actual reload icon
#2343
2025-07-20 00:35:49 +02:00
WerWolv
d02ea09529 fix: Many issues and code style of the TTY console 2025-07-17 20:13:27 +02:00
WerWolv
79333593bf fix: Pattern Editor footer moving around when switching tabs 2025-07-17 20:13:09 +02:00
WerWolv
c635bca43d fix: Out of bounds array indexing in text editor 2025-07-17 20:12:55 +02:00
WerWolv
de62a4c71e impr: Better icon centering in icon buttons 2025-07-17 20:12:38 +02:00
paxcut
24732b304b fix: more problems with bytes per row. (#2338)
The scrollbar, mini map and the segment delimiters were also using the
incorrect bytes per row value when changing data size forced a change in
the number of bytes per row. From the definition of the new value it
follows that bytesPerRow/bytesPercell == m_bytesPerRow/bytesPerCell, so
it is not necessary to switch it when it is divided by that quantity.
2025-07-16 13:23:14 -07:00
WerWolv
5744ad588f impr: Better icon sizes for process list 2025-07-16 10:33:24 +02:00
paxcut
5ea021d57a fix: fix for issue 2334 (#2337)
The error was that if `m_bytesPerRow` was not divisible by the number of
bytes per column then ImHex would crash but wouldn't crash if it was.
When `m_bytesPerRow` is not equal to the resultant bytes per row
obtained by the product of column count and bytes per column, then the
later bytes per row were be allocated but the former bytes per row were
being written causing heap corruption and crashes.

Instead of resetting `m_bytePerRow` when it can't be used, a new
variable (`bytesPerRow`) is created with the correct value and used in
the rest of the function. This way if the user goes back to choose a
data size that divides the old `m_bytesPerRow` then the number would
still be available and not overwritten. Test indicate that this approach
works and previous crashes are eliminated while producing the desired
output.
2025-07-15 23:55:52 -07:00
paxcut
38c5868029 feat: added matched bracket highlights + updating pattern language library (#2335)
Added clion-like bracket matching feature with shortcut to go to the
other one. Also improved some cumbersome repeated function call.
Added support for using negative indices in coordinates so -1 is the last 
line or column, -2 the previous, etc..
Pattern library has fixes for column errors being incorrectly set for lines
containing tabs that are not replaced by 4 spaces.
2025-07-15 18:47:33 -07:00
WerWolv
4725bf7271 build: Updated dependencies 2025-07-16 01:00:59 +02:00
WerWolv
de9efe6c4d fix: Cut off text display of toolbar items 2025-07-15 22:04:36 +02:00
WerWolv
88ce3a2490 fix: Default toolbar items not showing up in settings window 2025-07-15 22:04:19 +02:00
Nik
2c47e1a135 git: Added Windows ARM64 build (#2336)
Closes #1118
2025-07-15 20:28:54 +02:00
WerWolv
7454221b3b fix: Goto address not updating when switching between jump modes 2025-07-14 18:39:05 +02:00
C3pa
fcc4709ed9 fix: Multiple typos (#2333)
Fix a typo in `screenshot_descriptions.json` reported in #2330. While I
was presented with the contributing doc, I came across another typo
that's fixed in the second commit.
2025-07-14 17:01:52 +02:00
WerWolv
aeb77559a7 build: Properly link against OpenSSL and LibCrypto 2025-07-14 16:49:17 +02:00
WerWolv
9acaf33410 impr: Allow GDB Provider to work without NoAckMode, added run length encoding support 2025-07-14 16:25:25 +02:00
WerWolv
e13b679650 build: Fix unit tests not building anymore 2025-07-14 02:03:08 +02:00
WerWolv
4146047cdb build: Link against OpenSSL when needed 2025-07-14 01:57:13 +02:00
WerWolv
18e02fbf5c impr: Split up optional provider features into multiple abstract interfaces 2025-07-14 00:37:12 +02:00
WerWolv
b94519362c impr: Make gdb provider use cached provider 2025-07-14 00:06:17 +02:00
WerWolv
1e59a82c59 fix: More build issues 2025-07-13 20:07:46 +02:00
WerWolv
d570ab04b8 build: Updated macOS ARM compiler to Clang 20 2025-07-13 20:07:46 +02:00
WerWolv
830be0b0d3 build: Fix more build issues 2025-07-13 20:07:46 +02:00
WerWolv
1570f379df fix: macOS build issue 2025-07-13 20:07:46 +02:00
WerWolv
e7714df79f build: Add libssh2 to more dependency scripts 2025-07-13 20:07:46 +02:00
WerWolv
bdc108d021 feat: Added remote SSH file provider 2025-07-13 20:07:46 +02:00
WerWolv
a89fb542b0 fix: Window not being resizable anymore on Linux
Fixes #2328
2025-07-13 17:02:52 +02:00
WerWolv
26de4c11e1 impr: Move pattern sections from pattern editor view to pattern data view 2025-07-12 22:05:13 +02:00
WerWolv
01d0f03fdd fix: CTRL + A not selecting last line in the text editor 2025-07-12 21:46:09 +02:00
WerWolv
58d0d09eae fix: EventProviderOpened being called before the provider finished opening 2025-07-12 21:09:45 +02:00
paxcut
e7a2729d36 feat: semantic syntax highlights for pattern editor. (#2214)
allows the ability to assign colors to global placed and non-placed
variables, pattern, local and calculated pointer variables, template
arguments, function variables and arguments, etc etc etc. It
accomplishes this using the parser and the token sequence generated by
the lexer. It still uses the original colorizing code but the underlying
data holding the pattern has been updated to be easier to use and to
debug. The changes are too numerous to cite here.It is a big but
necessary step to bring the pattern editor to a somewhat useful state.
There may be one commit in the pattern language repo needed to be able
to run this code
2025-07-11 22:47:56 -07:00
WerWolv
5782236379 impr: Disable hinting for pixel perfect font 2025-07-11 15:04:21 +02:00
WerWolv
88de5f6be4 impr: Better font settings window 2025-07-11 14:55:25 +02:00
WerWolv
4520637aed fix: Pixel perfect font not scaling correctly 2025-07-11 14:54:54 +02:00
WerWolv
aa8235c279 fix: Italics not working with subpixel rendered fonts 2025-07-11 14:08:47 +02:00
WerWolv
2432462ff3 impr: Unlock frame rate for the first 5 seconds after startup 2025-07-11 13:37:15 +02:00
WerWolv
8c59684c14 impr: Much more accurate frame rate limiting
Many thanks to @ws909 in https://github.com/glfw/glfw/issues/2737
2025-07-11 13:29:56 +02:00
WerWolv
82c318f91d fix: Crash when no plugins could be loaded 2025-07-10 16:36:37 +02:00
WerWolv
3c16adf169 fix: Don't update welcome screen textures if dpi didn't change 2025-07-10 16:13:48 +02:00
WerWolv
2ab54baa2c fix: DPI scaling 2025-07-10 14:39:52 +02:00
WerWolv
da2aa85a8a build: Fix cppcheck issues 2025-07-10 13:57:08 +02:00
WerWolv
e58ce527c6 build: Add support for cppcheck to cmake 2025-07-10 13:55:05 +02:00
Nik
d1840a2184 build: Update ImGui to v1.92.1 (#2325)
Update ImGui to the latest version and rewrite most of the font handling
code
2025-07-10 10:00:39 +02:00
WerWolv
fa62a675dc patterns: Update pattern language 2025-07-10 10:00:19 +02:00
paxcut
1aa52c634f patterns: Updated pattern language (#2323) 2025-07-08 18:35:27 -07:00
WerWolv
cfc364e4f1 fix: Commands that setup init events not working anymore 2025-07-07 11:16:29 +02:00
WerWolv
f2b6af8bdc fix: Duplicate ImGui IDs in data information view 2025-07-07 11:15:46 +02:00
WerWolv
c71411a527 fix: UDP Providers not being marked as dirty when data is received 2025-07-07 00:00:49 +02:00
WerWolv
42256a5c2f fix: Potential hang when closing UDP Servers after a client connected 2025-07-07 00:00:49 +02:00
paxcut
f589d898ac patterns: Updated pattern language (#2320)
This pr updates the pattern language library to include two fixes. 
The first fix deal with local variables that are children of a
structure, a union, a bitfield or an array losing their offsets when the
parent's `setOffset()` is called.
The second fix is that local variables of unions were being used as size
contributors of the patterns place with said unions.
Further details may be found in the pattern language pull requests for
the files listed as changed in the PL submodule in this pr.
2025-07-05 10:47:12 -07:00
WerWolv
af70234519 fix: Build issue due to imgui test engine test 2025-06-29 17:42:13 +02:00
WerWolv
df58afe1a1 fix: Build issue when imgui test engine is disabled 2025-06-29 13:22:37 +02:00
WerWolv
6c8d87520c build: Remove address sanitizer command line args 2025-06-29 10:01:02 +02:00
WerWolv
9d0ea9f6c0 build: Don't enable test engine in builds 2025-06-28 22:59:16 +02:00
WerWolv
053f7655c3 fix: Crashes on exit due to font deletion
#2287
2025-06-28 22:58:55 +02:00
WerWolv
288f8ee42f fix: Crash on Wayland when glfwTerminate() gets called more than once 2025-06-28 13:48:48 +02:00
WerWolv
2a8dd0873b build: Revert wasm libmagic patches 2025-06-28 13:47:42 +02:00
WerWolv
bd8b3f8a29 git: Disable ImHex Web build until vcpkg fixes libmagic 2025-06-28 13:46:58 +02:00
WerWolv
57c89b4481 patterns: Updated pattern language 2025-06-25 20:39:11 +02:00
WerWolv
a4ced46628 fix: Missing include 2025-06-25 20:39:03 +02:00
WerWolv
0d2ea2f8c0 build: Fixed tracing library type when statically linking everything 2025-06-25 20:37:47 +02:00
WerWolv
4245cd2ad9 build: Fixed WebAssembly build issues 2025-06-25 20:37:10 +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
Shadow775711
df3b85765d Polish translation (#2295)
Feature description

This pull request introduces full Polish language support to ImHex.
It is a new feature that allows users to switch the UI to Polish,
improving accessibility for Polish-speaking users.

Implementation description

-Translated a total of 10 JSON language files into Polish (pl_PL.json)

-All translations were done manually, with the help of tools such as
DeepL, large language models (LLMs), and technical dictionaries

-Validated the JSON files using [jsonlint.com](https://jsonlint.com/)

-Performed initial UI testing — all translated strings appear and render
correctly

Screenshots

Below is an example of the UI in Polish:
![Zrzut ekranu z 2025-06-05
21-31-55](https://github.com/user-attachments/assets/762ab695-0851-4183-80c5-f52d4e02ac18)

![Zrzut ekranu z 2025-06-05
21-34-47](https://github.com/user-attachments/assets/2df0b26d-4f88-4ddc-b445-8793c8549723)



Additional things

-I'm a beginner with both ImHex and English, so I may have missed some
things

-I'm fully open to any suggestions or corrections — whether related to
translation accuracy or JSON formatting/style

-I would greatly appreciate it if the reviewer could:

-Confirm that the project still compiles correctly (it built fine on my
side using ninja)

-Check that the pl_PL.json files are properly formatted and follow the
project's standards

If there are preferred tools or workflows for validating and formatting
JSON in this repository, I’d be happy to adopt them in the future.

---------

Co-authored-by: paxcut <53811119+paxcut@users.noreply.github.com>
2025-06-24 02:02:42 -07:00
only9464
2b352c6d7a i18n: update Chinese (Simplified) translations (#2313)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->
Updated
[plugins/builtin/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/builtin/romfs/lang/zh_CN.json)、
[plugins/diffing/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/diffing/romfs/lang/zh_CN.json)、
[plugins/disassembler/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/disassembler/romfs/lang/zh_CN.json)、
[plugins/fonts/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/fonts/romfs/lang/zh_CN.json)、
[plugins/hashes/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/hashes/romfs/lang/zh_CN.json)、
[plugins/ui/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/ui/romfs/lang/zh_CN.json)、
[plugins/visualizers/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/visualizers/romfs/lang/zh_CN.json)
file to add support for Chinese language
### Implementation description
<!-- Explain what you did to correct the problem -->
| Plugin | Before
Modification([WerWolv/ImHex](https://github.com/WerWolv/ImHex)) | After
Modification([only9464/ImHex](https://github.com/only9464/ImHex)) |

|---------------|-------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| builtin |
[plugins/builtin/romfs/lang/zh_CN.json](https://github.com/WerWolv/ImHex/blob/master/plugins/builtin/romfs/lang/zh_CN.json)
|
[plugins/builtin/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/builtin/romfs/lang/zh_CN.json)
|
| diffing |
[plugins/diffing/romfs/lang/zh_CN.json](https://github.com/WerWolv/ImHex/blob/master/plugins/diffing/romfs/lang/zh_CN.json)
|
[plugins/diffing/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/diffing/romfs/lang/zh_CN.json)
|
| disassembler |
[plugins/disassembler/romfs/lang/zh_CN.json](https://github.com/WerWolv/ImHex/blob/master/plugins/disassembler/romfs/lang/zh_CN.json)
|
[plugins/disassembler/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/disassembler/romfs/lang/zh_CN.json)
|
| fonts |
[plugins/fonts/romfs/lang/zh_CN.json](https://github.com/WerWolv/ImHex/blob/master/plugins/fonts/romfs/lang/zh_CN.json)
|
[plugins/fonts/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/fonts/romfs/lang/zh_CN.json)
|
| hashes |
[plugins/hashes/romfs/lang/zh_CN.json](https://github.com/WerWolv/ImHex/blob/master/plugins/hashes/romfs/lang/zh_CN.json)
|
[plugins/hashes/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/hashes/romfs/lang/zh_CN.json)
|
| ui |
[plugins/ui/romfs/lang/zh_CN.json](https://github.com/WerWolv/ImHex/blob/master/plugins/ui/romfs/lang/zh_CN.json)
|
[plugins/ui/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/ui/romfs/lang/zh_CN.json)
|
| visualizers |
[plugins/visualizers/romfs/lang/zh_CN.json](https://github.com/WerWolv/ImHex/blob/master/plugins/visualizers/romfs/lang/zh_CN.json)
|
[plugins/visualizers/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/visualizers/romfs/lang/zh_CN.json)
|

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->
I don't think this PR needs a screenshot, maybe
### Additional things
<!-- Anything else you would like to say -->
Nothing
2025-06-23 05:07:43 -07:00
only9464
92832d7e14 i18n: update Chinese (Simplified) translations (#2312)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->
Updated
[plugins/builtin/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/builtin/romfs/lang/zh_CN.json)
file to add support for Chinese language
### Implementation description
<!-- Explain what you did to correct the problem -->
Updated
[plugins/builtin/romfs/lang/zh_CN.json](https://github.com/only9464/ImHex/blob/master/plugins/builtin/romfs/lang/zh_CN.json)
<br/>The original
file:[plugins/builtin/romfs/lang/zh_CN.json](https://github.com/WerWolv/ImHex/blob/master/plugins/builtin/romfs/lang/zh_CN.json)
### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

![fb060e34cd545978a5653c1c33867dbe](https://github.com/user-attachments/assets/2fedbd97-1b54-4636-b5b3-9ad953031aeb)
### Additional things
<!-- Anything else you would like to say -->
Nothing
2025-06-21 02:50:52 -07:00
Sean Apeler
10957dbbb9 Allow Section window resizing (#2286)
### Problem description
While working with the section view, I noticed the window wasn't
resizable.

### Implementation description
This simply removes the `ImGuiWindowFlags_NoResize` flag, and then when
drawing the section window sets the hex editor to 70% of the available
window, leaving 30% to the pattern data. This is not ideal, but I think
before a full rewrite of the section window system this would probably
be a simple change to make it a lot more usable.

### Screenshots

![image](https://github.com/user-attachments/assets/55a9f2f5-6eba-436e-b8bb-8a3a78f80d08)

Co-authored-by: paxcut <53811119+paxcut@users.noreply.github.com>
2025-06-21 01:18:35 -07:00
paxcut
88eecf6624 fix: some functions in TaskHandler had their logic reversed from calls to Task functions. (#2311) 2025-06-20 13:08:18 -07:00
paxcut
755a53f821 improv: ImGui test engine window can now be opened and closed from debug menu (#2310) 2025-06-20 12:26:17 -07:00
paxcut
ea4d71b26c fix: fixes for various errors related to shared_from_this. (#2297)
A while back there were some changes to the pattern language library
that changed the way shared_pointers are created using
shared_from_this(). Unfortunatelly the changes were not complete and
various bugs were created among them 2234, json type not working, unable
to export files, static arrays of bitfields,... The cause of the errors
was that in class Pattern the member m_parent was left as a raw pointer
and it needs to be handled by shared pointers. Also there were some
cases in which share pointers were needed but unique pointers were used
instead. Both cause crashes when shared_from_this is used on pointers
that are not managed by shared_ptr. Another source of errors were
infinite loops of clone and reference that caused stack overflow. The
fixes include making m_parent a weak pointer, turning unique pointers
into shared pointers and moving codefrom the copy constructors into
clone to break the infinite loops.These changes are the bare minimum
needed to bring the pattern language back to the full functionality that
it had before shared_from_this was introduced or at least thats the
hope.
2025-06-17 12:32:09 -07:00
paxcut
a4c0d38c53 fix: searching for negative values returns nothing. (#2306)
This pr aims at fixing for negative values in advanced search for
numerical values. For a simple example try searching for -1 for int32_t
which is 0xFFFFFFFF. With the changes you can now find -1 for 1,2,4 or 8
byte integers.

Internal types are bigger than or equal to the types selected in the
options. Search keys are converted to the bigger type, but the values
read from the input file are not. This works ok for positive numbers,
but for negatives it needs some casting.

The casting is performed inside a newly added function that takes the
value returned by read, the size in bytes of the selected type in the
options and a template argument for the 64 bit type the value is stored
into.

I have tested positive and negative values for several different sizes
of signed integers. Also tested unsigned integers both in the low range
(near lowest limit) and in the high range (near largest possible value
for that type)
2025-06-16 14:57:53 -07:00
WerWolv
58228e0af4 fix: More MSVC build issues 2025-05-30 11:54:51 +02:00
WerWolv
1d69d8fb6a build: Disable tests by default again 2025-05-30 11:47:10 +02:00
WerWolv
3445d09390 Revert "build: Handle IMHEX_USE_DEFAULT_BUILD_SETTINGS properly"
This reverts commit d8f0120698.
2025-05-30 11:44:02 +02:00
WerWolv
78b3d3d001 build: Fix MSVC builds 2025-05-30 11:25:15 +02:00
WerWolv
d8f0120698 build: Handle IMHEX_USE_DEFAULT_BUILD_SETTINGS properly 2025-05-30 11:03:50 +02:00
WerWolv
3e25bceb0c build: Updated nlohmann::json 2025-05-30 11:03:34 +02:00
WerWolv
1ca40481bb tests: Integrated ImGui Test Engine 2025-05-29 23:44:49 +02:00
WerWolv
fe1309fb3d build: Don't link against llvm demangle in external builds 2025-05-29 20:27:03 +02:00
WerWolv
12d59ce3e4 fix: Bad copy paste 2025-05-29 20:01:17 +02:00
WerWolv
224fa83c65 fix: Missing <span> include 2025-05-29 19:55:59 +02:00
WerWolv
f591ac8780 fix: UDP Port not being updated correctly when loading provider from recents file 2025-05-29 18:26:07 +02:00
WerWolv
11e70511e6 build: Fix plugin SDK issues 2025-05-29 18:19:20 +02:00
WerWolv
c1e4121d1e build: Updated Windows resource copyright year 2025-05-29 18:00:41 +02:00
WerWolv
03884ddd05 feat: Added simple UDP Data Provider 2025-05-29 18:00:29 +02:00
WerWolv
ac67e985af build: Make tracing library a static library 2025-05-29 14:02:06 +02:00
WerWolv
9d12cd64d3 impr: Add full resolution Windows icon 2025-05-29 13:53:57 +02:00
paxcut
702b5f2888 fix: Problems with textures in 3d visualizer with bitmap visualizer. (#2167)
The bitmap visualizer has been simplified considerably. The previous version was designed to work with the TIM format which has some peculiarities that are not general enough. The current implementation has the following specifications.

. Whether colors are in a lookup table or part of the image itself they are always 32 bit R8G8B8A8.

. If using a color LUT the image then has indices as its element. Indices can have 16(32000 colors), 8 (256 colors) or 4(16 colors) bits each.

.For the cases 0f 16 and 8 bits, the data should be an array of N*M elements of the given size where N is the number of rows and M is the number of columns of the image.

. For the 4 bit case use an array of N*M/2 bytes so that each column contains two indices.

ToDo: Documentation, sample patterns and unit tests.

The 3-d visualizer can now handle textures from both the command line or the user interface and things should work as expected. A command line entry will be automatically displayed in the user interface, but changes will be applied immediately as you type or use the file picker. If the user interface text is deleted, then the command line texture will be used again.  If a texture is invalid for any reason, then the previous one, if any, will be still in use and an error message will be displayed until the problem is cleared. Valid textures are image files that the stb library can open.
2025-05-27 09:25:20 -07:00
WerWolv
a5eef3f34d build: Fix more linker errors 2025-05-26 21:57:27 +02:00
WerWolv
1bc9277e3c build: Fix undefined references 2025-05-26 20:25:35 +02:00
WerWolv
b33cb07dc0 build: Include tracing library in plugin SDK 2025-05-26 20:19:27 +02:00
WerWolv
ce74915c14 feat: Add full exception tracing support 2025-05-26 20:15:20 +02:00
WerWolv
f341413248 fix: Crash when opening diff view
#2269
2025-05-26 18:34:00 +02:00
WerWolv
ed3e2f65f8 impr: Set default font size to 12pt 2025-05-25 23:32:43 +02:00
WerWolv
6e5878b5d6 fix: OOBE logo background color 2025-05-25 23:29:01 +02:00
WerWolv
39242097dd fix: --reset-settings not working due to superfluous null bytes in string 2025-05-25 23:23:51 +02:00
WerWolv
0aec3fffe1 fix: Unused lambda captures 2025-05-25 22:21:40 +02:00
WerWolv
38ef00548a impr: Speed up Import Pattern popup
Closes #2264
2025-05-25 21:08:52 +02:00
WerWolv
c78c8072e9 fix: Text Editor Scrollbars being added multiple times 2025-05-25 20:35:03 +02:00
WerWolv
7c98411abe fix: Tutorial highlighting of menu item 2025-05-25 18:21:26 +02:00
WerWolv
e22516662f patterns: Updated pattern language 2025-05-25 18:21:03 +02:00
WerWolv
24c1f48522 build: Updated lunasvg and libyara 2025-05-25 15:32:43 +02:00
WerWolv
69b07d40e4 build: Updated ImGui to v1.91.9b 2025-05-25 15:30:33 +02:00
WerWolv
b96692b1ba fix: Global scale race condition during font loading 2025-05-25 15:11:09 +02:00
WerWolv
53afb7cba0 git: Add Ubuntu 25.04 release 2025-05-25 14:09:56 +02:00
WerWolv
8e0953af1e git: Only put the current web assembly build into the release artifact 2025-05-25 13:46:57 +02:00
WerWolv
724f9aa524 git: Deploy both latest release and nightly to web.imhex.werwolv.net 2025-05-25 13:43:06 +02:00
WerWolv
7067ffafe7 patterns: Display pattern errors in red in the pattern data view 2025-05-25 11:46:41 +02:00
WerWolv
145c88db31 patterns: Updated pattern language
Fixes #2266
2025-05-25 11:00:59 +02:00
paxcut
56615d6c06 patterns: Updated pattern language (#2270) 2025-05-24 16:44:59 -07:00
WerWolv
d26bcc1abe fix: Menu bar being gone on the Web build 2025-05-24 23:10:53 +02:00
WerWolv
04f817c042 fix: Web Assembly build 2025-05-24 22:45:17 +02:00
WerWolv
b58f97c1f1 impr: Added function to Texture class to retrieve raw image from GPU 2025-05-24 22:32:56 +02:00
WerWolv
96dc386694 fix: Linux build errors 2025-05-24 22:32:33 +02:00
WerWolv
c6c70daa5e fix: macOS build errors 2025-05-24 22:32:24 +02:00
WerWolv
de16375903 impr: Slightly simplify subpixel rendering logic and required ImGui patches 2025-05-24 22:32:08 +02:00
WerWolv
c6548d5ad1 fix: Non-subpixel rendered glyphs appearing as white rectangles if subpixel rendering is enabled 2025-05-24 21:59:21 +02:00
WerWolv
bd8c4e807c fix: Remove extra pixel from Hex Editor selection frame 2025-05-24 16:19:13 +02:00
WerWolv
553549302c impr: Use linear scaling for the windows title bar icon 2025-05-24 16:18:59 +02:00
WerWolv
c69a7012c5 fix: Unifont glyphs being rendered too far down 2025-05-24 16:09:15 +02:00
WerWolv
7acc5fc02e impr: Make title bar backdrop actually a backdrop and not an overlay 2025-05-24 11:57:02 +02:00
WerWolv
39bc165f36 build: Prevent frame pointer omission to improve stack traces 2025-05-24 11:56:44 +02:00
WerWolv
707a92281b fix: Multithreaded disk access issues 2025-05-24 11:48:07 +02:00
WerWolv
823013a3d9 fix: Fonts being smaller than their set size value 2025-05-24 11:47:46 +02:00
WerWolv
7089561b21 git: Remove accidentally committed file 2025-05-19 00:01:23 +02:00
WerWolv
0f0bff1685 fix: Remaining Subpixel rendering issues 2025-05-19 00:00:32 +02:00
WerWolv
b6387c3f64 fix: Crash when loading subpixel font didn't work 2025-05-18 11:10:43 +02:00
paxcut
ff0bcfb7da fix: More per-provider data access errors (#2256) 2025-05-17 21:48:36 -07:00
Stephen Hewitt
f729d36214 fix: Crash when sorting for value fields in pattern data view, fix HTML export encoding (#2242)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
This is a fix for the ImHex bug "ImHex crashes when analysing any PE
file #2221"

### Implementation description
This is a fix for the ImHex bug "ImHex crashes when analysing any PE
file #2221". The fix requires changes to the Pattern Language and the
ImHex UI. Revision would be wise. We want to avoid collateral damage.
It's a big code base and I'm new to it and the compilers/build-systems
used. And the bug is complex and low-level. I suspect this will fix
other random crashes. The problem is caused by two issues:
- The std::sort algorithm conjuring up garbage due to the sorting
criteria not being a strict weak ordering. See
[this](https://github.com/Voultapher/sort-research-rs/blob/main/writeup/sort_safety/text.md)
link.
- We sort shared_ptr&lt;ptrn::Pattern&gt; by pointer value, and the
object is a clone. In essence we're changing the values as we're
sorting.
 
Fixes #2221

### IMPORTANT
I'm not sure how "plugins/builtin/source/content/data_formatters.cpp"
got into the PR. Been trying for an hour to rectify. I'm not a Git
expert (the last time I used source control seriously SourceSafe was a
thing) please ignore that file. It's a fix for another PR I submitted. I
suspect I stuffed up the branching and merging.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2025-05-17 20:50:21 +00:00
WerWolv
d5a07b6a5b patterns: Updated pattern language 2025-05-17 22:20:05 +02:00
WerWolv
bda0b3ce18 fix: More per-provider data access errors 2025-05-17 22:14:27 +02:00
WerWolv
14d95a7e46 patterns: Updated pattern language 2025-05-17 20:31:38 +02:00
WerWolv
2ef2cdd874 fix: Make sure PerProvider don't get accessed using a nullptr provider 2025-05-17 20:29:54 +02:00
paxcut
57c2d84122 improv: made the text editors to be per provider. (#2255)
The recent update that made importing patterns undoable had the side
effect of undoing tab changes as well. When working on a fix for that it
became clear that the undo/redo stacks were being shared by all
providers so that you could undo changes done in a separate file. The
problem was fixed by making the text editors (and the console editors as
well) to be per provider which gives better control on things like
breakpoints and selections and a more robust focusing system that
preserves the cursor positions and removes the need to click on a
pattern to start editing. There are a lot of changes, but they are
mostly all the uses of text editors being now coded differently to
manage the providers. File imports are still undoable, but switching
providers is not.
Further changes suggested by reviewer were implemented namely a mull provider was being used and there was a get function missing which prevented the use of the preferred syntax.
2025-05-17 11:26:54 -07:00
paxcut
d263962a06 fix: horizontal scrollbar missing in console (#2253)
The recent changes to the text editor to fix the longest line length
problems broke the console horizontal scrollbar. The code that displays
the console editor was more complicated that it needed be, and it had
the bad side effect of resetting the cursor which prevented horizontal
scrolling. Adding a function that appends lines to the text editor fixes
all problems and makes the code clearer. To accommodate for strings
containing zeros, the code that inserts text was changed to print a '.'
when zeros are encountered thus keeping the line length the same.
2025-05-17 00:23:43 -07:00
WerWolv
e32c5784af impr: Further refine pattern tree indenting 2025-05-16 20:24:38 +02:00
WerWolv
1496a6e755 impr: Improve indentation of pattern data tree
#2252
2025-05-16 18:50:35 +02:00
WerWolv
6dab1063a1 fix: Provider getting marked as dirty immediately on load
#2251
2025-05-16 18:50:03 +02:00
paxcut
ff286f3e05 fix: subpixel effects on hex editor. (#2247)
The implementation of subpixel rendering using draw call lists with
callbacks prevents call list merging and their associated clip rects in
tables. As a result clip rects become as narrow as the columns of the
table which can clip previously renderable primitives. The hex editor
has several draw calls that render outside their column so if subpixel
rendering is selected those primitives cease to be displayed.

To fix this issue, and to verify that this was indeed the cause behind
the issue, we simply push an adequately sized clip rect before the draw
call command and pop it right after.

A problem with segment vertical separators not being rendered in the
first tow was also fixed.
2025-05-16 01:31:29 -07:00
WerWolv
6f112c2d16 feat: Added custom encoding row to data inspector 2025-05-15 22:00:43 +02:00
paxcut
8f222dab99 fix: unable to display models if indices are not contiguous in the input file (#2248)
If you tried to collect the indices using addressof like stl pattern
collects vertices you get a small square for visualizer and no error
message. The changes here are able to extract the indices if they can be
extracted and give an error message if they can't.
2025-05-14 22:08:16 -07:00
paxcut
828951ffe9 build: msvc uninitialized variables. (#2239)
MSVC build failing because of a warning treated as an error for
variables being used without initializing even though they are being
passed as references.
2025-05-12 01:58:10 -07:00
WerWolv
616f34e210 fix: Window being created partially off-screen if monitor is too small
Fixes #2238
2025-05-11 23:54:58 +02:00
WerWolv
fa3ed7e618 impr: Load all unicode planes if requested 2025-05-11 23:26:27 +02:00
WerWolv
a207969dec fix: Unicode enable option not working correctly 2025-05-11 23:07:52 +02:00
WerWolv
7fde40b04e impr: Allow for higher planes of unicode characters to be recognized
#2237
2025-05-11 23:07:27 +02:00
WerWolv
1bce588cdd impr: Make sure settings descriptions are always visible 2025-05-11 18:11:28 +02:00
WerWolv
5a095cc993 fix: Icon scaling when using pixel perfect font 2025-05-11 17:42:36 +02:00
WerWolv
431eab47a2 git: Remove Fedora 40 support, add Fedora 42 support 2025-05-11 17:25:20 +02:00
WerWolv
e9e3d25315 fix: Rendering on macOS being broken 2025-05-11 17:18:43 +02:00
WerWolv
e2735e283e fix: Text not rendering at all on the Web version 2025-05-11 17:07:19 +02:00
WerWolv
3e9cb57dd6 fix: Grayscale antialiasing not blending correctly 2025-05-11 17:07:03 +02:00
paxcut
5c4cf7379f feat: Added Subpixel Font rendering (#2092)
Proof of concept for implementing subpixel processing in ImGui. This is
work in progress, and it is bound to have problems.

What it does:
1) Uses freetype own subpixel processing implementation to build a
32-bit color atlas for the default font only (no icons, no unifont) . 2)
Avoids pixel perfect font conversion when possible. 3) Self contained,
no ImGui source code changes.
4) Results in much improved legibility of fonts rendered on low dpi LCD
screens that use horizontal RGB pixel layouts (no BRG or OLED or CRT if
they even exist anymore)

What it doesn't:
1) Fancy class based interface. The code is barely the minimum needed to
show it can work. 2) Dual source color blending. That needs to be
implemented in shader code, so it needs to change ImGui source code
although minimally. This will result in some characters appearing dimmer
than others. Easily fixed with small fragment and vertex shaders. 3)
subpixel positioning. If characters are very thin they will look
colored, or they can be moved to improve legibility. 4) deal with
detection of fringe cases including rare pixel layouts, non LCD screens,
Mac-OS not handling subpixel rendering and any other deviation from the
standard LCD. 5) tries to be efficient in speed or memory use. Font
Atlases will be 4 times the size they were before, but there are no
noticeable delays in font loading in the examples I have tried.

Any comments and code improvements are welcome.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2025-05-11 15:36:32 +02:00
WerWolv
8cd961596e fix: Undo accent color changes as they produced some weird results 2025-05-11 15:24:24 +02:00
WerWolv
d2344418d6 patterns: Updated pattern language 2025-05-11 15:22:27 +02:00
WerWolv
33aa2248d2 fix: Theme color alpha not being applied correctly to accented colors 2025-05-11 11:05:53 +02:00
WerWolv
feb5b209ed web: Adapt new async WASM loading API 2025-05-10 21:30:42 +02:00
WerWolv
34722404f4 build: Emscripten no longer generates imhex.worker.js 2025-05-10 19:25:36 +02:00
WerWolv
b78a234fe1 impr: Make accent colors work more naturally 2025-05-10 18:23:29 +02:00
WerWolv
f19478374f build: Update emscripten to the latest version 2025-05-10 14:24:07 +02:00
WerWolv
51a01c860b patterns: Updated pattern language 2025-05-10 12:17:41 +02:00
WerWolv
eedd044716 build: Updated dependencies 2025-05-10 11:11:18 +02:00
WerWolv
0a327f4ad3 impr: Allow debug banner to be skipped with a env var 2025-05-10 11:00:18 +02:00
WerWolv
eec6a5da0a impr: Unlock frame rate in more cases 2025-05-10 11:00:18 +02:00
WerWolv
fc87bc0cf1 impr: Allow events to be used with a function without args 2025-05-10 11:00:18 +02:00
peelz
1f213408a1 build: Move nlohmann-json to build dependencies (#2218)
nlohmann-json is a headers-only library, so there's no runtime
requirement for it.
2025-05-10 10:59:18 +02:00
WerWolv
bac6fd803f patterns: Updated pattern language 2025-05-09 21:18:31 +02:00
WerWolv
5a74d7e3e2 patterns: Updated pattern language 2025-05-09 19:35:00 +02:00
WerWolv
e289380c39 fix: Crash when selecting invalid time_t 2025-05-09 19:33:01 +02:00
WerWolv
8081dff6b6 build: Updated libfmt (#2234) 2025-05-09 19:00:04 +02:00
WerWolv
7dcf09118b patterns: Updated pattern language 2025-05-09 18:24:50 +02:00
WerWolv
4b9a3d121d fix: Visualizer popups being draggable from their body 2025-05-09 17:23:55 +02:00
WerWolv
cd24cba240 build: Updated libwolv 2025-05-09 17:23:35 +02:00
paxcut
d33fad9d23 fix: The bar between pattern editor and console could be locked even if it seemed like it should be movable. (#2227)
This was caused by the variable that holds the bar location not being
updated when window was resized.
The bar can be moved until only one line is shown in the smaller window.
When ImJex window is resized, the proportion of editor/console height is
maintained.
2025-05-05 02:43:14 -07:00
paxcut
b02aa51e09 fix: macos builds
Found post on s.o. about c++ headers not being found when using llvm
clang installed using homebrew
[here](https://stackoverflow.com/questions/77250743/mac-xcode-g-cannot-compile-even-a-basic-c-program-issues-with-standard-libr)
and when I tested the proposed solution in my imhex fork the macos x86
builds were able to complete.
2025-05-04 21:19:29 -07:00
ThePirate42
36eeee5f9c fix: prevent potential UB using std::clamp.
### Problem description
It is possible for the maximum and minimum value arguments to std::clamp to be swapped which is defined  in the standard as undefined behavior

### Implementation description
Swap the values if necessary.


---------

Co-authored-by: paxcut <53811119+paxcut@users.noreply.github.com>
2025-05-04 17:24:59 -07:00
paxcut
4883ed0e5a fix: Incorrect horizontal scrollbar displayed. (#2209)
The horizontal scroll bar length is set using the maximum line length across the input file. The original setup had the lengths of imported and included files added so changes are made to insure that only changes from the input file are taken. This required changes to the Pattern Language library so the library is updated to the latest version as well.
2025-05-04 07:56:39 -07:00
paxcut
78ad0d2592 fix: fixed console selections while improving code clarity.
The function SetSelection() in the text editor is used as its name implies to set the part of text that will be shown highlighted as a selection. It has two parameter for the selection start and end.

Strangely it also uses a third argument to choose one of 3 selection modes (line, word and normal). This is strange because it seems that if one wanted to select a line one would simply choose the line start and end as the selection values. 

Furthermore using selection mode creates a bug when the word boundaries are advanced twice during a single word left or right selection and a second bug when SetSelection is used to set the cursor when the window acquires focus breaking selections in the console editor.

This PR simply eliminates the extraneous argument to SetSelection() ensuring that any problems related to it are fixed once and for all improving code readability by removing the use of inconsistent argument values to cover for the functionality  duplication design flaw.
2025-04-30 22:08:23 -07:00
SparkyTD
f6def74b29 impr: Fix word bound selection and 'MoveHome' behavior in the pattern editor (#2193)
### Problem description
This PR addresses two small issues regarding the cursor in the pattern
editor (TextEditor.cpp):

1. It was not possible to move the cursor to the start of a line, if it
contained leading white space characters. With my fix, the editor will
behave more like other code editors. Pressing Home once will jump to the
first non-whitespace character (as it did before), but pressing it again
will jump to column 0. Subsequent presses will alternate between the two
positions.
2. When expanding a selection with Ctrl+Shift+{Left/Right}, the new
selection position would skip an additional word, resulting in the
cursor landing "inside" the selection. This PR fixes this bug.

### Implementation description
1. To fix the first issue, I simply added a condition in
`TextEditor::MoveHome` to check if the cursor is already on the first
meaningful character, or on one of the whitespaces preceding it, in
which case the jump offset is set to 0. If we're already on column 0,
then jump forwards to the first non-whitespace character.
2. This bug was happening because the word boundary jump calculations
were essentially happening twice. Once in
`TextEditor::MoveLeft`/`TextEditor::MoveRight`, and then a second time
in `TextEditor::SetSelection`, leading to the selection skipping an
additional word. I fixed this by replacing the ternary operator with
just `SelectionMode::Normal`.

---------

Co-authored-by: paxcut <53811119+paxcut@users.noreply.github.com>
2025-04-30 11:57:34 -07:00
Geky
be44676b01 i18n: Added french translation (#2171) 2025-04-24 11:14:41 +02:00
paxcut
60c1c22a73 fix: fixes Issue #1621 (#2189)
fixes Issue #1621.
Using shift-tab on an empty line caused a crash.  Additionally, changed
the hard coded value of 4 to the tab size variable it really needs to be.
2025-04-23 06:54:39 -07:00
WerWolv
02cadc264e build: Try to use macOS 13 SDK if possible 2025-04-14 20:42:37 +02:00
WerWolv
a0ca5b8072 fix: Missing include on clang 20 2025-04-14 20:21:53 +02:00
WerWolv
31fdb73b0e git: Remove --no-lock from brew commands since it was removed 2025-04-14 19:02:07 +02:00
WerWolv
d2caa1859d fix: LayoutManager build issues 2025-04-09 07:26:45 +02:00
PietHelzel
f6c25b30ae fix: Saving layout now picks the first path in the list (#2208)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
Saving a layout using the "Workspace -> Layout -> Save Layout ..."
button saved to the last writable path in the list that can be found in
the "Help -> About" menu. Instead, it should write to the first working
path encountered.

### Implementation description
Getting all of the writable paths, then picking the first one.

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->
2025-04-08 21:47:20 +02:00
WerWolv
379d826f18 build: Fix configure issues with cmake 4.0.0 2025-04-04 00:02:39 +02:00
WerWolv
96afccc46c fix: Workspaces not being updated correctly 2025-04-03 23:55:35 +02:00
paxcut
c0a222644b feat: Allow adding breakpoints in pattern editor by clicking on line numbers (#2161)
Now that line numbers are not part of the line of code clicking them
makes the text editor lose focus. This PR changes that by allowing the
user to toggle breakpoints by clicking the field where the line number
is located.

Not only will the text editor retain focus when breakpoints are set, but
if other parts of ImHex had focus, then it will be transferred to the
text editor's current cursor position when the line number field is
clicked.

It is also possible to keep the focus where it was and only retain the
focus if the text editor was focused when the break point is set. The
change is very trivial so if that is preferred I can easily switch it.
2025-03-11 14:57:49 +01:00
paxcut
653173945f feat: Make undo work when importing pattern (#2160)
A user complained that they imported a file by accident when they meant
to export it and as a result had trouble recovering the changes they
were trying to save. Auto-save saved the day but there is no reason for
not being able to undo changes after importing a pattern.

In fact, the previous implementation treated importing a pattern as a
reset on the editor instance which actually erased all previous undo
entries. Importing now is treated as a normal editing operation where
the entire file is replaced with the imported pattern.
Since all imports use AddText it was easy to add an undo entry to that
function while removing the part where the previous undo records were
being deleted.

Care is taken to add the preprocessed version of the imported file to
the undo buffer so that unwanted chars don't sneak in. A bug was found
in the handling of a tab char as well but hopefully it wont need to be
used anymore.
2025-03-11 14:56:44 +01:00
paxcut
7d09cc6d25 fix: Console editor not showing all output (#2133)
This change is to fix a bug reported in discord by berkus and Naheulf
about the console missing output lines. The bug was caused by using
SetText which replaces the existing text with the text in the argument.

To fix it use InsertText which puts the text at the current cursor
position that was already set to the end of the current contents.

Code was tested with pattern used to reproduce the bug and seemed to
work when evaluated repeatedly.
2025-03-11 14:56:05 +01:00
Stefan
a4360dfe76 lang: Use ß in German translation where needed (#2135) 2025-03-11 14:55:12 +01:00
WerWolv
9887117e7a build: Updated disassembler library 2025-03-03 15:41:04 +01:00
xtex
9be7eafa39 build: Find regex component of Boost explicitly (#2151)
'Boost::regex' could not be found unless regex is specified explicitly
on some systems.

cf. https://github.com/AOSC-Dev/aosc-os-abbs/pull/9798
cc. @chenx97

### Problem description
> Target "libimhex" links to: Boost::regex but the target was not found.
when building ImHex with system Boost.

### Implementation description
Add `COMPONENETS regex` to require regex library explicitly.

Signed-off-by: xtex <xtex@aosc.io>
Co-authored-by: Henry Chen <chenx97@aosc.io>
2025-02-28 12:29:39 +01:00
WerWolv
774eb18a42 impr: Make custom disassemblers reload on run 2025-02-28 12:04:47 +01:00
WerWolv
4e582d02f5 fix: More issues with OpenGL texture deallocation 2025-02-27 21:44:42 +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
e17490ee04 build: Install updater binary into bundle on macOS 2025-02-27 08:44:32 +01:00
WerWolv
f3a9ca6d6f fix: Only try to delete textures if OpenGL is still available 2025-02-26 16:03:37 +01:00
WerWolv
2653740a36 fix: Wrong scripts menu rendering on macOS with OS menu bar enabled 2025-02-26 16:03:29 +01:00
WerWolv
335042ec08 impr: Reduce CPU usage further 2025-02-26 16:03:24 +01:00
WerWolv
f6944b15f3 fix: Large CPU usage 2025-02-26 16:03:16 +01:00
WerWolv
d7960dccb4 fix: ID collision when having duplicate fonts installed
Fixes #2141
2025-02-25 11:52:46 +01:00
WerWolv
c974c4257d fix: Crash on exit due to frame rate limiter thread not being shut down
Fixes #2140
2025-02-25 11:50:38 +01:00
WerWolv
40d74dd633 fix: Crashes when switching disassembler architecture while disassembling 2025-02-24 19:58:40 +01:00
WerWolv
602c85b57d fix: Way too low sleep target fps 2025-02-24 19:53:07 +01:00
WerWolv
f96fa596b3 fix: Debug assertion 2025-02-24 19:52:41 +01:00
WerWolv
8c13d0096e build: Remove wrong hexpluglib bundling from rpms 2025-02-23 21:08:22 +01:00
WerWolv
7879f8b6a4 impr: Don't wake up frame rate limiter thread more often than necessary 2025-02-23 20:25:29 +01:00
WerWolv
4c0e8bc1d6 build: Disable fortify source in debug builds 2025-02-23 20:24:10 +01:00
WerWolv
6644df3958 build: Make sure plugin libraries don't end up in lib folder 2025-02-20 11:29:39 +01:00
WerWolv
2b5551d719 fix: Crash when closing provider that's open in the diff view 2025-02-20 10:34:59 +01:00
Jonathan Wright
137063dd21 build: Fix using system lunasvg (#2131)
Fix capitalization for cmake find_package and lunasvg.h path
2025-02-19 20:42:22 +01:00
WerWolv
ca403869ab fix: Broken Plugin API link 2025-02-19 14:46:01 +01:00
WerWolv
daf676b277 fix: Potential division by zero on Windows 7
#2130
2025-02-19 10:58:16 +01:00
WerWolv
66bbdbe6ec patterns: Updated pattern language
Fixes #2126
2025-02-18 22:48:49 +01:00
WerWolv
d3c2516f5f fix: Occasional crash when switching fonts 2025-02-18 21:50:51 +01:00
WerWolv
c39ae84922 impr: Make CLI not hang for a second after each command on Linux 2025-02-18 20:54:25 +01:00
WerWolv
a83843fdab patterns: Updated pattern language 2025-02-18 20:39:59 +01:00
WerWolv
2d48da1c4a fix: Prevent stack overread when calling dbus-send 2025-02-18 15:22:29 +01:00
WerWolv
af0c15f69d impr: Make title bar icon always draw at the correct size 2025-02-18 15:21:56 +01:00
WerWolv
7898df9c2c fix: Pattern Editor losing focus during auto evaluation
Fixes #2122
2025-02-18 10:25:59 +01:00
WerWolv
48abdeaf6b build: Fixed Linux build issues 2025-02-18 10:21:26 +01:00
WerWolv
99a4979b65 build: Fixed Windows build issues 2025-02-18 09:24:20 +01:00
WerWolv
d8beff4f6b build: Only enable module scanning when modules are enabled 2025-02-18 00:47:36 +01:00
WerWolv
ccaf1e33c0 build: Make this modules stuff actually mostly work on Clang 2025-02-18 00:39:53 +01:00
WerWolv
3f119b957e build: Use -fvisibility=hidden for plugins 2025-02-17 22:57:33 +01:00
WerWolv
abf97212fe build: Added some initial test code for C++ Modules 2025-02-17 22:57:21 +01:00
WerWolv
b81c3d2f75 build: Updated dependencies 2025-02-17 16:19:02 +01:00
WerWolv
5651c4d95c git: Updated gcc version in compile instructions 2025-02-17 16:14:49 +01:00
WerWolv
c83a5cc1b7 build: Get rid of unused Toolchain file warning 2025-02-17 13:19:53 +01:00
WerWolv
0499807597 fix: Remove unused event unsubscribes in disassembler 2025-02-17 13:07:01 +01:00
WerWolv
f846afd8a9 fix: Crash when setting invalid font 2025-02-17 13:06:35 +01:00
WerWolv
b822c82d18 impr: Added missing ellipsis on Edit options 2025-02-17 11:21:55 +01:00
WerWolv
e4de551008 fix: Closing one view breaking all other views 2025-02-17 10:16:51 +01:00
WerWolv
5333d0180f fix: Crash when loading process memory provider from project 2025-02-17 10:16:37 +01:00
WerWolv
658d4c4d72 fix: Make sure fps counter values are initialized to zero 2025-02-16 23:46:08 +01:00
WerWolv
efa50a8c39 fix: Revert accent color changes 2025-02-16 22:52:54 +01:00
WerWolv
677dc6192d fix: Don't execute EventDPIChanged multiple times 2025-02-16 22:21:00 +01:00
WerWolv
1ed56c1b1d fix: Wrong native scaling on Wayland 2025-02-16 21:59:30 +01:00
WerWolv
983be04722 impr: Allow accent colors to have darker colors 2025-02-16 21:24:23 +01:00
WerWolv
1bd9c918f6 fix: Crash when custom disassembler returns no bytes 2025-02-16 21:11:02 +01:00
WerWolv
0ba16485bb patterns: Updated pattern language 2025-02-16 21:06:39 +01:00
WerWolv
1d9934830b fix: Pattern editor being shifted to the left on evaluate 2025-02-16 20:50:49 +01:00
WerWolv
806d6148eb fix: Pattern console log logic 2025-02-16 20:08:36 +01:00
WerWolv
e484587778 fix: Don't parse version string on every call 2025-02-16 20:08:10 +01:00
WerWolv
1e4b5104b7 build: Updated libwolv 2025-02-16 20:07:44 +01:00
WerWolv
676d2e2ef5 build: Fixed release note generator script 2025-02-16 19:24:40 +01:00
WerWolv
6122d44bd9 git: Fixed dnf cache key 2025-02-16 19:24:27 +01:00
WerWolv
eb9f0cdf0c build: Bumped version to 1.38.0.WIP 2025-02-16 19:24:10 +01:00
WerWolv
01f4595aab build: Bumped version to 1.37.0 2025-02-16 17:13:50 +01:00
WerWolv
bf10d333cd fix: Default scale of Web version on macOS 2025-02-16 16:35:37 +01:00
WerWolv
267ef37cb6 fix: Use after free when logging during plugin unload 2025-02-16 16:19:00 +01:00
WerWolv
879e4c9d58 build: Move menu items handler into libimhex 2025-02-16 15:48:44 +01:00
WerWolv
67340e1526 impr: Make sure to only ever load plugins once 2025-02-16 15:14:23 +01:00
WerWolv
6ec8f9efe5 fix: Allow --select subcommand to work with hex numbers 2025-02-16 15:02:29 +01:00
WerWolv
c2b0560d91 git: Make sure entitlements are applied correctly to ARM macos builds 2025-02-16 14:58:29 +01:00
WerWolv
388071557e impr: Reduce opacity of modal backdrop 2025-02-16 14:33:17 +01:00
WerWolv
f6e3ede178 impr: Make hyperlink icons gray 2025-02-16 14:30:06 +01:00
WerWolv
a907550567 fix: Title bar backdrop not working correctly on macOS 2025-02-16 14:24:00 +01:00
WerWolv
c75a15dc3b patterns: Updated pattern language 2025-02-16 14:21:19 +01:00
WerWolv
83904aa1f1 fix: Disable alpha display in various color buttons 2025-02-16 14:12:58 +01:00
WerWolv
7d527fd2a6 feat: Added disassemblers tab to content store 2025-02-16 13:58:56 +01:00
paxcut
007e04bf37 fix: Auto evaluate not working when undoing changes (#2106)
The pattern editor was resetting the flag that marked text changes on
every frame, but resolving a text change may take more than one frame,
so instead I created a function that allows the resetting of the text
changed boolean from view pattern editor.

Currently, when a pattern is evaluated the pattern editor will lose
focus regardless of how evaluation was triggered. This is specially
annoying when using f5 or auto-evaluate. Now whenever a pattern is
evaluated, focus is given to the pattern editor when evaluation ends.

JumptoLine didn't work for empty lines.

Co-authored-by: Nik <werwolv98@gmail.com>
2025-02-16 12:20:22 +00:00
paxcut
caff49504e impr: Better home shortcut for pattern editor (#2105)
The old home shortcut moved the cursor to column zero of the current
line.
Most editors move cursor to the first non-space character instead.
2025-02-16 12:53:07 +01:00
WerWolv
aad38beaf5 fix: Dangerous for loop comparison 2025-02-16 11:56:07 +01:00
WerWolv
bdad733331 build: Document disabled MSVC warnings 2025-02-16 11:53:01 +01:00
WerWolv
bc26ade57e fix: Double -> Float truncation 2025-02-16 11:49:32 +01:00
WerWolv
ee52ff3b11 impr: Make toolbar buttons slightly easier to see 2025-02-16 11:48:28 +01:00
WerWolv
40b95f02e4 patterns: Updated pattern language 2025-02-16 11:42:27 +01:00
WerWolv
8777a85630 fix: Make title bar backdrop stay where it is on resize 2025-02-16 11:40:09 +01:00
WerWolv
870aeb34fc feat: Added a title bar backdrop color gradient 2025-02-16 11:33:41 +01:00
WerWolv
b03be212b3 git: Fixed AppImage runner caching 2025-02-16 11:11:24 +01:00
WerWolv
c8f7dbf85e fix: Remove settings scaling warning as it doesn't make any sense anymore now 2025-02-16 10:56:01 +01:00
WerWolv
9e826b4c8b fix: Make sure shortcuts migration routine runs again with this release 2025-02-16 10:48:29 +01:00
WerWolv
05d528b39a git: Disable attestation for pull requests again 2025-02-16 10:03:17 +01:00
Justus Garbe
6828c7c077 fix: crash when disassembler encounters invalid instructions (#2116) 2025-02-16 00:52:30 +01:00
WerWolv
54f3bc0262 impr: Use heuristic to determine backing scale factor on the web 2025-02-15 22:30:06 +01:00
WerWolv
e232a2b33d fix: Web build rendering 2025-02-15 22:23:49 +01:00
WerWolv
73a3b217a4 fix: Scaling on the web version 2025-02-15 21:26:03 +01:00
WerWolv
19f925c60b build: Disable stack protectors for the web build since emscripten doesn't support it 2025-02-15 21:08:05 +01:00
WerWolv
5fb488236b git: Fixed macOS DMGs not having their volume icon set 2025-02-15 21:05:50 +01:00
WerWolv
c84786f9ee git: Fixed name of macOS ARM64 release build 2025-02-15 21:05:35 +01:00
WerWolv
c1925ddf8d fix: Inverted logic of donation nag 2025-02-15 19:34:18 +01:00
WerWolv
cf194e332c impr: Move update button from welcome screen to the title bar and show a toast 2025-02-15 19:25:29 +01:00
WerWolv
d8877e7d8b build: Enabled various hardening flags on GCC and Clang 2025-02-15 19:15:34 +01:00
WerWolv
8b2184f8e3 updater: Fixed updater not working properly on macOS 2025-02-15 17:50:29 +01:00
WerWolv
a42e4c5299 updater: Added updater support for more platforms 2025-02-15 17:14:58 +01:00
WerWolv
419787e17c impr: Make auto updater work better on Windows 2025-02-15 16:46:36 +01:00
WerWolv
2d6da52a86 patterns: Updated pattern language
Fixes #2114
2025-02-15 16:10:09 +01:00
Nik
b46deb3fa0 git: Added MSVC build CI (#2115) 2025-02-15 15:44:16 +01:00
WerWolv
b70120a248 build: Updated libwolv 2025-02-15 11:16:50 +01:00
WerWolv
3a6a4011d0 feat: Added nag banners for donations 2025-02-15 11:15:56 +01:00
WerWolv
999c4d07b7 fix: More double -> float narrowing fixes 2025-02-15 11:15:39 +01:00
WerWolv
44b182c6ae impr: Handle upgrade paths better 2025-02-15 11:15:24 +01:00
WerWolv
de7bec547a build: Make VS preset use Ninja because _my god_ MSBuild sucks 2025-02-15 11:14:46 +01:00
WerWolv
5542c0bc00 fix: Multiple issues with provider load interfaces not working 2025-02-15 11:13:22 +01:00
WerWolv
83e0ce0042 fix: Corporate environment detection not working correctly 2025-02-15 11:09:20 +01:00
WerWolv
4685dea075 git: Fix attestation generation 2025-02-11 23:52:46 +01:00
WerWolv
599f63bc67 build: Updated libwolv 2025-02-11 23:45:55 +01:00
WerWolv
199f2aea77 build: Updated disassembler library 2025-02-11 23:09:15 +01:00
WerWolv
bff9b8b4b1 feat: Fixed string/char names in data inspector, added utf16 and utf32 string and char types 2025-02-11 23:05:56 +01:00
WerWolv
a83610bc06 build: Updated libwolv 2025-02-11 23:05:25 +01:00
WerWolv
b3d208e6e6 impr: Allow sidebar to be only resized from the right 2025-02-10 21:42:12 +01:00
WerWolv
e8b391c0f6 feat: Added option to randomize window title 2025-02-10 14:02:32 +01:00
WerWolv
02b5df03ab impr: Drastically reduce font-related memory usage 2025-02-10 12:02:05 +01:00
WerWolv
e1580e51cf build: Make ImHex fully compile with warnings enabled in MSVC 2025-02-10 09:42:35 +01:00
WerWolv
3a7578879f fix: RGBA8 data processor node not working correctly 2025-02-09 23:38:35 +01:00
WerWolv
ea3d4b41a9 patterns: Updated pattern language 2025-02-09 10:28:46 +01:00
WerWolv
e0c2a39ce7 build: Fix ARM64 macOS build issues 2025-02-08 11:27:40 +01:00
WerWolv
1fa27b7f09 build: Fix remaining wasm build issues 2025-02-08 10:50:04 +01:00
WerWolv
f980f1dae2 build: Compress wasm build romfs 2025-02-07 23:56:50 +01:00
WerWolv
b81ad53449 build: Move vcpkg.json away 2025-02-07 23:56:50 +01:00
WerWolv
a9727171e2 build: vcpkg is already installed in the macOS docker 2025-02-07 23:37:10 +01:00
WerWolv
a1634fb337 build: Properly update vcpkg pages in web and macOS ARM docker 2025-02-07 23:34:05 +01:00
WerWolv
94a2f9460e impr: Use proper main() return values in forwarder 2025-02-07 22:19:35 +01:00
WerWolv
18cd39270a fix: Very slow processing of large pattern console outputs 2025-02-07 22:19:15 +01:00
WerWolv
72c2bca363 fix: Severe lack of easter eggs 2025-02-07 16:24:57 +01:00
WerWolv
4c153dc76d fix: Windows forwarder application not working when piping output 2025-02-07 16:23:27 +01:00
WerWolv
e63606f6bb feat: Added separate --version-short command 2025-02-07 15:46:11 +01:00
WerWolv
ed6da7fe14 fix: Writing not working correctly through a provider view 2025-02-07 15:45:38 +01:00
WerWolv
a588c96440 fix: Properly trigger global shortcuts 2025-02-06 22:34:34 +01:00
WerWolv
4c284b224e fix: Properly trigger all shortcuts 2025-02-06 22:33:14 +01:00
WerWolv
96afa650d1 fix: Properly trigger shortcuts on selected view on macOS 2025-02-06 22:13:06 +01:00
WerWolv
f17d0d3ae1 impr: Added simplified output option for --version 2025-02-06 21:46:27 +01:00
WerWolv
930d2b4280 fix: Some shortcuts not working correctly on macOS 2025-02-06 15:58:18 +01:00
WerWolv
f67b78bd91 build: Update vcpkg baseline on build 2025-02-06 15:24:57 +01:00
WerWolv
540e8ed602 build: Install vcpkg again in the ARM64 macOS docker 2025-02-06 15:21:07 +01:00
WerWolv
99cb51e813 build: Updated vcpkg baseline 2025-02-06 15:08:48 +01:00
WerWolv
db000c4b12 fix: Missing GLFW include on macOS 2025-02-06 14:12:52 +01:00
WerWolv
0cd557a686 impr: Remove frame from selectable text regions 2025-02-06 14:00:32 +01:00
WerWolv
6142bf859b fix: Missing new line 2025-02-06 13:27:48 +01:00
WerWolv
b6498b5c2d fix: Build error when including file in ObjC code 2025-02-06 13:04:36 +01:00
WerWolv
c15030e96e git: Remove libpl from PDB extraction process 2025-02-06 13:04:01 +01:00
WerWolv
cd2acd73b4 build: Fix libpl linking 2025-02-06 12:08:57 +01:00
WerWolv
cfe06ea1b6 build: Statically link libpl again everywhere 2025-02-06 12:03:20 +01:00
WerWolv
ca5c3e0e94 build: Fix linking against libpl in external plugins 2025-02-05 20:09:42 +01:00
WerWolv
6252fd399a fix: Loading/Storing of shortcut keys 2025-02-05 20:09:24 +01:00
WerWolv
de571e2c2a build: Updated libwolv 2025-02-05 20:09:12 +01:00
WerWolv
0cbd052b91 build: Updated dependencies 2025-02-05 15:09:09 +01:00
WerWolv
aa3ec3ece8 build: Updated dependencies 2025-02-05 13:49:16 +01:00
WerWolv
6b11028b72 impr: Use proper function to get environment variables 2025-02-05 13:47:38 +01:00
WerWolv
269c3e7398 fix: Wrong keys being loaded from settings for shortcuts 2025-02-05 13:47:17 +01:00
WerWolv
08335041f5 fix: Crash on Linux uf XDG_SESSION_TYPE is not set 2025-02-05 09:40:13 +01:00
WerWolv
d75b9cf942 build: Properly link plugins against libpl if it's a shared library 2025-02-04 12:16:46 +01:00
WerWolv
b55c40523f fix: Crash when closing ImHex with one or more view providers open 2025-02-04 09:35:26 +01:00
WerWolv
99a2dee7a2 build: Updated libromfs 2025-02-03 22:06:43 +01:00
WerWolv
c94265c77b build: Only add magic library dir in regular build 2025-02-03 21:48:13 +01:00
WerWolv
7ddfba1b4c build: Exclude more libraries from external plugin builds 2025-02-03 21:46:21 +01:00
WerWolv
9ecdd28eea build: Don't link against libcurl in external plugin builds 2025-02-03 21:43:57 +01:00
WerWolv
d8b36242f6 build: Don't set EXPORT_SYMBOLS when doing an external plugin build 2025-02-03 21:33:41 +01:00
WerWolv
3f470aabe9 fix: Compile errors 2025-02-03 21:11:48 +01:00
WerWolv
1e8dd54b3e build: Don't set -Wno-unused-result on MSVC 2025-02-03 20:51:47 +01:00
WerWolv
0a6681ccb7 impr: Remove dependencies on curl, mbedTLS and GLFW in the SDK 2025-02-03 20:50:11 +01:00
WerWolv
0140e24822 build: Fixed warning in miniaudio library 2025-02-03 16:05:40 +01:00
WerWolv
9fb38922ea impr: Disable main menu items for views that aren't selected right now 2025-02-02 22:32:24 +01:00
WerWolv
7752354598 impr: Make dark theme text slightly off-white 2025-02-02 21:48:12 +01:00
WerWolv
497670c4c3 fix: Don't apply backing scale factor twice to splash screen 2025-02-02 21:36:49 +01:00
WerWolv
84954cd2f1 build: Fixed more SDK errors 2025-02-02 21:22:42 +01:00
WerWolv
8b6eab401e fix: "Other Data Sources" welcome screen sub-window being too tall 2025-02-02 21:15:56 +01:00
WerWolv
71c11a5923 fix: Banner position being wrong while provider is loaded 2025-02-02 21:15:31 +01:00
WerWolv
f345edb252 fix: Banners not being part of the main viewport 2025-02-02 21:06:18 +01:00
WerWolv
be40fd9563 build: Apply flags correctly for imported libraries 2025-02-02 20:50:49 +01:00
WerWolv
5ee2ebfb4f build: Fix addXXXFlag functions for interface targets 2025-02-02 20:32:24 +01:00
WerWolv
cfa6b706a8 patterns: Updated pattern language 2025-02-02 20:32:06 +01:00
WerWolv
42f2a62d62 build: Make plugin library sdk path relative 2025-02-02 19:05:10 +01:00
WerWolv
41b6ef930a build: Fix MinGW build 2025-02-02 17:19:34 +01:00
WerWolv
948cbe0a9c build: Updated dependencies 2025-02-02 13:08:08 +01:00
WerWolv
18669f3230 build: Move back to upstream lunasvg 2025-02-02 12:14:32 +01:00
Tim Blume
4e9f944204 build: Install include folders of plugin libraries to SDK (#2074)
Partially fixes #2068 .

This assumes the headers are in "include" for all plugins - this is
necessary since the INCLUDES argument of add_imhex_plugin may contain
paths to third party libs, whose headers should not be copied.
To fix this I think it is necessary to add a second argument like
"PRIVATE_INCLUDES", which is included, but not installed.

With this it possible to append the ui plugin for example:
```
INCLUDES
        $ENV{IMHEX_SDK_PATH}/lib/plugins/ui/
```
and to link against it:
```    
LIBRARIES
        /usr/local/lib/imhex/plugins/ui.hexpluglib
```

In a follow-up in the CMake Template for plugins imho there should be
fixed, that:

 - you can include plugin includes relative to the SDK Path
- you can link plugins relative to the lib path + without the hexpluglib
or hexplug extension

---------

Co-authored-by: Tim Blume <git@3nd.io>
Co-authored-by: Nik <werwolv98@gmail.com>
2025-02-02 12:12:40 +01:00
WerWolv
fe18cbaa41 fix: Always properly jump to cursor position when scrolling with arrow keys
Fixes #1582
2025-02-02 12:06:34 +01:00
WerWolv
ed3712e1b9 fix: Shortcuts not working until a modal is opened 2025-02-02 12:00:59 +01:00
WerWolv
20dc4f31f0 impr: Show a loading spinner while providers are loading 2025-02-02 11:24:50 +01:00
WerWolv
19f9296a40 feat: Added blocking tasks that show a full-screen modal when active 2025-02-02 11:24:28 +01:00
WerWolv
06c019387c build: Fix most remaining warnings 2025-02-01 22:11:19 +01:00
WerWolv
645b43e9cc fix: Various MSVC warnings 2025-02-01 20:54:00 +01:00
WerWolv
ed37a3711f build: Fix extra comma 2025-02-01 20:23:02 +01:00
WerWolv
a3460de9dc build: Make VS CMake Preset do a 64 bit build 2025-02-01 20:20:42 +01:00
WerWolv
5084009d62 fix: Invalid iterator dereference when removing providers 2025-02-01 20:10:13 +01:00
WerWolv
e5c003d726 fix: Only use __declspec on with MSVC 2025-02-01 19:57:39 +01:00
WerWolv
327a02b87d fix: Plugins not having a proper entry point on MSVC 2025-02-01 19:14:15 +01:00
WerWolv
e9bf1a9f7a fix: Crash when no plugins were loaded 2025-02-01 18:08:47 +01:00
WerWolv
0c6fa768ea build: Fix building for 64bit with MSVC 2025-02-01 18:08:35 +01:00
WerWolv
483468a6c7 impr: Make WorkspaceManager internals static 2025-02-01 16:02:45 +01:00
WerWolv
8039ae1b90 build: Make ImHex fully compile with MSVC and Clang CL
This does NOT make ImHex work yet. However it can now be compiled
2025-02-01 15:13:13 +01:00
WerWolv
466b372d41 build: Added vcpkg manifest 2025-01-31 23:48:52 +01:00
WerWolv
3f6b5203ca fix: Further MSVC compile fixes 2025-01-31 23:48:38 +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
e603c75bd3 build: Updated dependencies 2025-01-31 19:40:58 +01:00
WerWolv
4f28f97141 git: Fix workflow indentation 2025-01-30 22:34:50 +01:00
WerWolv
d0b32e5224 git: Try creating dmg a few times again in case XProtect is being a bitch 2025-01-30 22:25:00 +01:00
WerWolv
2062a23347 patterns: Updated pattern language 2025-01-30 22:12:04 +01:00
WerWolv
8c9236a066 patterns: Updated pattern language 2025-01-30 21:31:14 +01:00
paxcut
2f981ef91e fix: Banners not scaling properly with font size (#2096)
The banner windows did not scale with the fonts resulting in cropped
text when font size was made bigger than normal.
fixed by ensuring the window is big enough and then making sure text is
centered in the y-axis.
2025-01-30 20:18:44 +01:00
WerWolv
6725c170ea build: Updated dependencies 2025-01-30 20:12:19 +01:00
WerWolv
c8cf6e7c08 build: Fix compile errors on platforms where sizeof(long double) > sizeof(unsigned long long) 2025-01-29 22:16:42 +01:00
Connor Gibson
e0b4acee12 build: Updated macOS compile instructions as Brewfile has moved (#2093)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
Brewfile has moved from `dist/Brewfile` to `dist/macOS/Brewfile`.

### Implementation description
Updated build instructions to reflect this previous change

### Screenshots
N/A

### Additional things
N/A
2025-01-29 21:38:47 +01:00
WerWolv
803ebe34ed build: Update for software defined 128 bit types 2025-01-29 21:37:41 +01:00
WerWolv
e981eff1e6 fix: Uninitialized buffers in resize operation 2025-01-29 18:39:19 +01:00
WerWolv
aee7a09b6c feat: Added new --select, --pattern and --debug-mode subcommands 2025-01-29 18:32:54 +01:00
WerWolv
e74e4e92a0 build: Updated libwolv 2025-01-29 18:32:35 +01:00
WerWolv
6dba15defd impr: Removed black border from splash screen bytes 2025-01-28 23:41:44 +01:00
WerWolv
fee7a16692 fix: Exception being thrown while loading projects
Fixes #2091
2025-01-28 23:23:31 +01:00
WerWolv
141030344b fix: Crash when certain pattern language exceptions were thrown
Fixes #2091
2025-01-28 23:23:08 +01:00
WerWolv
4fa9586206 impr: Added Russian language to WiX installer and ImHex Web 2025-01-28 20:55:10 +01:00
WerWolv
fbbc430b7c fix: Body text being displayed in response text field 2025-01-28 20:53:01 +01:00
WerWolv
bfc68c4d28 fix: Replace HTTP Requests text editors with input text boxes 2025-01-28 20:52:00 +01:00
WerWolv
53fc018ada fix: --pl subcommand not working correctly anymore 2025-01-28 19:47:20 +01:00
WerWolv
d45dd45720 fix: Windows system error messages not being encoded correctly 2025-01-28 19:33:31 +01:00
WerWolv
19a9786bbf impr: Make ImHex cli work more like other tools 2025-01-28 18:41:29 +01:00
WerWolv
b8caf41423 fix: Make sure splash screen is rendered consistently on all platforms 2025-01-28 18:38:20 +01:00
WerWolv
0b3866a56a fix: Wrong usage of windows icon texture 2025-01-27 22:35:27 +01:00
WerWolv
53a7577416 impr: Allow resizing of settings window 2025-01-27 22:20:15 +01:00
WerWolv
f5515417d6 fix: Message dispatching related build issues 2025-01-27 22:15:39 +01:00
WerWolv
24e7c2f3db fix: Make sure all textures are destroyed before glfw gets uninitialized 2025-01-27 22:10:30 +01:00
WerWolv
6e6c5bbc67 fix: Splash screen texture scaling 2025-01-27 21:20:59 +01:00
WerWolv
f4403ff480 impr: Make splash screen use SVG directly 2025-01-27 20:45:30 +01:00
WerWolv
098da20761 fix: Delete splash textures before destroying splash screen 2025-01-27 19:08:01 +01:00
WerWolv
ef2373e8c0 feat: Implement messaging support for Linux 2025-01-27 19:07:22 +01:00
WerWolv
b2c8ed17d5 feat: Added shortcut for opening settings 2025-01-26 22:41:20 +01:00
Nik
bb594a459f feat: Implemented macOS messaging support (#2088) 2025-01-26 18:50:19 +01:00
WerWolv
7340a30650 impr: Make scalable font the default 2025-01-26 14:26:57 +01:00
WerWolv
403104dda1 fix: Properly scale unifont glyphs 2025-01-26 14:21:17 +01:00
WerWolv
8334fbb236 fix: Properly apply backing scaling to pixel perfect default font 2025-01-26 14:18:20 +01:00
WerWolv
0a0323ce5d git: Run CI on feature branches 2025-01-26 13:42:19 +01:00
WerWolv
726d36ba3d git: Fix creation of ARM64 DMG trying to enter wrong path 2025-01-26 11:26:04 +01:00
WerWolv
8bb1521963 git: Fix ARM64 .app path 2025-01-26 10:54:26 +01:00
WerWolv
9457c1f2b9 git: Install ImageMagick so create-dmg can make a pretty volume icon 2025-01-26 10:45:26 +01:00
WerWolv
2b24330f9f build: Updated ImHex icons in MSI installer 2025-01-26 10:40:53 +01:00
WerWolv
9329170e59 git: Ignore missing signature when building DMG 2025-01-26 10:32:37 +01:00
WerWolv
98f3de828a git: Add create-dmg to PATH 2025-01-26 10:27:09 +01:00
WerWolv
3f38f42259 git: Produce nicer looking DMG file for macOS 2025-01-26 10:19:05 +01:00
WerWolv
058a8cdc15 fix: Missing <cstdlib> include 2025-01-26 09:22:53 +01:00
WerWolv
d0c1213ea0 fix: Crash on systems where XDG_SESSION_TYPE isn't defined 2025-01-25 23:30:00 +01:00
WerWolv
30967bac6d fix: Modifier keys not working correctly on X11 2025-01-25 23:24:56 +01:00
WerWolv
09c9bcb046 fix: Pattern data filter not working correctly without a compare value 2025-01-25 23:17:03 +01:00
WerWolv
93f1f5d076 impr: Better font scaling with larger backing scale factors 2025-01-25 22:27:59 +01:00
WerWolv
93e5d62782 fix: Web build scaling 2025-01-25 20:12:21 +01:00
Bananchiki
4d7021ece1 lang: Added Russian translation (#1964)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Description
This pull request introduces a complete Russian translation for ImHex,
ensuring that Russian-speaking users can navigate and utilize the
software in their native language. The translation covers all user
interface elements, menus, dialogs, and messages, providing a seamless
experience for Russian users.

### Testing
The translation has been thoroughly tested to ensure accuracy and
completeness. All translated text has been reviewed for grammatical
correctness and contextual appropriateness.

### Screenshots

![image](https://github.com/user-attachments/assets/455ca03d-0b33-45d2-9ed5-ddb404bd0728)

![image](https://github.com/user-attachments/assets/a7ebdb40-806f-43d9-ab36-deea730505c1)

![image](https://github.com/user-attachments/assets/29c5d21b-7443-4751-9129-e5fa054066d3)

Co-authored-by: Lemon4ksan <senya20151718@gmail.com>
2025-01-25 20:06:18 +01:00
WerWolv
f976988c75 impr: Try to detect backing scaling factor on the web build 2025-01-25 19:08:56 +01:00
WerWolv
1eee31fdbb fix: Debug mode only being enabled after everything has been initialized already 2025-01-25 16:54:16 +01:00
paxcut
048c483903 fix: Pattern Editor shortcuts not working correctly on different languages (#2085)
Fixes #2084 

Error in text editor prevented using shortcuts when language other than
English was chosen.

The code was mistakenly using localized name to test which window had
focus a execute the shortcut.

Fixed it by switching the name of the child window to the constant value
used to check the windows focused identity.
2025-01-25 16:34:27 +01:00
Wolf
b646ece14b impr: Refactor and restructure Event Manager (#2082)
### Problem description
This PR addresses issue #2013 that described a cluttered Event Manager.

This is a DX issue and should not impact the users whatsoever.

### Implementation description
The changes revolve around three main points:

1. the Event Manager (`event_manager.hpp`) was split into four
categories: GUI, Interaction, Lifecycle, and Provider, and two types:
Events, and Requests. This results in the following files:
    - `events_gui.hpp`
    - `events_interaction.hpp`
    - `events_lifecycle.hpp`
    - `events_provider.hpp`
    - `requests_gui.hpp`
    - `requests_interaction.hpp`
    - `requests_lifecycle.hpp`
    - `requests_provider.hpp`

2. Every event and request now has its own piece of documentation, with
a `@brief`, accompanied by a longer comment if needed, and gets its
`@param`s described.

3. The old `event_manager.hpp` import was removed and replaced by the
correct imports wherever needed, as to reduce spread of those files only
to where they are truly useful.

### Additional things
The commits have been split into (chrono-)logical steps:
- `feat`: split the Event Manager, and replace the imports
- `refactor`, `chore`: make various small changes to match the required
structure
- `docs`: add documentation for events and requests

Hopefully, this will help to review the PR.
*Note: Beware of very long rebuild times in between the commits, use
them sparingly! The Actions will ensure this PR builds anyways*

Closes #2013

---------

Signed-off-by: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com>
Co-authored-by: Nik <werwolv98@gmail.com>
2025-01-25 15:32:07 +00:00
WerWolv
35e8acd69d impr: Only enable font config Apply button when setting has changed 2025-01-25 15:50:52 +01:00
WerWolv
de4135d1ad fix: ID collision with multiple items of the same name in the Accept Pattern popup 2025-01-25 15:47:09 +01:00
WerWolv
a44959ce1b feat: Added option to enable debug features in release builds 2025-01-25 15:38:57 +01:00
WerWolv
f4bad0053a fix: Linking errors in the web build 2025-01-25 15:24:44 +01:00
WerWolv
26af5987a5 fix: Properly check if distro info exists before printing it 2025-01-25 15:24:25 +01:00
WerWolv
9cf3250751 impr: Replace GitBook AI garbage with simple search API 2025-01-24 22:31:49 +01:00
WerWolv
acc77205bb fix: Image visualizer data processor nodes not working
Fixes #2081
2025-01-24 21:36:29 +01:00
WerWolv
a6b4f62d75 fix: Opening files in existing instance not working 2025-01-23 19:22:40 +01:00
WerWolv
69c5d553b5 fix: Disable postprocessing shaders in Web version 2025-01-22 19:55:17 +01:00
WerWolv
637cdd7084 git: Only generate attestation on main repo 2025-01-22 19:19:19 +01:00
WerWolv
8978e193db impr: Better OS-specific handling of system exceptions 2025-01-21 23:28:22 +01:00
WerWolv
242b100aa3 fix: Properly detect Windows 10 2025-01-20 21:45:53 +01:00
WerWolv
3a888d48df fix: ID collision with color inline visualizer 2025-01-20 21:25:00 +01:00
WerWolv
721de39dbb impr: Make icon context menu use MenuItemEx for its icons 2025-01-20 21:24:49 +01:00
WerWolv
07e29f2030 feat: Added support for OpenGL post processing shaders 2025-01-20 21:24:25 +01:00
WerWolv
c117d9b3e5 fix: Crash when changing DPI 2025-01-19 23:07:53 +01:00
WerWolv
16eae89151 fix: Save/Save As toolbar items being missing by default 2025-01-19 21:49:34 +01:00
WerWolv
95cb6d8ee6 patterns: Updated pattern language 2025-01-19 19:23:48 +01:00
WerWolv
af27c09204 fix: I guess we can still not use std::views::enumerate 2025-01-19 17:54:18 +01:00
WerWolv
5e3532267c fix: Missing glfw include 2025-01-19 17:52:32 +01:00
WerWolv
7c0331df65 impr: Hide window on macOS when close button is pressed 2025-01-19 17:04:31 +01:00
WerWolv
04ab87cd8e patterns: Updated pattern language 2025-01-19 14:42:02 +01:00
WerWolv
91f5e84250 impr: Don't insert a new line at the end of settings pages 2025-01-19 10:56:00 +01:00
WerWolv
b1edd95ebc impr: Shortcut code cleanup 2025-01-19 10:55:27 +01:00
WerWolv
758738da5c fix: Default font not being the default font 2025-01-19 10:34:54 +01:00
WerWolv
41c8be275b fix: Assert when selecting selectable text 2025-01-19 00:26:26 +01:00
WerWolv
117eb1e2a7 feat: Added more granular font settings
Fixes #1260
2025-01-18 23:34:43 +01:00
WerWolv
3129d6e8fd impr: Simplified custom font selection 2025-01-18 19:03:55 +01:00
WerWolv
2ba7db184b build: Fix favicon transparency for ImHex Web 2025-01-18 17:47:36 +01:00
WerWolv
2cb0df4080 build: Properly optimize web build 2025-01-18 16:53:11 +01:00
WerWolv
3adc2c44e6 fix: Font customization not unlocking correctly 2025-01-18 16:05:11 +01:00
WerWolv
6d3ff64894 fix: ImHex using a lot of CPU 2025-01-18 14:57:06 +01:00
WerWolv
cf84ad6196 fix: Added back old constructor for Widgets::DropDown 2025-01-18 14:56:53 +01:00
WerWolv
6259190ad9 impr: Make localization fall back to english if it doesn't exist 2025-01-18 14:40:10 +01:00
WerWolv
181be1a58e fix: Missing paste behaviour option translations 2025-01-18 14:36:31 +01:00
WerWolv
771e191f28 fix: Windows icon not being transparent anymore 2025-01-18 14:11:49 +01:00
WerWolv
d4d6893eb3 git: Make sure PORTABLE flag is created correctly 2025-01-18 13:58:20 +01:00
WerWolv
9e75562662 build: Fix RPM icon path 2025-01-18 13:45:57 +01:00
WerWolv
2b3168163b git: Extract PDBs for for portable version properly 2025-01-18 13:45:32 +01:00
WerWolv
252c06eb12 build: Extract PDBs from build files 2025-01-18 13:26:12 +01:00
WerWolv
2a51d8169a build: Move icon to correct location 2025-01-18 13:18:33 +01:00
WerWolv
7405c4b411 build: Updated disassembler library 2025-01-18 13:06:31 +01:00
WerWolv
309ae7b619 build: Fixed disassembler library git messup 2025-01-18 12:38:20 +01:00
WerWolv
64ef56a0df git: Fixed Windows PDB extraction process 2025-01-18 12:04:46 +01:00
WerWolv
fbfe7b0d25 impr: Unlock frame rate for the first few seconds after startup 2025-01-18 11:58:49 +01:00
WerWolv
8c7e1a3b2d impr: Replace icon with Papyrus icon.
Special thanks to @varlesh and @morganist
See https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/issues/3909
2025-01-18 11:55:17 +01:00
WerWolv
bf249cdafe build: Updated disassembler library 2025-01-18 11:07:28 +01:00
WerWolv
59ba6f50cc build: Disable install targets of libfmt to fix Windows WIX installer 2025-01-18 11:03:51 +01:00
WerWolv
8d6e7c7d44 fix: Decompressor compile errors 2025-01-18 10:28:20 +01:00
WerWolv
52934ae166 feat: Make decompress functions return number of read bytes 2025-01-18 10:14:47 +01:00
WerWolv
56c4f2aa47 fix: ID collision with multiple banners on screen 2025-01-17 23:12:09 +01:00
WerWolv
a1d8cbd7ba fix: Properly update window position during resize 2025-01-17 23:11:53 +01:00
Nik
63a219a32b build: Added ARM64 AppImage build (#2073) 2025-01-17 22:55:41 +01:00
WerWolv
14fb256a6a build: Updated dependencies 2025-01-17 21:09:56 +01:00
WerWolv
95df7a23c3 build: Add new SDK files to Fedora package 2025-01-17 20:41:49 +01:00
WerWolv
bb17690cf5 build: Fix cv2pdb extraction errors 2025-01-17 19:56:25 +01:00
WerWolv
a943b02e43 build: Make sure unzip is installed on the CI 2025-01-17 19:50:41 +01:00
WerWolv
199f78347f build: Move PDB extraction to CI 2025-01-17 19:44:33 +01:00
WerWolv
d3d9a42d57 build: Added library plugin files to SDK 2025-01-17 19:32:52 +01:00
WerWolv
1fa45a8c84 fix: Replace bookmark comment Text Editor with multi-line text input
Closes #2056, Closes #2055
2025-01-17 17:28:13 +01:00
WerWolv
0b6316ea23 fix: Added back deleted variable to make web build work again 2025-01-17 17:26:46 +01:00
WerWolv
466a843263 build: Fix backwards compat with older cmake versions 2025-01-17 13:01:40 +01:00
WerWolv
b6ade8b101 fix: Shortcuts not working in detached windows 2025-01-17 12:39:55 +01:00
WerWolv
ff66b97e90 build: Get rid of some cmake warnings 2025-01-17 12:39:39 +01:00
WerWolv
c604ec8fb9 patterns: Updated pattern language 2025-01-16 21:23:22 +01:00
WerWolv
7564651dd5 patterns: Updated pattern language 2025-01-16 19:52:45 +01:00
WerWolv
cad17ddefd fix: Banners being misplaced on macOS 2025-01-16 19:27:22 +01:00
WerWolv
25d2f209e5 patterns: Updated pattern language 2025-01-16 19:15:39 +01:00
WerWolv
8d660c3ffe fix: Missing <numbers> include 2025-01-16 17:37:51 +01:00
WerWolv
209055d0b0 impr: Show a banner about degraded performance in debug mode 2025-01-16 17:09:17 +01:00
WerWolv
599b55965a impr: Improve the shadow of banners 2025-01-16 17:09:04 +01:00
WerWolv
69a9af5322 patterns: Added error pattern to pattern drawer 2025-01-16 17:08:49 +01:00
WerWolv
0303cd0ad0 patterns: Updated pattern language 2025-01-16 17:08:23 +01:00
WerWolv
8eb7e9fb05 fix: ID collision in provider data information section 2025-01-15 20:34:25 +01:00
WerWolv
6a1de5fc4e build: Updated ImGui to v1.91.7 2025-01-15 19:52:24 +01:00
WerWolv
a4af55cb66 build: Rename imgui_custom to imgui_backend 2025-01-15 19:52:19 +01:00
paxcut
1e17422f5e fix: Pattern Editor Find and Replace history (#2064)
The previous implementation seems to have been broken by Imgui updates. 

There is also some improvement in focus handling and also a bug in
replace where the last match was not being replaced has been fixed.

Fixed also slowdown in large files when only one char was typed by not
searching until enter has been pressed.

Added key repetitions for enter and arrows to be able to handle large
number of matches and fixed some formatting problems.
2025-01-15 19:40:12 +01:00
paxcut
8abaafab79 fix: Crash in 3D Visualizer, improved error messages (#2062)
The recently added data checks allowed invalid sized vertex arrays to be
used as if they were valid making ImHex crash.

Moved all the error messages into localization strings for translation.
2025-01-15 19:38:38 +01:00
WerWolv
71e1465524 fix: Image visualizer node trying to create texture in non-main thread 2025-01-15 19:34:58 +01:00
WerWolv
3d2ea3753b fix: Missing <clocale> include 2025-01-15 19:31:33 +01:00
Nik
88530eff8b git: Updated screenshots in readme 2025-01-15 18:31:41 +01:00
WerWolv
df3decf71b build: Updated libwolv 2025-01-15 18:08:45 +01:00
WerWolv
565ee4cb2d fix: Banner positions with multi-viewports enabled 2025-01-15 18:08:05 +01:00
WerWolv
40fc325ba9 fix: Disable bogus Keypad to function key conversions on macOS 2025-01-15 17:59:57 +01:00
WerWolv
6aca16102d impr: Move up the right column on the welcome screen to avoid a scrollbar at default size 2025-01-15 17:54:35 +01:00
WerWolv
cb11b57ab1 feat: Added banners, replace some modals with them 2025-01-15 17:54:07 +01:00
WerWolv
d504937d50 fix: Empty regions in Intel Hex and Motorola SREC files not being displayed correctly 2025-01-14 23:54:07 +01:00
WerWolv
6bfdb7ca4e fix: Make sure provider switch buttons and close button don't overlap 2025-01-14 22:10:58 +01:00
WerWolv
e1637824c6 impr: Make strings in the data information view selectable and copyable 2025-01-14 22:05:29 +01:00
WerWolv
e36f2f2bcb fix: Replace "data processor" text with "data inspector" for the custom data inspector row hint 2025-01-14 17:51:26 +01:00
WerWolv
1a54e08f11 fix: Remove constexpr from functions that really aren't constexpr 2025-01-14 17:50:48 +01:00
WerWolv
ecc86ee429 fix: ImNodes not being deinitialized correctly 2025-01-14 17:50:29 +01:00
WerWolv
185a593bc2 fix: AllowWhileTyping shortcuts only working while typing 2025-01-14 17:50:06 +01:00
WerWolv
4a916ebb89 feat: Added New File option to the GNOME launcher and a --new cli option 2025-01-14 17:49:48 +01:00
WerWolv
1c305ca762 fix: Icons still following custom font size when using default font 2025-01-13 22:34:30 +01:00
WerWolv
17fff56fa0 impr: Make sure Windows title icon is scaled correctly 2025-01-13 22:31:24 +01:00
WerWolv
ec1b1c2b7d impr: More constexpr 2025-01-13 22:31:06 +01:00
WerWolv
7bae22f56f fix: Font selector still saying "Custom Font Path" 2025-01-13 22:20:53 +01:00
WerWolv
21e5eeef16 impr: Reduce default font size slightly, adjust element sizes on welcome screen 2025-01-13 22:17:14 +01:00
WerWolv
bf5eea80f6 impr: Make font size setting use points instead of pixels 2025-01-13 22:04:55 +01:00
WerWolv
9f9a6d9827 impr: Move Jetbrains mono into regular font selector, allow it to be scaled 2025-01-13 22:04:44 +01:00
WerWolv
ae622e6d75 git: Merge WebAssembly build into main build artifacts script, add to releases 2025-01-12 23:08:09 +01:00
WerWolv
68fbff631f git: Fix github pages artifact name 2025-01-12 22:50:39 +01:00
WerWolv
6cdce75095 git: Upload artifact for ImHex Web build 2025-01-12 22:03:50 +01:00
WerWolv
f699e76c56 build: Fix comment causing issues with docker 2025-01-11 21:41:14 +01:00
WerWolv
a729329cd4 impr: Added missing [[nodiscard]]s 2025-01-11 21:40:42 +01:00
WerWolv
d5020ce9bb impr: Rename Jump To option to Follow Selection to avoid confusion with Go To 2025-01-11 21:40:26 +01:00
WerWolv
126868c251 fix: Hang when filtering for a large number of items in the pattern data view 2025-01-11 17:22:53 +01:00
WerWolv
b206e9fc95 fix: Copy-paste error with "Extend selection left" shortcut name 2025-01-11 16:42:00 +01:00
WerWolv
4b6ff68464 git: Fixed CI permissions 2025-01-11 16:28:29 +01:00
WerWolv
b23a0febb5 git: Added build provenance attestation for most artifacts 2025-01-11 16:17:27 +01:00
WerWolv
05ad547341 git: Use zstd to compress .deb builds 2025-01-11 15:57:42 +01:00
paxcut
f10af882a7 fix: Text Editor find option jumping to the wrong location (#2060)
After successfully finding matches and setting the cursor to them, the
screen would jump to the original window location upon closing the
window.

The error was caused by the wrong assumption that the scroll location
should be restored when window is closed. Instead, the right amount of
scrolling needs to be calculated to account for the window no longer
covering part of the text editor. Unused variable was discarded.

Another unrelated error is that the history of search names cannot be
accessed which will be addressed at a later PR.
2025-01-09 18:39:00 +01:00
WerWolv
98f32ebcad impr: Made interactive help api easier to use 2025-01-09 18:34:39 +01:00
WerWolv
e2c302836f feat: Added support for scanning binaries for UTF-8 strings 2025-01-09 18:33:45 +01:00
WerWolv
f1d9642cf6 impr: Better color picker widgets in the settings 2025-01-07 21:46:26 +01:00
WerWolv
5c58e5b545 fix: Selection highlight color setting not working
Fixes #2059
2025-01-07 18:09:56 +01:00
WerWolv
803cb335e1 feat: Added interface accent colors 2025-01-07 00:06:52 +01:00
WerWolv
ae4dde8255 impr: Unlock frame rate in more cases to make the UI feel more responsive 2025-01-06 20:34:00 +01:00
WerWolv
cb34f68b1b patterns: Updated pattern language 2025-01-06 20:15:21 +01:00
WerWolv
96ef983cfb fix: ASCII column not getting highlighted anymore 2025-01-06 20:14:27 +01:00
WerWolv
d8c3d67dfe build: Disable romfs compression in web build 2025-01-05 21:25:28 +01:00
WerWolv
5de5153663 impr: Simplify hex editor class API 2025-01-05 21:24:13 +01:00
WerWolv
1e747b6831 patterns: Updated pattern language 2025-01-05 19:18:46 +01:00
WerWolv
fbe9d16073 build: Updated libromfs 2025-01-05 17:52:04 +01:00
WerWolv
d02c0073a0 build: Ignore pdb copy file errors 2025-01-05 15:27:54 +01:00
WerWolv
1090b9879c build: Make pdb copy operation happen at install time 2025-01-05 15:20:03 +01:00
WerWolv
5a6af976cd build: Rename output pdb file if necessary 2025-01-05 15:14:25 +01:00
WerWolv
55e39a5d30 build: Fix dwarf stripping logic 2025-01-05 15:00:45 +01:00
WerWolv
c9b1ddfb59 build: Updated libromfs 2025-01-05 14:56:16 +01:00
WerWolv
f7dd696ffc build: Silence stupid brew errors 2025-01-05 14:51:03 +01:00
WerWolv
70f210ac5d build: Updated libromfs 2025-01-05 14:37:39 +01:00
WerWolv
cad1c11f8b build: Updated dependencies 2025-01-05 14:17:54 +01:00
WerWolv
f7fa305e82 build: Generate pdb file for libpl, significantly reduce binary size 2025-01-05 12:06:32 +01:00
WerWolv
f96c51e854 impr: Added shortcut for Copy as -> Custom Encoding 2025-01-05 11:12:56 +01:00
WerWolv
c19705d3e5 git: Try to silence brew error messages again 2025-01-05 10:42:29 +01:00
WerWolv
1190511994 impr: Cleanup frame rate unlocking code 2025-01-04 23:43:10 +01:00
WerWolv
69ee7ef63c build: Updated libwolv 2025-01-04 23:42:56 +01:00
WerWolv
fc95e5a9a8 impr: Unlock frame rate when scrolling or focusing 2025-01-04 22:00:26 +01:00
WerWolv
6ecc495d43 feat: Added visibility toggle to hide bookmark highlighting 2025-01-04 21:40:18 +01:00
WerWolv
6e861001cf impr: Allow all highlights to overlap each other 2025-01-04 21:40:03 +01:00
WerWolv
c56af08c7e impr: Allow highlights of multiple overlapping bookmarks to render 2025-01-04 20:46:56 +01:00
WerWolv
e68abefe48 impr: Use info icon for more help hovers 2025-01-04 19:21:22 +01:00
WerWolv
fd0635cb82 fix: Hex editor right click menu not working on macOS 2025-01-04 19:08:37 +01:00
WerWolv
baa3cfb354 fix: User folders being added twice 2025-01-04 18:30:57 +01:00
iTrooz
aea9bab853 build: Make MacOS arm64 build use clang 19 (#2050) 2025-01-04 18:10:48 +01:00
WerWolv
48de609f53 impr: Added telemetry about whether ImHex runs on a corporate machine 2025-01-04 16:11:35 +01:00
WerWolv
71f4f87288 impr: Make sure init tasks always get executed 2025-01-04 16:11:05 +01:00
WerWolv
48b202c56b patterns: Updated pattern language 2025-01-04 15:38:20 +01:00
Nik
d975019a7b impr: Revamp frame rate limiting system to make ImHex feel less laggy in certain cases (#2049) 2025-01-04 15:35:19 +01:00
Nik
6009b5013b feat: Let ImHex use the native menu bar on macOS (#2048) 2025-01-04 15:35:06 +01:00
WerWolv
24979d7fbd impr: Other Providers -> Other Data Sources 2025-01-04 14:06:03 +01:00
WerWolv
b4bf42e377 fix: Unit test build error due to changed Provider::getTypeName() signature 2025-01-04 13:57:48 +01:00
WerWolv
f94819351a impr: Make maximum in-memory file size setting easier to use. Bump value to 512MiB 2025-01-04 13:56:20 +01:00
WerWolv
8da69c11d9 impr: Remove the word "Provider" from places where it doesn't fit 2025-01-04 13:28:35 +01:00
WerWolv
635a825095 fix: Signed/Unsigned comparison error 2025-01-04 13:03:38 +01:00
WerWolv
bbffdbf56f feat: Allow #pragma magic to index from the end of the data with negative addresses
Closes #2047
2025-01-04 12:49:14 +01:00
WerWolv
1c30533d19 fix: Off-by-one when calculating hashes of selected regions
Fixes #2046
2025-01-04 00:15:35 +01:00
WerWolv
dcd80fe6ad impr: Properly scale window on wayland 2025-01-03 15:09:06 +01:00
WerWolv
525ab8d945 fix: Settings not being saved correctly anymore 2025-01-03 14:07:09 +01:00
WerWolv
d8fb3f526a fix: Shortcut migration not working correctly in some cases
Fixes #2045
2025-01-03 10:16:22 +01:00
WerWolv
a55df1d111 fix: Exception being thrown when custom disassembler folders didn't exist 2025-01-03 00:15:52 +01:00
WerWolv
2cf32ba38d fix: Default smooth font not being scaled correctly 2025-01-03 00:15:28 +01:00
AlexGuo1998
c82907153e fix: Set LZMA decompressor memory limit to 1GiB (#2044)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->

See #2033 (`hex::dec::lzma_decompress` reports an error when
decompressing a small buffer).

### Implementation description
<!-- Explain what you did to correct the problem -->

Set the LZMA decompressor memory limit to 1GiB fixed. Print a warning
when exceeded, and abort with returning `false`.

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

Normal result when decompressing a small buffer


![image](https://github.com/user-attachments/assets/5b9e6b07-464e-41f6-bdc7-f5b1cd351069)

Warning message when `memlimit` is exceeded: (Set to 64B here for a
demo)
> W: lzma_decompress memory usage 1114168 bytes would exceed the limit
(64 bytes), aborting


![image](https://github.com/user-attachments/assets/04abf3ef-1d29-4846-bb41-214695c7d09c)

### Additional things
<!-- Anything else you would like to say -->

Is the warning wording OK? I'm not a native English speaker so please
change it if you want to.
2025-01-02 08:42:28 +00:00
WerWolv
165403da67 fix: ImHex freezing on AMD GPUs when resizing
Fixes #1842
2025-01-01 20:39:12 +01:00
WerWolv
0e4d94946e fix: Disable recent files on web build since they can't work there 2025-01-01 17:08:31 +01:00
WerWolv
9f9c5abf35 impr: Prevent window from being moved while hovering over items on macOS 2025-01-01 16:45:11 +01:00
WerWolv
6a3b10111f feat: Highlight main menu item when using a shortcut 2025-01-01 16:19:38 +01:00
WerWolv
0a55f4bf83 patterns: Updated pattern language
Fixes #2042
2025-01-01 11:36:04 +01:00
WerWolv
493d66d991 fix: Crash when using hex editor when provider == nullptr 2024-12-31 21:30:05 +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
c853349b78 impr: Force reset window decoration to expected value after exiting full screen mode 2024-12-31 21:04:09 +01:00
WerWolv
ee555e0da9 fix: Make sure WM_NCCALCSIZE never tries to sleep a negative amount of time
#1842
2024-12-31 18:06:31 +01:00
WerWolv
3dec4cc698 fix: Signed/Unsigned integer compare 2024-12-31 17:21:37 +01:00
WerWolv
d7b2b94cec impr: Reduce jittering when changing the number of hex columns 2024-12-31 17:04:32 +01:00
WerWolv
c9e88586aa feat: Added option to fit hex columns to screen width 2024-12-31 11:35:09 +01:00
WerWolv
1d641504b1 fix: Format string issues 2024-12-31 10:01:01 +01:00
WerWolv
655e068b9b impr: Added changed data information to diff view table 2024-12-31 00:47:32 +01:00
WerWolv
67a9f314cc impr: Added icons to more context menus 2024-12-31 00:45:47 +01:00
WerWolv
ff2b58e8a3 fix: Copy paste errors 2024-12-30 23:58:34 +01:00
WerWolv
a1482cb40e fix: Tooltips not being hidden when disabling hex editor highlights 2024-12-30 23:45:48 +01:00
WerWolv
89111059f9 feat: Added setting to disable hex editor highlights entirely 2024-12-30 23:24:59 +01:00
WerWolv
0ae823716a feat: Added a preview to the Edit -> Copy as options
Closes #2026
2024-12-30 23:16:11 +01:00
WerWolv
dab3f722e8 feat: Added "Jump to address" option to data inspector row context menu 2024-12-30 22:32:06 +01:00
WerWolv
0dc1af0747 feat: Added option to change radix of numbers in hex editor view 2024-12-30 21:00:43 +01:00
WerWolv
021206e052 impr: Added icons to pattern editor context menu 2024-12-30 12:18:55 +01:00
WerWolv
cb09cf3734 feat: Added context menu and next/previous buttons to the data inspector 2024-12-30 12:07:21 +01:00
WerWolv
f0525d6463 fix: Building issues with the web build 2024-12-30 10:10:38 +01:00
WerWolv
e22424ffa4 fix: Settings not being saved correctly on the web version 2024-12-29 23:53:23 +01:00
WerWolv
6e666c64e8 patterns: Updated pattern language 2024-12-29 22:42:32 +01:00
WerWolv
5f5f6ac539 feat: Added option to move selection back to hex editor footer
Closes #2024
2024-12-29 21:08:08 +01:00
WerWolv
3024c79f4f impr: Allow the favorite column in the pattern data view to be hidden 2024-12-29 20:38:51 +01:00
WerWolv
ba96d86dc2 impr: Properly align favorite icons inside of the buttons in the pattern drawer 2024-12-29 20:38:25 +01:00
WerWolv
40ec7195d1 patterns: Updated pattern language 2024-12-29 15:20:57 +01:00
WerWolv
f10dfa0c20 patterns: Updated pattern language 2024-12-29 14:40:51 +01:00
WerWolv
6a5473f6fe impr: Moved Windows DPI awareness to manifest file, added detached console allocation
Closes #1543
2024-12-28 23:47:42 +01:00
WerWolv
f79de6fbe8 fix: Web build not starting fully anymore 2024-12-28 22:48:06 +01:00
Nik
ec4ee3132b git: Added note about launching assertion failures when launching the AppImage (#2038) 2024-12-28 22:31:34 +01:00
WerWolv
1298f2b688 impr: Refactor previous commits to work with other environments too 2024-12-28 21:37:45 +01:00
WerWolv
534a2f1d28 impr: Apply framebuffer scaling to SVGs as well 2024-12-28 20:52:49 +01:00
WerWolv
c8e95cf3c3 impr: Keep default font at whole-integer sizes 2024-12-28 20:46:26 +01:00
WerWolv
c4918a963c fix: Default font not being scaled on macOS 2024-12-28 20:45:12 +01:00
WerWolv
bf6f738d2e impr: Make text look super pretty on macOS finally 2024-12-28 20:42:05 +01:00
Nik
1605904eb1 git: Updated more runners to Ubuntu 24.04 2024-12-28 16:49:33 +01:00
Nik
138517f116 git: Updated system requirements and compile info in the readme 2024-12-28 16:48:32 +01:00
WerWolv
d4a4cb2e80 fix: Crash when providing invalid version string to semantic version class
Fixes #2036
2024-12-28 15:59:13 +01:00
WerWolv
9a9dc328e3 build: Switch to custom lunasvg repo to allow offline builds 2024-12-28 13:39:07 +01:00
WerWolv
50eea0a4f1 impr: Replace Firacode with JetbrainsMono font 2024-12-28 12:43:34 +01:00
WerWolv
528a8b5b46 fix: Exception being thrown when getting version parts from invalid version 2024-12-28 11:45:05 +01:00
WerWolv
0db0bc53fa revert: Make pattern editor scroll bar look more like all other scrollbars 2024-12-28 00:39:10 +01:00
WerWolv
0297c267e9 impr: Display "ImHex" in title bar when null provider is open 2024-12-27 23:56:14 +01:00
WerWolv
5af85f24f6 impr: Allow command palette to be closed by clicking on the menu bar 2024-12-27 23:53:55 +01:00
WerWolv
5110a7578e fix: Rendering issues with text editor in bookmark view 2024-12-27 23:36:21 +01:00
WerWolv
5af28670f0 fix: Ctrl sometimes getting stuck when pressing ALT GR and other keys at the same time
#2019
2024-12-27 23:15:20 +01:00
WerWolv
efa2b781dd impr: Better create hash popup size 2024-12-27 23:14:39 +01:00
WerWolv
979f151181 fix: Don't show library plugins in --plugins subcommand 2024-12-27 20:06:17 +01:00
WerWolv
6f125f18c3 impr: Make pattern editor scroll bar look more like all other scrollbars 2024-12-27 20:01:00 +01:00
WerWolv
edba7051f0 impr: Make interactive tutorials select windows when they're highlighted 2024-12-27 19:41:45 +01:00
WerWolv
fa1ae8d746 fix: Tutorial highlights not working anymore correctly 2024-12-27 18:28:22 +01:00
WerWolv
a476617432 build: Fix remaining build issues 2024-12-27 00:02:37 +01:00
WerWolv
ffac13bfef disasm: Updated disassembler library 2024-12-26 23:28:38 +01:00
WerWolv
f877bf21ba fix: Warning on macOS about wrong format argument 2024-12-26 23:01:19 +01:00
WerWolv
4bc4882b1f disasm: Updated disassembler library 2024-12-26 23:00:59 +01:00
WerWolv
084c17dc26 fix: Missing endian setting in ARM64 disassembler 2024-12-26 22:39:57 +01:00
WerWolv
26c39d6822 fix: ImGui_ImplGlfw_InstallEmscriptenCanvasResizeCallback -> ImGui_ImplGlfw_InstallEmscriptenCallbacks 2024-12-26 20:19:55 +01:00
WerWolv
aefc173227 fix: Wrong --reset-settings subcommand description 2024-12-26 20:05:07 +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
f11205bba7 build: Updated more dependencies 2024-12-26 14:41:43 +01:00
WerWolv
72d9c5019c build: Updated dependencies 2024-12-26 14:30:52 +01:00
WerWolv
58d66e3e97 fix: Added migration routine to fix shortcuts 2024-12-26 14:01:54 +01:00
WerWolv
43c88a2fab feat: Added system to handle version migrations 2024-12-26 14:01:46 +01:00
paxcut
9ce64ec6e1 fix: Pattern Editor console scroll jumping. (#2029)
Some issues related to the padding added to scroll past the end for
console that has padding added.
Added a shortcut to scroll editors one pixel at a time.
Fixed whole lines always drawn at the top even if scroll value is chosen
so that only a portion of the top line is visible. This caused errors in
horizontal scrolling.
Fixed Ctrl-F Ctrl-G and Ctrl-H messing the editor display. 
Fixed the end of the line could not be clicked with mouse 
Fixed line numbers and their lines could be displayed at different
heights.
Made numbers that represented lines floats instead of integers to allow
partial line display.
2024-12-25 18:51:58 +01:00
WerWolv
c749d6a7dc fix: Disable ImGui assert that causes random crashes on resize 2024-12-25 18:49:50 +01:00
WerWolv
f3e6d35c98 build: Updated ImGui glfw backend 2024-12-25 18:44:43 +01:00
WerWolv
0be539b8a5 feat: Added option to copy data as escaped string
#2026
2024-12-25 16:45:34 +01:00
WerWolv
0454a369e5 fix: Crashes when disassembling data
Fixes #2025
2024-12-25 16:36:53 +01:00
WerWolv
010025cbfa fix: Wrong localStorage key for achievements 2024-12-25 16:21:38 +01:00
WerWolv
61cae0a9f8 fix: Missing emscripten include 2024-12-25 16:19:50 +01:00
WerWolv
9e83d9e68c fix: Disable browser ctrl + S in web build 2024-12-25 16:17:51 +01:00
WerWolv
248acd5e26 fix: Properly save achievements in web version 2024-12-25 16:17:33 +01:00
WerWolv
42c1f5601a fix: Saving files in web version not working correctly 2024-12-25 15:57:54 +01:00
WerWolv
9c1a673047 impr: Force update all installed content store items after an update 2024-12-25 14:29:41 +01:00
WerWolv
99b90f90ac fix: Unused variable in wasm build 2024-12-25 13:03:55 +01:00
WerWolv
6ead8d8b49 fix: Certain shortcuts not being captured by ImHex Web 2024-12-25 12:36:06 +01:00
WerWolv
9b12232e9f revert: Broken fix for cursor not being set at end of line 2024-12-25 01:41:50 +01:00
WerWolv
c1ed1baaad fix: Shortcuts not working correctly in Web build 2024-12-25 01:34:11 +01:00
WerWolv
ab34312089 fix: Clicking past end of line in text editor putting cursor before last character 2024-12-25 01:33:41 +01:00
WerWolv
a25d92fbb7 build: Bumped version to 1.37.0.WIP 2024-12-25 01:33:36 +01:00
WerWolv
6005af1595 build: Bumped version to 1.36.0 2024-12-24 13:43:04 +01:00
WerWolv
9a4329807a patterns: Updated pattern language 2024-12-24 13:07:26 +01:00
WerWolv
8e01da4c12 lang: Fixed settings language string in hashes view 2024-12-24 13:06:38 +01:00
WerWolv
eb8ea520c7 build: Make ImGui use old CRC algorithm 2024-12-24 11:09:45 +01:00
WerWolv
512fcd361b impr: Modernize the disassembler, hashes and yara view 2024-12-24 10:57:09 +01:00
WerWolv
aad6f6bcbe build: Updated ImGui to v1.91.6 2024-12-24 00:37:04 +01:00
WerWolv
0af21505d7 git: Add retry mechanism for creating dmg on x86 mac 2024-12-24 00:00:22 +01:00
WerWolv
2ae69e8e72 feat: Allow command palette to work with previous results 2024-12-23 23:42:45 +01:00
WerWolv
9274fac8e1 build: Updated libwolv
Fixes #2007
2024-12-23 23:24:38 +01:00
WerWolv
e2f82c60e6 fix: Crash when using text editor as last item in a window 2024-12-23 23:17:19 +01:00
WerWolv
bfddf24204 impr: Added hints to various input fields 2024-12-23 23:16:55 +01:00
WerWolv
382599dcf6 fix: Better icon text input width calculation 2024-12-23 23:16:35 +01:00
WerWolv
5f2c07f2d8 fix: Icon text inputs not being the same length as other items 2024-12-23 21:48:47 +01:00
WerWolv
914024c0b5 impr: Added note about adding new data inspector row 2024-12-23 21:47:16 +01:00
WerWolv
c5d3387962 impr: Replaced centered text notes with overlays 2024-12-23 21:30:31 +01:00
WerWolv
7cc99c6fc9 impr: Added better notes to the settings tabs in the pattern editor view 2024-12-23 21:26:22 +01:00
WerWolv
a29b502a33 impr: Made pattern editor resize separator taller 2024-12-23 20:15:50 +01:00
paxcut
20cb74364f fix: Jumpy text editor scrolling (#2023)
Two major improvements:
1) see through scrollbars when not hovered.
2) un-scrollable line numbers.

Also enlarged display region by eliminating padding. There is still a
problem with lines jumping when the scrollbar is dragged but it is
limited to one line and probably due to floating point error for scroll
bar number. It is much less noticeable than the previous jumping which
could involve several pages.

---------

Co-authored-by: WerWolv <werwolv98@gmail.com>
2024-12-23 20:14:42 +01:00
WerWolv
1c5a50c8d8 impr: Added better file open error messages to the file provider 2024-12-23 14:07:35 +01:00
WerWolv
470523cc86 fix: Jittery scrolling in Text Editor 2024-12-23 11:44:34 +01:00
WerWolv
f6bc3d4650 impr: Replace more assert() calls with IM_ASSERT() 2024-12-23 11:22:20 +01:00
WerWolv
41b1228d31 fix: Make sure all text editor members are correctly initialized 2024-12-23 11:21:39 +01:00
paxcut
2cb4462274 impr: Better top margin handling for text editor. (#2021)
The top margin changes when popups block some portion on the screen.
Previously it was implemented adding blank lines at the bottom which
created problems if the windows was scrolled all the way to the bottom
and the popups were issued. The newer implementation doesn't use spaces
and simply resets the top of the window to be higher making the popup
interaction with the window more natural (no text disappears on the
lines the popup overlaps the text). changes can be identified form the
variables mTopMargin,mOldTopMargin and mNewTopMargin.

Unfortunately those changes revealed problems in cursor navigation that
needed to be addressed. Namely, the window will scroll up and down on
the line before last/second line at the top and similar problems for the
left and right. Those changes correspond to the function
EnsureCUrsorVisible()

Fixing those reveled yet more problems with scrolling past the end of
the file using the keyboard which required adding some more variables
and functions to support the correct handling, You find those changes in
the function MoveDown.

I also renamed some variables that had the wrong casing and fixed the
pasting but that is missing one line.
2024-12-23 10:35:53 +01:00
WerWolv
810cd40ccd impr: Replace strerror with C++ functions 2024-12-23 01:42:06 +01:00
WerWolv
f931beb49a impr: Make inserting bytes at the start of the file with insert mode work better 2024-12-23 01:33:52 +01:00
WerWolv
1c3dfc9b2f fix: ID collision in Jump To menu 2024-12-23 01:00:58 +01:00
WerWolv
a1d4545e29 fix: Don't allow negative regions in region widgets 2024-12-23 01:00:41 +01:00
WerWolv
8865db2007 lang: Added missing memory file rename key 2024-12-23 01:00:13 +01:00
WerWolv
d2056d9409 fix: Crash on exit 2024-12-23 00:59:55 +01:00
Nik
74e74ddc38 git: Make CodeQL CI use ninja 2024-12-23 00:06:59 +01:00
WerWolv
5fcb737559 fix: Only update widgets of settings that were changed
Fixed crashing on exit and speeds up settings writes
2024-12-20 21:23:19 +01:00
Nik
9303025427 git: Just disable coverage generation for now 2024-12-18 22:56:44 +01:00
WerWolv
680985fc13 git: Update gcovr filters 2024-12-18 21:57:40 +01:00
WerWolv
5a360eb614 patterns: Updated pattern language 2024-12-18 20:33:05 +01:00
paxcut
4a74bd78fd fix: Console either printed no newlines or printed extra ones. (#2016)
The reason for the error were the text preprocessor added to deal with
tabs was created to process entire files, not just lines or words. In
that context it cleaned trailing new lines if any existed but in the new
role that's not only unwanted but erroneous.

### Problem description
After that was fixed the console started to add two empty lines between
each output line. When splitting a string using new lines you need to
not add a new line to the last line created. Even if the text ends in an
end line, the split screen code is set to not discard empty lines.

### Implementation description
The fixes are straightforward.
2024-12-18 20:19:18 +01:00
WerWolv
0f53656952 build: Small ImPlot3D fixes to make it build on all platforms 2024-12-18 20:18:27 +01:00
WerWolv
9ca40d3651 build: Added ImPlot3D 2024-12-17 23:51:45 +01:00
WerWolv
ab12503f62 patterns: Drastically improved time it takes to find favorites 2024-12-17 23:37:39 +01:00
paxcut
b446d7fd4a impr: Make scrolling in pattern editor feel less janky (#2009)
I have implemented a fix that makes the scrollbars behave like they do
in VScode. Vertically you can scroll past the end of the file until only
the last line can be seen at the top. The horizontal bar behaves as if
every line was the same length which is the length of the longest line
in the file. Not only this creates a better user experience, but it also
fixes the annoying flicker that occurs when scrolling through large
files. Also, I have switched all the old draw calls to render text to
regular TextUnformatted calls which adds extra stability to the
resulting display.

To implement the behavior I added a dummy widget with the desired
dimensions.
2024-12-17 22:44:40 +01:00
WerWolv
fd46d85762 git: Another attempt fixing gcovr 2024-12-17 22:42:48 +01:00
WerWolv
fa421afb00 git: Ignore all gcov errors related to missing files 2024-12-17 22:07:16 +01:00
paxcut
a79d3e28ca fix: Crashes when getting tabs into text editor (#2008)
This time it may be for good. 


### Implementation description
As requested I added the preprocessing functionality into the pattern
editor. I had to duplicate a few functions and update the c++ library to
version 20. but now I can make sure the pattern editor doesn't see a tab
again. I also removed the preprocessor from where it was before because
it is not needed anymore. The changes were tested using a file that used
tabs for all its white space. The file was pasted into the pattern
editor and imported as well. I both cases no crashes occurred and the
files had no tabs on them.
2024-12-17 21:36:00 +01:00
WerWolv
fbb4f65735 patterns: Updated pattern language 2024-12-17 21:34:18 +01:00
WerWolv
00c62c90f6 git: Try to fix coverage scan 2024-12-17 21:33:53 +01:00
WerWolv
384aa6e6a9 fix: Narrow to wide type compare in loop in timestamp visualizer 2024-12-16 22:17:58 +01:00
WerWolv
1c755249ec git: Use ninja for building everything 2024-12-16 22:10:22 +01:00
WerWolv
2c303b5bf2 build: Actually fixed unit tests 2024-12-16 21:47:40 +01:00
WerWolv
415e3b4a93 impr: Added commit hash and branch to nightly popup on welcome screen 2024-12-16 21:37:34 +01:00
WerWolv
8d9b056c8c build: Fixed building of unit tests 2024-12-16 21:37:11 +01:00
WerWolv
a527a7f0b0 patterns: Updated pattern language 2024-12-16 21:32:19 +01:00
WerWolv
d78d955d11 impr: Better ellipsis usage in menus 2024-12-16 21:27:57 +01:00
BioTheWolff
9375a60cd9 feat: Implement paste behaviour popup when pasting over one-byte regions (#2004)
### Problem description
This PR implements the feature request described in #1995, that
describes a problem with the `Paste` vs `Paste all` commands. Users
could be thrown off by having `Ctrl+V` act as a simple "Paste over
selection", whereas it's generally accepted as a "Paste all".

### Implementation description
<!-- Explain what you did to correct the problem -->
This PR introduces a new setting, called "Paste behaviour" (under the
"Hex Editor" category).
This setting has three values:
- `Paste over selection`: the current implementation for ImHex. Pastes
only over the selection region, in this case pasting only one byte;
- `Paste everything`: allows ImHex's `Paste` to behave like a `Paste
all` when selecting one-byte regions;
- `Ask me next time`: prompts the user for a choice of behaviour
(default value).

*Note: as users generally use `Paste all` when selecting one-byte
regions, calling `Paste` when selecting over two or more bytes is not
affected by this change, and will still behave like the usual `Paste`
command.*

When selecting a one-byte region, and calling the Paste command, users
that have not defined a preferred behaviour in the settings will be
prompted to choose one, using a brand new popup. The popup also allows
the user to cancel, which will not change the settings' value, and will
cancel the paste action altogether.

### Screenshots
The new popup:

![image](https://github.com/user-attachments/assets/2b0fd532-d4e7-4209-9dd7-8a79278692ea)

The new setting:

![image](https://github.com/user-attachments/assets/2644c35e-7332-422e-8fae-ae8ad0507126)

### Additional things
I'm not very good with long descriptions, so I'm open to any suggestions
regarding the text that is included in the popup!
I do think however that we should keep a hint indicating that `Paste
all` is always an option, which could solve the issue altogether for
very new users.

---------

Signed-off-by: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com>
Co-authored-by: Nik <werwolv98@gmail.com>
2024-12-16 20:35:48 +01:00
WerWolv
bb99b9a0ef fix: Shortcuts acting as duplicates in settings 2024-12-16 20:26:04 +01:00
WerWolv
313e59d7f9 fix: Shortcuts applying to multiple views at once 2024-12-16 20:14:26 +01:00
WerWolv
e34e0e62f2 patterns: Fixed json builtin types throwing non-patternlanguage exceptions 2024-12-15 23:13:43 +01:00
paxcut
212f75f1cb fix: Tabs messing up content of text editor (#2005)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->

### Implementation description
<!-- Explain what you did to correct the problem -->

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->
2024-12-15 23:08:26 +01:00
WerWolv
a07c79efcb fix: Pattern editor shortcuts being set to use CTRL on macOS 2024-12-15 22:39:24 +01:00
WerWolv
89090b25e3 impr: Various shortcut improvements 2024-12-15 21:44:43 +01:00
WerWolv
721164e562 fix: Deinitialization order 2024-12-15 21:44:36 +01:00
BioTheWolff
b8ba980a20 fix: Chinese (Simplified) translation showing up twice (#2006)
### Problem description
As described in issue #1841, there was a duplicate on the `Chinese
(Simplified)` translation.
After closer inspection, this came from an i18n file (Script loader,
specifically) having a bad ISO code (`zh_CN` instead of the expected
`zh-CN`).

This also caused a big impact on end users, as loading the latter
(`zh_CN`) would cause the whole UI to be displayed in English (the
fallback language), and only the script loader being translated into
Chinese.

### Implementation description
Fixed the i18n code in the Script loader file.

### Additional things
Closes issue #1841

Signed-off-by: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com>
2024-12-15 17:20:04 +01:00
WerWolv
79ded38434 patterns: Updated pattern language 2024-12-15 14:12:27 +01:00
WerWolv
f52db884a9 lang: Update casing of next provider / previous provider options 2024-12-15 12:16:57 +01:00
WerWolv
ee4bb33b0a impr: Display sub menus for shortcut settings 2024-12-15 11:54:10 +01:00
WerWolv
caf8fa8e25 impr: Show byte relationship diagrams side by side if there's enough space 2024-12-15 11:46:54 +01:00
WerWolv
c46dea4c9e impr: Update settings menu values when settings are changed 2024-12-15 11:12:56 +01:00
WerWolv
002b7b4f87 impr: Make Copy as ASCII string use ALT + C to be more consistent 2024-12-15 11:02:34 +01:00
WerWolv
0a6a8c671f impr: Better naming for various menu entries 2024-12-15 11:02:20 +01:00
WerWolv
36014b706d fix: Wrong header location in disassembler view 2024-12-15 10:52:11 +01:00
paxcut
df5e01d4eb impr: Better 3D Visualizer error messages, wrap long visualizer errors (#1969)
### Problem description
Long error messages were forcing the width of the window to span the
entire screen.

### Implementation description
The fix was sending the long message to the log and outputting a short
message to the 3d visualizer window.

---------

Co-authored-by: WerWolv <werwolv98@gmail.com>
2024-12-15 10:12:14 +01:00
WerWolv
c6f1525f55 git: Silence last brew call 2024-12-15 10:01:24 +01:00
WerWolv
5511259f2d git: Updated more workflows 2024-12-15 00:44:32 +01:00
WerWolv
f2ea7ca5d1 git: Silence brew github actions annotations 2024-12-15 00:28:22 +01:00
WerWolv
6184bbeae2 build: Updated libwolv 2024-12-14 23:55:04 +01:00
WerWolv
21506578f5 impr: Removed more instanced of codecvt 2024-12-14 22:39:07 +01:00
WerWolv
f39f395393 impr: Replace codecvt with libwolv conversion functions 2024-12-14 22:20:48 +01:00
WerWolv
ed0a94659e impr: Added load and base address to instruction pl types 2024-12-14 21:52:19 +01:00
WerWolv
7f75706584 impr: Replace hex::unused with std::ignore 2024-12-14 21:35:54 +01:00
WerWolv
3f316e42f2 build: Remove unavailable warning flags from gcc builds 2024-12-14 21:35:42 +01:00
WerWolv
4a331c0331 git: Replace gcc-toolset-12 with gcc-toolset-14 fir EL9 runner 2024-12-14 20:36:32 +01:00
WerWolv
6a28de100c impr: Rename font definition files 2024-12-14 20:36:09 +01:00
WerWolv
992f18b94b impr: Optimize build times a bit 2024-12-14 19:15:49 +01:00
Nik
040a606b39 feat: Added various custom built-in types to the pattern language (#1991) 2024-12-14 16:52:36 +01:00
BioTheWolff
13e079d1b8 feat: Add capability to paste as string literal in files (#1998)
### Problem description
As suggested in #1904, ImHex could benefit from having the capability of
pasting text directly into the editor.
This also complements the "Copy as... ASCII string" capability already
implemented in the software.

### Implementation description
A new shortcut called `Paste all as string` (to resemble the naming of
the `ASCII string` copy option) now allows to paste plaintext directly.
This shortcut is mapped to the `CTRL + ALT + SHIFT + V` keybind.

Internally, a new flag called `asPlainText` has been added to the
`pasteBytes` function, to minimise code changes and streamline code
readability.
The buffer is a simple type cast of the clipboard, without any
modification applied, which is then handed to the provider's `write`
function.

### Screenshots
The new shortcut is visible in the menu, just below the other paste
options:

![image](https://github.com/user-attachments/assets/41a2a512-5c39-4984-bab6-114c58266351)

---------

Signed-off-by: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com>
2024-12-14 16:52:14 +01:00
Roman
d9a7f40eb4 fix: Shortcuts not being disabled correctly when menu items are disabled (#1992)
Fix crash on UNDO/REDO shortcut press when in "title screen"

### Problem description
ImHex crashes when (by default CTRL + Z/Y) undo/redo is pressed when on
"title"/"starting" screen (no file open, tested on Windows release build
and Linux [WSL] from-source build).

This is due to the shortcut's callback being called even if the
`provider` is `nullptr`. (see `createEditMenu` function).
Theoretically, this is prevented by the `enabledCallback` function
passsed to `addMenuItem`. In this case, though,
`addMenuItem` correctly propagates `enabledCallback` to menu item
creation but does not pass `enabledCallback` to
shortcut creation. Thus, when handling shortcuts, `enabledCallback` is
not used at all and the shortcut's callback
can be called in contradiction with its preconditions. (specified by
`enabledCallback`)

### Implementation description
The implementation wraps the callback in a check that decides whether
the shortcut is enabled or not.

(see changed files)
```c++
        auto callbackIfEnabled  = [enabledCallback, function]{ if (enabledCallback()) { function(); } };
```

This function is then passed along instead of the `function` (shortcut's
callback).

Alternatively, we can check for `nullptr` in the callback directly. This
would require modification of `createEditMenu`'s contents.
(I did not choose this implementation because I do not think it
addresses the root of the issue).

### Screenshots
None

### Additional things
I'm not sure how big of a deal it is but I am unsure whether I can
capture (`[enabledCallback, function]`) by reference or not.
2024-12-14 16:51:40 +01:00
paxcut
8d123da847 feat: Added goto line popup to text editors (#1984)
Since the popup is fairly small I opted for a straight addition parallel
to the find/replace. To make code more clear the functions that create
each popup were coalesced and made their interface simpler. That forced
a reorganization of the data processing which translates to a larger
number of changes than usual. Most of those changes are just moving some
action from one function to another.

The old method to identify popups using the size and position of the
window was dropped in favor of one based on child windows and using
their names for a much easier and robust identification.

Added specialized functions to text editor to jump to a line or to given
coordinates with a simple interface that simplifies older code that
performed the same task.

Because this PR modifies heavily the same code as the previous PR (1983)
it is also included here to make merging easier.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-12-14 16:50:45 +01:00
Nik
093310a9e5 git: Updated CI to latest available compilers and distros (#2003) 2024-12-13 00:07:46 +01:00
WerWolv
21b315b97e impr: Added image load and image base address to disassembler
#1994
2024-12-10 20:33:28 +01:00
Nik
c70cc3a6f1 git: Disable AppArmor to make fedpkg not fail anymore (#1997) 2024-12-10 13:34:39 +01:00
WerWolv
1e71d8afc0 feat: Added Disassemble selection option to the Edit menu
#1994
2024-12-09 21:35:08 +01:00
WerWolv
cb6b74b269 fix: Use after free when deleting data processor nodes with errors 2024-12-09 14:40:07 +01:00
WerWolv
a1e399aa1a fix: Use after free in Text Editor when copying ErrorHoverBoxes 2024-12-09 14:39:46 +01:00
WerWolv
e1dfdd9400 fix: Missing include 2024-12-09 00:05:36 +01:00
iTrooz
6ab2e81f1c chore: Add documentation about popup opening 2024-12-06 23:40:05 +01:00
paxcut
cf09029847 feat: Added clickable links to error messages in the pattern editor (#1988)
Errors printed in the console can be clicked to have the cursor jump to
the source code line where the error is at.

The mouse cursor changes its shape to indicate which parts of the error
message can be clicked on the console. When the cursor jumps, the text
editor takes the focus away from the console and it scrolls the window
to make the line with the error is visible if it isn't. This code uses
the function created for the go-to PR but adds code to switch focus to
the target. When the codes are merged please keep both the part that
jumps the cursor and the part that sets the focus.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-12-06 22:45:36 +01:00
WerWolv
d02e170dac fix: Build issue on systems where size_t is not u64 2024-12-06 22:03:12 +01:00
WerWolv
2b715bb0de impr: Batch fills into larger chunks 2024-12-06 10:15:32 +01:00
BioTheWolff
2dcaf2c77b fix: Various achievements issues (Edit the Hex, ROM Hacks) (#1985)
### Problem description
As described in #1846:
- the `Edit the Hex` achievement doesn't unlock when it should
- the `ROM Hacks` achievement is not using event-driven architecture
(the functions call `unlockAchievement` themselves)

### Implementation description
Firstly, for the `Edit the Hex` achievement:
- replaced the old event listener on `EventPatchCreated` with a listener
on `EventProviderDataModified`, which picks up bytes changes
- ensured the provider data change comes from a File provider, else
unlocking the achievement wouldn't make sense
- *Note*: a discovered side effect is that the "Fill" function modifies
the provider byte per byte (with a for loop)
- there is no use in testing the size of the data change, as it is
always 1 byte
- the Fill function could probably be reworked to fill in whole regions
at a time?

About the `ROM Hacks` achievement:
- implemented the new, still unused `EventPatchCreated` event.
- signal signature is `const unsigned char *, u64, const IPSKind`:
buffer pointer, buffer size, and IPS kind (IPS/IPS32)
- make use of the `::post` and `::subscribe` methods on said event to
unlock the achievement
- **WARNING::behaviour change**: the event's `post` signal has been
moved in the success branch of the IPS generation condition, meaning
that achievement will only unlock if IPS patch export has worked. I felt
it would make more sense than unlocking an achievement on an error, if
there was any to raise.

---------

Signed-off-by: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com>
2024-12-06 00:36:42 +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
Justus Garbe
3c73f88a52 fix: AES ECB mode in Data processor not working at all (#1986)
Fix the AES ECB mode in the data processor along with some other misc
fixes:
- Fixed nullpointer node not working
- Fixed crypto module incorrectly using mbedtls api
- Fixed crypto module ignoring mbedtls errors
- Fixed silently ignoring of errors in AES node
2024-12-05 20:56:43 +01:00
paxcut
8acdc19be4 fix: Pattern Editor context menus being entries greyed out when they shouldn't be (#1983)
Some context menu entries that were available as shortcuts were greyed
out. This PR aims to fix them and improve how context menus work for the
text editor and the console. The improvements include:
- automatic focus on right click
- automatic selection on right click. If selected text is right-clicked
then copy, cut and find will use the selection, if no selection is
clicked but there is text were right-clicked, then the word will be
selected and used. If right-clicking empty space copy and cut will be
greyed out and find will start empty.
- similar functionality now exists for the console as well except the
menu has fewer options due to it being read-only.
- added esc to close console context menu
2024-12-05 19:34:51 +01:00
WerWolv
22252d9044 fix: Patterns in pattern data view not being editable in providers that are not writable from the start 2024-12-05 16:37:31 +01:00
WerWolv
5948a74ad1 fix: Multiple memory corruption issues 2024-12-05 16:36:27 +01:00
alexkar598
e46d9d7650 fix: HexII visualisation does not allow hex characters in the edit field (#1982)
### Problem description
At the moment, attempting to edit files using HexII data visualization
is impossible as the editing fields only allow numeric characters but is
interpreted as a hex value

### Implementation description
I yoinked the params used for the hex visualization edit field. 

### Screenshots

![image](https://github.com/user-attachments/assets/2d61bf61-9893-4cfb-a2bf-6ff954aef903)

### Additional things
Ideally this should instead accept the format used by HexII, but I have
what scientists describe as a skill issue and this at least makes it
possible to use HexII without switching back to hex for editing.
2024-12-03 23:05:00 +01:00
Justus Garbe
813276c907 feat: Add constant data input to buffer node (#1981)
Added a hex data input field to the buffer node in the data processor.


![image](https://github.com/user-attachments/assets/a98e1174-7d35-4130-b9f7-9ef5d0703bc7)
2024-12-03 23:03:04 +01:00
BioTheWolff
7032473ecf impr: Added MIME types for project files on UNIX systems (#1980)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->
This PR addresses issue #491 regarding the inability to open ImHex
project files (`.hexproj`) directly from various UNIX Desktop
Environments.

_NB: This PR's scope is limited to UNIX systems, as I have no access to
MacOS systems and could not find a way to automatically create file
associations on Windows._

### Implementation description
<!-- Explain what you did to correct the problem -->
In order for project files to be recognised as such, we need to create a
new MIME type. According to [RFC 6838 section
3.2](https://www.rfc-editor.org/rfc/rfc6838#section-3.2), additional
application MIME types should be defined with a vendor prefix.
_NB: This is preferred over the deprecated `x-` prefix, although RFC
6838 states that the vendor should be "a well known producer"_

This PR proposes a new mime type for ImHex project files:
`application/vnd.imhex.proj`, and associates it with the file format
`*.hexproj`.

It also implements small changes in the Arch Linux and RPM builds, in
order to correctly ship the MIME XML file during installation.

### Additional things
<!-- Anything else you would like to say -->
The implemented change has been manually tested in the following UNIX
systems and graphical environments:
- Arch Linux, with Gnome 47.2
- Arch Linux, with XFCE4
- Fedora 41 Workstation Edition, with Gnome 47.0
- Fedora 41 Plasma, with KDE Plasma 24.08.2
- Ubuntu 22.04.5, with Gnome 42.9

Which tests the functionality of the following build types:
- Arch Linux's `.zst` packages
- Debian `.deb` packages
- RPM packages

For Arch Linux and RPM packages, this has been tested to ensure that
post-installation hooks (such as regeneration of the MIME database) is
correctly executed (which it is). No further changes than those
implemented in the PR are needed.

---------

Signed-off-by: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com>
2024-12-03 23:02:40 +01:00
WerWolv
807f1fb561 patterns: Updated pattern language 2024-12-02 21:16:35 +01:00
WerWolv
296f80ffe5 fix: Data information sections getting duplicated in NullProvieders 2024-12-02 21:16:20 +01:00
paxcut
d45e0d1cac impr: Replace all asserts with IM_ASSERT in the Text Editor (#1979)
All asserts in TextEditor.cpp were replaced with IM_ASSERTs so that if
they are hit ImHex won't crash and give a nice popup message instead.
2024-12-02 20:21:57 +01:00
WerWolv
4b8f9984d5 fix: Get rid of ranges again because still not all compilers support it 2024-12-02 20:21:15 +01:00
WerWolv
7623610704 build: Updated dependencies 2024-12-01 23:24:57 +01:00
WerWolv
a7fe384a31 feat: Added entropy drop/spike annotations to the entropy graph 2024-12-01 22:27:04 +01:00
WerWolv
485ce887ea patterns: Updated pattern language 2024-12-01 17:38:59 +01:00
Nik
2a0bb79513 fix: Potential overflow when calculating audio sample index
Fixes
[https://github.com/WerWolv/ImHex/security/code-scanning/223](https://github.com/WerWolv/ImHex/security/code-scanning/223)

To fix the problem, we need to ensure that the multiplication is
performed using a larger integer type to avoid overflow. This can be
achieved by casting one of the operands to `u64` before performing the
multiplication. This way, the multiplication will be done in the larger
type, preventing overflow.

We will modify the line `index += frameCount *
device->playback.channels;` to cast `frameCount` to `u64` before the
multiplication.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-12-01 16:07:24 +01:00
paxcut
21ae88702f fix: Empty text editor has no cursor. (#1976)
Even if focus is given to the pattern editor the cursor will not show
until the editor contains printable chars.

### Problem description
I was using the wrong condition to enter the loop that skipped the
default empty document.

### Implementation description
The fix was to check if there are lines of text that need to be
processed even if they are empty.
2024-12-01 09:58:37 +01:00
BobSmun
0ff1bb392c fix: CRC64 parameters being limited to 32bit (#1975)
This addresses #1974
2024-11-30 18:35:03 +01:00
WerWolv
01af2f364c patterns: Updated pattern language 2024-11-30 13:49:27 +01:00
paxcut
a639dddd19 impr: Turned static variables into member variable in the Text Editor (#1973)
to avoid potential problems in the future if opening several popup
windows at the same time becomes possible.
2024-11-29 20:44:56 +01:00
WerWolv
71ec6c5061 fix: Separator stride setting displaying incorrect values 2024-11-29 20:44:04 +01:00
WerWolv
8c4c4f5e8b impr: Hide segment number in hex editor when holding down shift 2024-11-29 20:43:37 +01:00
WerWolv
2c2d3b2de3 feat: Display visualizers in pattern tooltips 2024-11-29 20:23:36 +01:00
WerWolv
caae5c9711 fix: Move visualizer drawer to correct library 2024-11-29 17:37:02 +01:00
paxcut
72822d03aa fix: Stereo sound visualizations (#1970)
Even tough the sound visualizer has `channels` as one of its parameters
it wasn't using it properly.

### Problem description
The biggest problem is that at each frame the index was being advanced
per channel frame_count increments. The number of channels also
determines how many graph will be needed to display the graphs of the
visualized sound files. Besides these two problems there were many
others like incorrect playback time, cracking audio, etc. which will not
be mentioned.

### Implementation description
To sample the signal a channel sampler was created based on the one used
previously that returns as many sampled signals as there are channels.
This PR aims hopefully at fixing all the problems encountered, and it
has been tested extensively using `Audacity` exported samples to ensure
the visualizer fidelity on playback and graph appearance.

### Screenshots

![image](https://github.com/user-attachments/assets/03453860-693f-4af4-b6c6-e828a102c389)
2024-11-29 17:22:22 +01:00
paxcut
9de3dd89c5 feat: Added support for inline visualizers in custom data inspectors (#1966)
### Problem description
This PR aims at making inline visualizers work on the data inspector so
that more rgb encodings can be added as custom pattern language
inspector rows. This was never setup to work because the inline
visualizer rendering function was a private member function.

### Implementation description
In order to be accessible from the inspector class the rendering
function was made public.

### Additional things
Missing still is the tooltip to make it behave like other color entries.
2024-11-29 17:20:28 +01:00
dependabot[bot]
bcb69b9855 git: bump dawidd6/action-download-artifact from 3 to 6 (#1972)
Bumps
[dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact)
from 3 to 6.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-29 13:55:41 +01:00
paxcut
6d2761f141 feat: Added multiline search/replace and fixed various crashes. (#1911)
### Problem description
Previous implementation ignored everything after the first newline.
Other changes include:
- Added isEmpty() function that checks if editor has no content.
- replaced asserts with default behavior to avoid unneeded crashes.
- fixed off by one error in DeleteRange()
- some crashes occurred because readily available corrective actions
were not being taken. For example start/end being -1 in DeleteRange().
- At the heart of search/replace is the ability to translate from
indices into the text string to line/column coordinates used for
everything. To this end a function (StringIndexToCoordinates) was added
to do the translation taking utf-8 chars into account. This made the
recently added Utf8BytesToChars function unneeded, so it was removed.
- Removed commented out code that is not useful anymore. Also removed
tooltip code which is also unused.
- Removed unused parameter wrapAround to FindNext().
2024-11-29 09:37:05 +01:00
WerWolv
05c25b6aff patterns: Updated pattern language 2024-11-28 21:27:02 +01:00
WerWolv
9be9eb90f6 feat: Added hex editor segment separators 2024-11-28 21:26:55 +01:00
WerWolv
71f2f3a5fc patterns: Updated pattern language 2024-11-27 20:44:14 +01:00
WerWolv
862b1d407c patterns: Updated pattern language 2024-11-26 21:27:09 +01:00
WerWolv
5da0da48c8 build: Fix building for webassembly 2024-11-25 00:08:08 +01:00
WerWolv
3f1a51e350 patterns: Updated pattern language 2024-11-24 23:48:13 +01:00
WerWolv
d167e43252 impr: Optimization for searching for favorite and group patterns 2024-11-24 23:21:23 +01:00
WerWolv
fe9eecd031 build: Updated ImGui to v1.91.5 2024-11-24 18:55:56 +01:00
WerWolv
ded8cff415 build: Update to macOS 13 in more places 2024-11-24 15:51:22 +01:00
WerWolv
3497716a00 git: Bumped macOS runners to macOS 13 2024-11-24 15:33:55 +01:00
WerWolv
c78b4a3343 patterns: Updated pattern language 2024-11-24 15:16:06 +01:00
WerWolv
17359be58a build: Fixed remaining build issues 2024-11-24 14:16:48 +01:00
paxcut
382a62343d fix: Fixes for breakpoints (#1923)
WARNING: this PR won't compile unless [PR 132 from pattern language
repository](https://github.com/WerWolv/PatternLanguage/pull/132) is
merged first. Some changes here are shared by at least another PR to
this repository but there should not be any conflicts as the shared
changes are identical.

### Problem description
fix: Editing patterns with breakpoints sets behaves unexpectedly. As a
simple example, set a breakpoint and insert a blank line somewhere
before the breakpoint location. The breakpoint will appear to move but
in reality it hasn't. To see this set another breakpoint elsewhere in
the file and the old one will be displayed where it is really located
at.

The reason for this and many other problems with breakpoints is that
currently ImHex keeps two set of breakpoints in text editor and in
evaluator that are independent of each other, ie, changes to one don't
affect the other. This PR aims at synchronizing the two sets through the
per provider breakpoints that exist in view pattern editor.

### Implementation description

It accomplishes this by making the text editor version of breakpoints
the principal source of vectors and the ones in evaluator the effective
version. The first allows one to modify the text around and at the
breakpoint and notify others that the changes have induced changes in
the breakpoint locations. The effective breakpoints allow the insertion
and deletion of breakpoints.

View pattern editor is where breakpoints are updated. It receives
notifications from text editor about changes and then makes sure the
version in evaluator is updated with those changes. View pattern editor
also manages breakpoint addition and deletion so before making changes
it gets a copy of the current ones from text editor, sets the ones in
evaluator, uses the evaluator functions to add or delete breakpoints and
finally sets the text editor version with the new version.
2024-11-24 12:06:44 +01:00
paxcut
7e0f60615b fix: Achievements resetting after restart (#1965)
### Problem description
Loading a file on the command line or using the context menu in windows
was triggering an achievement before the achievements file was loaded.
This resulted on the achievements.json file to be overwritten with all
the achievements reset except for the one to open files.

### Implementation description
This PR fixes the problem by introducing a boolean that is used to check
if the file has been loaded.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-11-24 11:34:44 +01:00
Kirill R.
e1a49b38a7 build: Fix macos blurry flicker (#1956)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->

seem to fix #1809. I couldn't build the app, so hoping that's the right
place to update resulting `Info.plist`

### Implementation description
<!-- Explain what you did to correct the problem -->

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->
2024-11-24 11:31:30 +01:00
paxcut
4333b8c351 fix: Text cursor not moving to the correct location with ctrl+c -> ctrl+v (#1951)
This code fixes issue #1950 This PR depends on PR [#27
](https://github.com/WerWolv/libwolv/pull/27) on libwolv repo


### Problem description
See description of the problem on the issue linked above

### Implementation description
The code in the PR uses function added to the libwolv repository to
remove tabs if they exist on the provider. Additionally, any pasted tab
on the pattern editor will be translated to spaces automatically. This
code was tested successfully using the pattern posted in the issue.
2024-11-24 11:31:06 +01:00
paxcut
6464377a89 impr: Added code so that when debugger pauses at a line, the line is highlighted (#1932)
regardless of the method used to pause the evaluation at that line.
2024-11-24 11:29:08 +01:00
Shubhankar Sarangi
4fcf732814 impr: Reserve space to avoid multiple allocations when loading scripts (#1929)
std::forward ensures that the arguments are perfectly forwarded to
loadScript
By reserving space in the features vector based on the size of scripts,
we can avoid multiple memory allocations during the loop. If an
exception occurs, returning an empty vector immediately clarifies that
no scripts were loaded. Without reservation, each call to emplace_back
could potentially trigger a reallocation if the current capacity is
exceeded, which is costly in terms of performance. This leads to more
efficient memory management and can significantly speed up the execution
time when dealing with a large number of scripts.


![image](https://github.com/user-attachments/assets/3e290162-fb8b-4f00-a71b-6009494b2dab)
2024-11-24 11:28:45 +01:00
paxcut
0d4f3e5735 fix: ImHex hangs when pressing F5 while in a breakpoint (#1920)
### Problem description
fix: pressing F5 (start pattern execution ) while being in a break point
hangs ImHex.


The reason for hanging ImHex was that the shortcut procedure was not
checking if the pattern was already running, and it attempted to start
another one. This makes ImHex wait indefinitely for a lock to be
released

### Implementation description

To fix the hanging of ImHex we check the runtime for current evaluation
and if detected we stop it. In all cases the evaluation is started
again.
2024-11-24 11:24:42 +01:00
paxcut
1f2e453e20 fix: Various pattern editor settings not being per-provider (#1917)
### Problem description
Fixes provided for the following unreported bugs.

- Environment variables are set to be per provider but used as if they
are not. When a project is loaded all the environment variables for each
provider are assigned to the first provider making it impossible to add
new ones to the other providers.

- When switching providers, the text editor selection, the text editor
breakpoints, the console text, the console selection and the console
cursor position of the old provider are being assigned to the new
provider

### Implementation description

This PR aims at fixing both errors by:
- using variable defined to be per provider so that they affect their
provider only when necessary.

- creating new per provider variables and using them so that each
provider has their own console, selections and breakpoints.

In order to support the newly added per provided features new functions
were added to the text processor for selections and breakpoints. All the
new per provider variables are defined and used in view pattern editor.
2024-11-24 11:24:14 +01:00
Paulo Casaretto
5236c7b468 fix: Use machine headers to auto select arch for macOS process memory provider (#1910)
Fixes https://github.com/WerWolv/ImHex/issues/1807

### Problem description

Build fails for MacOS x86-64 due to using a wrong architecture header.

### Implementation description

Used the headers for mach that auto select the correct architecture.

### Additional things

This is being used in https://github.com/NixOS/nixpkgs/pull/330303 as a
patch

Co-authored-by: Nik <werwolv98@gmail.com>
2024-11-24 11:21:29 +01:00
Ikko Eltociear Ashimine
1738e8883f fix: Typo in tar.hpp (#1909)
occured -> occurred
2024-11-24 11:20:51 +01:00
paxcut
cc4563afb0 impr: Added back missing runtime error markers (#1907)
### Problem description
Moving error markers to be underwaved created s couple of errors: 
- Markers that were 1 char long and located at the end of the line
didn't show on text editor.
- Markers that had zero length or no stack trace didn't show on text
editor.

### Implementation description

- The first error was caused by an off by one error in the column index.
- There was no implementation for errors that had no location or zero
length. Now errors with no location will be shown at the beginning of
the line where they occur. Errors with zero length will be marked from
their location to the end of the line, therefore, errors with no stack
trace will be marked from the beginning to the end of the line.
2024-11-24 11:20:15 +01:00
paxcut
4b3bf2f358 fix: Textures, uv coordinates and light source not updating properly. (#1872)
### Problem description
The only time textures would update was through the file picker. Once UV
coordinates were used, disabling them didn't have any effect because the
vertex array didn't invalidate the corresponding buffer array. When
`shouldUpdate` is true, the light source needs to know as well,
otherwise it will set the location at 0,0.

### Implementation description

Textures were fixed by creating a member variable that holds the file
name of the texture used in the last model rendering.

Instead of invalidating buffer arrays it is much simpler to define a
default UV coordinate set for the case when no UV is specified. if a
texture is not present then the values of UV will not be used. If there
is a texture it must be a minimum of 1 pixel in size. So we choose the
UV coordinates so that every vertex gets assigned the color at the 0,0
coordinate of the texture.

When `shouldUpdate` is on, we also turn `shouldUpdateLightSource` on.

Also included are some formatting changes that are purely aesthetic.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-11-24 11:18:19 +01:00
WerWolv
80084f5c5a patterns: Updated pattern language 2024-11-24 11:17:29 +01:00
descawed
6d14b3f6bd Fix process memory provider on Linux (#1933)
### Problem description
The process memory provider currently doesn't function correctly on
Linux due to incorrect handling of the special procfs file
`/proc/<pid>/maps`. I don't know if some of this behavior could vary by
distro and/or kernel version, but I've observed the following issues in
my Ubuntu 24.04 environment.

- The current code in master calls `file.readString()` which attempts to
determine the size of the file by [seeking to the
end](https://github.com/WerWolv/libwolv/blob/master/libs/io/source/io/file_unix.cpp#L148).
However, procfs files don't have a defined size, so this fails with a
return of -1. libwolv [interprets this as the file size and attempts to
allocate an enormous
buffer](https://github.com/WerWolv/libwolv/blob/master/libs/io/source/io/file.cpp#L30),
which results in an exception, so ultimately the process memory provider
is unusable on the current code.
- The previous version of the code that went out in 1.35.4 was calling
`readString` with a fixed maximum size of `0xF'FFFF`. This avoids the
seek issue, but when working with special files, a single `read` call
isn't guaranteed to read the requested number of bytes even if that many
bytes are available. In practice, on my machine, this call only ever
reads the first few dozen lines of the file. So the feature works in
this version, but it's unable to see the vast majority of the process'
address space.
- On a more minor note, on rows in the `maps` file that have a filename,
the filenames are visually aligned by padding spaces between the inode
column and filename column. ImHex includes these spaces as part of the
filename, resulting in most of the path being pushed out of the visible
area of the window.

### Implementation description

- To ensure the entire `maps` file is read, I've changed the code to
read from the file in a loop until we stop getting data. I've also set a
fixed limit on the maximum number of bytes to read in one go to avoid
issues with trying to determine the file size.
- I've added a `trim` call to remove any padding around the filename.

### Screenshots
Exception in `file.readString()` in current code (for some reason this
also causes the window to become transparent):

![mem_regions_exception](https://github.com/user-attachments/assets/ac9f472b-3d60-446d-be9c-b028b041e547)

Abridged memory region list in 1.35.4:

![mem_regions_truncated](https://github.com/user-attachments/assets/44e60b23-49f8-41b9-a56b-54cb5c82ee72)

Complete memory region list after this PR:

![mem_regions_working](https://github.com/user-attachments/assets/bdb42dc6-bcd3-42b1-b605-a233b98e8d2e)

### Additional things
I was focused on fixing this ImHex feature here, but I wonder if some of
this should be addressed in libwolv. Maybe `readBuffer` in file_unix.cpp
should read in a loop until it has the requested number of bytes or
encounters EOF/error?

---------

Co-authored-by: Justus Garbe <55301990+jumanji144@users.noreply.github.com>
2024-11-07 13:41:04 +01:00
iTrooz
592f613a61 fix: re-enable C/C++ languages in CMake (#1942) 2024-10-24 08:14:07 +02:00
WerWolv
3739bcc40c fix: Multiple race conditions with pattern sorting 2024-10-22 16:20:08 +02:00
WerWolv
101c7a36fb patterns: Updated pattern language 2024-09-18 23:54:56 +02:00
WerWolv
21be959cba fix: Another text editor merge issue 2024-09-15 16:14:43 +02:00
WerWolv
b3a0ebe7b6 fix: Some merge issues 2024-09-15 15:55:21 +02:00
paxcut
96a588bd86 fix: F3 failed to locate the correct set of matches if file was edited after doing a search (#1867)
### Problem description
The bug can be reproduced as follows:
1) Using Ctrl-F do a search for a term that occurs several times in the
file. and press F3 to visit them.
2) Go back to the fop of the file and insert 3 blank lines. 
3) Pressing F3 once or many times will not find the term entered above.


### Implementation description
The reason for this bug is that the positions of the matches are not
being reset when changes can potentially move them.
The fix consists on resetting the search locations when changing the
contents of the file and redoing the search after the changes are made.
The bug was specially problematic when doing replace because the
replacement position would be identified as a match. This PR fixes
replace as well.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-09-15 15:32:10 +02:00
paxcut
866b956680 feat: Added per provider cursor position for the Pattern editor (#1861)
### Problem description
Currently, the pattern editor does not remember where the cursor is
located in each provider. For example, suppose you have 2 providers in
your project, and you scrolled down to line 200 in the first pattern to
make some changes and remembered that the code you want to insert is in
the second provider. Then you switch to the second provider, look for
the code and find it in line 235. Switch back to the first one, and you
are at the beginning of the file. So you again look for the line to edit
paste it to realize that it needs code a few lines before the place you
found it. You switch to the second provider, and you are at the top
again. This gets annoying very fast.

### Implementation description

This PR ensures that, when you return to the pattern in the editor for
any of the opened providers, the cursor will still be at the same place
it was when you switched to a different one. Each provider pattern saves
its cursor position and returns to it when you switch to that provider.
It does that by creating a PerProvider variable and using it when
providers are first opened to set it to the origin and when switching
providers it first saves the position of the old provider and then loads
and sets the saved position of the new provider.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-09-15 15:28:37 +02:00
paxcut
d88252c6fd fix: Unable to resize 3d-visualizer window in x-direction (#1860)
changes needed were:
1) add an extra dummy empty widget so that width of child and parent are
not always the same. 2) Width of reset button needs to be adjusted when
the width of the child is decreased so that the parent is decreased too.

<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->

### Implementation description
<!-- Explain what you did to correct the problem -->

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->
2024-09-15 15:27:39 +02:00
paxcut
414e7d36a0 fix: Double-clicking a string selects the closing double quotes (#1862)
This is a simple fix for a simple issue. Just check if the last char in
the selection is a double quote and if it is, make the selection one
char shorter.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-09-15 15:27:24 +02:00
paxcut
e0b4931a54 fix: 3D visualizer running very slowly with energy saving enabled (#1866)
### Problem description
The bug described in #1663 was caused by an optimization of the display
rendering that uses drawlists to detect changes. The changes in the 3-d
visualizer don't contain drawlists when axes are turned off.

### Implementation description
The fix is to identify the 3d visualizer among the command lists of the
main window and, if found, avoid skipping frames regardless of the
result of the comparison of drawlists.

Closes #1663
2024-09-15 15:23:58 +02:00
paxcut
a587c5ff74 feat: Added a quarter precision (8 bits) button to IEEE 745 tool (#1868)
Per discussions on Discord.
2024-09-15 15:22:35 +02:00
paxcut
0b2eca3066 fix: LZMA decompressor memory errors (#1873)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
I was unable to use the LZMA de-compressor even though 7zip was able to
identify them as LZMA compressed and decompress them without a problem.
Under the debugger the `lzma_code()` call was returning
`LZMA_MEMLIMIT_ERROR`.
### Implementation description
I found online that the error can be fixed using `lzma_memlimit_set()`
using a value obtained with `lzma_memusage()`. I tried to avoid having
to call `lzma_code()` twice but if the functions are called before the
first `lzma_code()`the values of memory obtained fall short and error
occurs again.

I suspect that there are better ways to deal with this other than the
code proposed in this PR, but I haven't been able to find any.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-09-15 15:20:17 +02:00
paxcut
fa28052958 fix: Avoid crashing ImHex when passing invalid data to the 3D visualizer (#1874)
### Problem description
There are some obvious constrains in the various array data sizes that
we can use to determine if their sizes and in some cases their values
are correct.

### Implementation description
To test their validity, the most important of the various arrays are the
indices, so their definition and use has been simplified a great deal.
In order to treat all variables in a similar manner the changes to the
uv variable posted in an earlier PR were also added here.

With this one, all the recently opened PR's combined should contain
exactly the same changes and fixes as the older 3-d visualizer PR #1850
which I will close shortly after this one is opened.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-09-15 15:19:41 +02:00
paxcut
54f5bd1d80 feat: Added underwaved text functions (#1889)
### Problem description
Currently when errors are found the entire line where the error occurred
is highlighted and one has to look at the error message in order to find
where the error is located on the line. With this PR the line will no
longer be highlighted and the location of the error will be marked with
an red waved line under the error location. Hovering over the text where
the error occurred produces an error overlay so if several errors occur
on the same line they can all be seen separately.

### Implementation description
The definition of error marker was switched to include column and size
as well as line and message like before.
This change required changing the way view pattern editor draws the
error markers because the errors themselves don't have size information.
Also, a new errorHoverBoxes type was defined to help in the detection of
the floating error messages when error is hovered.

Note that the underwave code depends on having a monospaced. If font is
not monospaced the underwaved text can be short/long or displaced.


### Screenshots

![image](https://github.com/user-attachments/assets/f0b08e10-612c-404a-8863-d4f00054d198)


![image](https://github.com/user-attachments/assets/911fcacb-2a1e-431f-bbc8-8e05bcd61341)
2024-09-15 15:19:04 +02:00
paxcut
4b3bbb4a97 impr: Moved pattern editor shortcuts to the Shortcut manager (#1892)
### Problem description
There are some recent issues about Mac keys not configured properly for
the pattern editor. This PR moves all the shortcuts to the shortcut
manager, so they can be edited at will. Even if the key is not
identified correctly it should be possible to use preferred keys for any
action.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-09-15 15:18:50 +02:00
xtex
187d90e8f2 lang: Update Chinese (Simplified) translations (#1894)
Co-authored-by: JustFor <35858818+zhongqingsong@users.noreply.github.com>
2024-09-15 15:17:25 +02:00
rockisch
2f60f61c15 impr: Add streaming decompression to zstd_decompress (#1898)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description

https://github.com/WerWolv/ImHex/issues/1895

### Implementation description

Added code that handles streamed zstd data. It is based around the
[official
documentation](http://facebook.github.io/zstd/zstd_manual.html) and the
[example](https://github.com/facebook/zstd/blob/dev/examples/simple_decompression.c)
provided at the main zstd repo.

The loop around the non-streamed version was also removed because I
don't think it was doing anything (no `continue`s, `sourceSize` was
always being set to 0).

### Additional things

To test, I generated streamed zstd data with this python script:

```py
import io; import pyzstd;
with open("data.zstd", "wb") as f:
    pyzstd.compress_stream(io.BytesIO(b'ab' * 100), f)
```

And then I ran this pattern script:
```
import std.mem;
import hex.dec;

u8 data[while(!std::mem::eof())] @ 0x00;
std::mem::Section data_sec = std::mem::create_section("data_sec");
hex::dec::zstd_decompress(data, data_sec);
```

Inspecting the section shows the correct data:

![image](https://github.com/user-attachments/assets/83fc9d4c-e6fa-49ee-9923-29dc0c280739)

Co-authored-by: Nik <werwolv98@gmail.com>
2024-09-15 15:16:57 +02:00
paxcut
057543da15 feat: Extended bitmap visualizer to handle indexed colormaps (#1901)
### Problem description
Older image format use to store color values in a small lookup table so
that the image could simply store an index to the table. The pattern
language is not designed to handle this sort of operation which makes
this extension necessary to be able to visualize images of this type.

### Implementation description

The changes add an optional parameter to the bitmap visualizer which
holds the color lookup table. If the image contains values that are
outside the range of possible colors then the first color in the map is
chosen. The dimensions of the image can be equal to or smaller than
rows*columns depending on how the indices to the color map are stored.
For example, you can use 4 bit indices which would make the image half
the size (in bytes) but that limits the number of colors to 16. To store
colors in sizes larger than one byte use an array of the appropriate
sized integers.

### Screenshots


![image](https://github.com/user-attachments/assets/d068cb7e-3ff3-450d-8ac2-1bfc6e38043f)
2024-09-15 15:16:36 +02:00
paxcut
3c060cc57a fix: Finding utf-8 strings failed to select their location. (#1902)
other separate, but closely related fixes are:

- fix: The previous fix also solved the (unreported) bug of being unable
to select utf-8 works by double-clicking.
- fix: The move to next/previous word (Ctr-arrow) behaved differently
depending on the direction. I made both the move left/right functions
share a much simpler algorithm and rewrote the find start/end of word
functions share the same code structure.


### Problem description
The code was using the byte index of the match into the utf-8 string to
store the match locations, but the code that sets the selection uses the
char index into the utf-8 string instead. Another problem was that the
search uses the byte index to determine if it needs to find more
matches.

### Implementation description
Both problems were solved by introducing two functions to switch from
coordinates in units of bytes to coordinates in units of chars and vice
versa.

Co-authored-by: Nik <werwolv98@gmail.com>
2024-09-15 15:16:19 +02:00
paxcut
928b4c6c4c fix: Reset cursor blink when moving selection (#1903)
### Problem description
When this feature was implemented the text editor handled all the
keyboard input so the blink reset function could be called in one place
for all the key presses. Now that shortcuts are done in the shortcut
manager we need to reset the blink state inside all the functions that
can affect cursor movement.

### Implementation description
Every function that moves the cursor now calls the blink state reset
function at the very start. There may be more functions that need this
that haven't been merged but git should show merging conflicts so it
should be easy to deal with.
2024-09-15 15:15:14 +02:00
WerWolv
871a0d535c build: Fix building issues on macOS with clang 18 2024-09-08 10:45:38 +02:00
WerWolv
87db9def32 build: Updated libwolv 2024-09-03 11:09:01 +02:00
WerWolv
04763eaeea patterns: Updated pattern language 2024-08-23 21:37:46 +02:00
JustFor
b6c08a1a11 lang: Updated zh_CN language definition (#1827)
### Problem description
1. Old Chinese text json, the order is chaotic. It doesn't compare well
with English.
2. Missing a batch of new English strings.

### Implementation description
1. Synchronize the key sequence of English files.
2. Added a missing batch of text, and translate to CN.

### Screenshots
None

### Additional things
None
2024-08-20 20:31:33 +02:00
xtex
811c995047 build: Find boost with name "Boost" (#1840)
On many distributions like AOSC OS, Alpine Linux, Arch Linux, etc.,
boost should be searched with name "Boost".

This should fix the packaging issue on AOSC OS.

### Problem description
CMake fails to find system boost when `USE_SYSTEM_BOOST` is set to ON.

### Implementation description
Find Boost.

Signed-off-by: xtex <xtexchooser@duck.com>
2024-08-20 20:29:03 +02:00
WerWolv
7011df2ced fix: Reading entire file content of base64 file into memory not working 2024-08-20 20:27:08 +02:00
WerWolv
a24692b4be fix: Revert ndf-extended changes for now to fix file dialogs on Linux 2024-08-20 20:08:01 +02:00
WerWolv
0e7a32470b patterns: Updated pattern language 2024-08-20 20:04:52 +02:00
WerWolv
212d2f9db4 patterns: Updated pattern language 2024-08-10 09:17:41 +02:00
Colin Snover
0263d3538e fix: Don't supress stderr anymore (#1822)
### Problem description

Typing `--help` causes ImHex to exit without outputting anything.
Diagnostic messages from glib, ASan, other libraries that might have
something important to say, etc. are also suppressed.

### Implementation description

This effectively reverts 7c1e33dde6, which
was partially reverted only on Windows by code that was left commented
out in f114239f51.

Allowing other libraries to print to stderr may make the output ‘ugly’,
but lots of things print to stderr that are important for figuring out
why something is bugged, like ASan and glib.

### Additional things


![image](https://github.com/user-attachments/assets/fa6771e2-da2e-45ea-93cd-06c3f6bfd3bf)
2024-08-09 22:15:34 +02:00
WerWolv
63c6028522 build: Updated ImGui to v1.91.0 2024-08-03 23:49:47 +02:00
WerWolv
075ece2da7 impr: Clean up windows window code 2024-08-03 22:18:16 +02:00
WerWolv
e9fb02285e impr: Allow tasks to be created without getting the task handle as parameter 2024-08-03 22:01:18 +02:00
WerWolv
5dfd8c89a3 feat: Display pattern descriptions in file chooser and pattern popup 2024-08-03 22:00:47 +02:00
WerWolv
e9f7908afb git: Increase stale issue operations to 200 2024-08-03 20:10:09 +02:00
WerWolv
fafce72c01 fix: Errors causing #pragma magic to not work as expected 2024-08-03 20:09:10 +02:00
WerWolv
c3d15157ad git: Silence brew commands spewing errors into the CI log 2024-08-03 18:41:17 +02:00
WerWolv
e0712f73c2 git: Better build CI script formatting 2024-08-03 18:40:56 +02:00
WerWolv
3dd5b2365a git: Increased stale issue operations per run to 100 2024-08-03 18:39:26 +02:00
WerWolv
b523f55984 git: Kill XProtect on git runners to work around race condition 2024-08-03 18:32:45 +02:00
Nik
79b8b77b25 git: Allow inactive issues ci to be triggered manually 2024-08-03 18:24:31 +02:00
WerWolv
c6065808a7 git: Skip codecov CI step if token isn't set 2024-08-03 18:22:15 +02:00
Justus Garbe
d69ae39b6f git: Added stale issues action (#1836)
Added stale issues action:
- Runs on cron every 30 days
- Marks issues as stale after 11 months
- Closes issues marked as stale after 1 month
2024-08-03 18:22:11 +02:00
WerWolv
35739d6d0d feat: Display pattern description on the accept pattern popup 2024-08-03 18:15:30 +02:00
WerWolv
e726fce360 patterns: Updated pattern language
Fixes #1835
2024-08-03 17:56:13 +02:00
WerWolv
0a038fecff impr: Re-parse patterns only when the user stopped typing 2024-08-03 17:00:23 +02:00
WerWolv
0184bf9a7d impr: Only mark providers dirty when they're not dirty already 2024-08-03 17:00:09 +02:00
WerWolv
60663babc8 impr: Optimize hovering over patterns in the hex editor 2024-08-03 16:50:30 +02:00
WerWolv
a7115d4300 fix: Race condition during data processor execution 2024-08-03 15:17:35 +02:00
WerWolv
29558c9910 impr: Remove superfluous concatenation operators for Lang strings 2024-08-03 11:35:36 +02:00
WerWolv
7c1d643f97 patterns: Updated pattern language 2024-08-03 11:33:15 +02:00
WerWolv
b2fc80f970 impr: Fix various issues with runtime-generated language strings 2024-08-03 11:32:17 +02:00
WerWolv
efee128c1c patterns: Updated pattern language 2024-07-28 10:43:15 +02:00
WerWolv
c3ddd68866 fix: Correct more language strings 2024-07-27 16:54:05 +02:00
WerWolv
3cde4472c8 impr: Jump to selection in main hex editor as well when clicking on diff entries 2024-07-27 16:52:15 +02:00
WerWolv
4c38fe261d feat: Make diff table resizable 2024-07-27 16:51:43 +02:00
WerWolv
33f7191c0d fix: Copy paste error 2024-07-27 16:46:10 +02:00
WerWolv
cda9ad3b30 patterns: Updated pattern language 2024-07-27 16:33:37 +02:00
WerWolv
1a7bd49361 impr: Make all task names properly translatable 2024-07-27 16:29:06 +02:00
WerWolv
cf2e189049 fix: Building issues on Fedora 2024-07-27 15:55:59 +02:00
WerWolv
d5f5ba941a patterns: Updated pattern language 2024-07-27 14:16:01 +02:00
WerWolv
9a973be7ba fix: Background service thread names 2024-07-27 14:15:51 +02:00
WerWolv
d8e1284946 fix: Task names not displaying correctly anymore 2024-07-27 14:09:52 +02:00
WerWolv
ce26fe1db7 impr: Move language string interpretation to compile time 2024-07-27 11:23:21 +02:00
WerWolv
a8ad045248 fix: Parent offset calculation with non-zero base addresses 2024-07-26 19:43:15 +02:00
WerWolv
d097f6ada0 impr: Make pattern tooltips more appropriately sized 2024-07-26 19:38:21 +02:00
WerWolv
1b26db40f7 feat: Added parent offset to pattern hover tooltip 2024-07-26 19:38:01 +02:00
WerWolv
602b946fc9 patterns: Updated pattern language 2024-07-24 19:52:03 +02:00
WerWolv
48fc1a7a1e fix: Allow ImHex to build under wayland again 2024-07-24 19:41:34 +02:00
WerWolv
416889f49d impr: Optimize time it takes to find favorites in patterns 2024-07-24 19:41:12 +02:00
WerWolv
5ca3222e5b patterns: Updated pattern language
Fixes #1828
2024-07-24 19:40:27 +02:00
WerWolv
d49d82e982 fix: Building with latest pattern language changes 2024-07-23 20:32:16 +02:00
WerWolv
a4d5679219 fix: Crash when opening hex editor popups 2024-07-23 20:32:04 +02:00
WerWolv
bead103f3d patterns: Updated pattern language 2024-07-23 18:29:37 +02:00
Jean-François Nguyen
e50b6733c4 fix: Segfault when hashing regions spanning multiple MiBs (#1804)
### Problem description

Attempting to do an MD5 hash of a large region (e.g. 2 MiB, ``u8
data[0x200000]``) crashes with a segfault.

### Implementation description

In ``hex::plugin::hashes::hashProviderRegionWithHashLib()``,
``hashFunction->TransformBytes()`` is called with an offset of 0,
because it iterates over ``data`` and not the entire region.
2024-07-21 20:35:38 +02:00
xndcn
75e5dbaaa4 build: Fix incorrect name case in FindmbedTLS.cmake (#1817)
Corrected MBEDTLS_FIND_REQUIRED to mbedTLS_FIND_REQUIRED, since the
package name is "mbedTLS" for case sensitive environment
2024-07-21 20:34:23 +02:00
xndcn
965113c2b4 fix: Fix lzma stream end constant name (#1818)
Corrected BZ_STREAM_END to LZMA_STREAM_END.
Also removed redundant condition of LZMA_STREAM_END for error checking.
2024-07-21 20:33:46 +02:00
checkraisefold
3bddaf509d fix: Textures provided through the pattern language not rendering in the 3D visualizer (#1819)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
Because of `s_drawTexture` never being set to true, textures rarely or
never drew in the 3D visualizer.

### Implementation description
Set `s_drawTexture` to true when correct (valid texture file/object).
2024-07-21 20:33:05 +02:00
Colin Snover
c1c51e0baf feat: Enumerate fonts on Linux using Fontconfig when available (#1821)
### Problem description

The fonts list on Linux does not show all system fonts, and does not
show font names at all.

### Implementation description

Use Fontconfig to make the list less bad if Fontconfig headers are
available.

### Additional things

I like fonts.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-07-21 20:28:37 +02:00
WerWolv
09b6c2ab5b fix: Error log spamming when viewing invalid regions in process memory provider on linux 2024-07-21 20:24:26 +02:00
Colin Snover
13fd956039 fix: Do not connect to api on startup when server contact setting is disabled (#1823)
### Problem description

ImHex asks users whether they wish to opt-in to network connections on
start (excellent!), then ignores that and tries to connect to the
network anyway when the welcome screen loads (less excellent!).

### Implementation description

Also don’t connect to the network on the welcome screen if it is
supposed to not do that.
2024-07-21 20:14:02 +02:00
WerWolv
b6f0ee90af fix: Sidebar panels not being resizable anymore properly 2024-07-16 18:15:28 +02:00
WerWolv
90e11e1c5d fix: Crash when parsing process memory provider regions 2024-07-16 18:11:06 +02:00
WerWolv
fc40e8ba70 fix: Process memory provider region parsing skipping unnamed regions 2024-07-16 17:58:49 +02:00
WerWolv
7652b4a5b8 fix: Compiling on Linux with older glfw versions 2024-07-16 17:58:19 +02:00
Colin Snover
fb249767f1 fix: Crash on exit when using custom font from file (#1815)
### Problem description
WerWolv/ImHex#1814

### Implementation description
1. Remove the flag that wrongly tells `ImFontAtlas` that it owns font
data, and remove that parameter from the function signature entirely
since now it is always `false`.
2. Rename `takeAtlas` to `getAtlas` since it no longer transfers
ownership as of b652565b57.
2024-07-15 22:22:02 +02:00
WerWolv
d7ed311bcf impr: Don't auto-scale the framebuffer on Linux 2024-07-12 17:34:20 +02:00
WerWolv
8422965d0b impr: Run data processor in a worker task 2024-07-11 23:30:54 +02:00
WerWolv
7975edade4 feat: Added loop data processor node 2024-07-11 20:38:33 +02:00
WerWolv
1e18935513 impr: Handle demangling of identifiers without leading underscore 2024-07-11 20:38:22 +02:00
WerWolv
c311b5315f patterns: Updated pattern language 2024-07-11 18:02:48 +02:00
WerWolv
26a73e0fba patterns: Updated pattern language 2024-07-11 17:40:18 +02:00
WerWolv
07c259c9c1 fix: Multiple issues causing visualizers to crash when used _slightly_ incorrectly 2024-07-10 20:50:58 +02:00
WerWolv
9e1c2d5a2c build: Fix copy-paste bug 2024-07-10 20:50:20 +02:00
WerWolv
d7fb1b737f fix: Occasional crash when closing providers 2024-07-09 19:01:49 +02:00
iTrooz
84c9c69fa3 fix: Remove DSA key from AUR deploy action (#1806) 2024-07-09 09:23:33 +00:00
WerWolv
12ca4e29cf fix: Multiple definitions errors with plugin features 2024-07-08 21:34:47 +02:00
WerWolv
27b1a5dc98 impr: Make highlight hovering more efficient 2024-07-08 21:34:27 +02:00
WerWolv
de36cc8445 impr: Disable pattern debug mode after evaluation has finished 2024-07-08 19:49:31 +02:00
WerWolv
03d344c0a2 build: Streamline definition on plugin features 2024-07-08 18:12:46 +02:00
WerWolv
39f01538c7 git: Update Mesa3D link for Windows NoGPU version 2024-07-07 16:17:03 +02:00
WerWolv
28c57cf666 patterns: Updated pattern language 2024-07-07 15:47:58 +02:00
WerWolv
59d120537d feat: Added non-frame lz4 compression support to the pattern language 2024-07-07 15:23:18 +02:00
WerWolv
66d18e9475 patterns: Updated pattern language 2024-07-07 13:59:56 +02:00
WerWolv
1f5e4ceb0c feat: Added basic support for lz4 decompression to the pattern language 2024-07-07 10:26:24 +02:00
Sébastien Szymanski
0cbc65a52f build: Fix Gentoo ebuild (#1787)
### Problem description
Ebuild is invalid, i.e:
```
# ebuild ImHex-9999.ebuild manifest
Error(s) in metadata for 'app-editors/ImHex-9999':
  RDEPEND: Invalid atom (dbus), token 5
```

### Implementation description
* mbedtls is in net-libs category
* RDEPEND must contain atoms (category/packagename)

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Co-authored-by: Nik <werwolv98@gmail.com>
2024-07-07 10:25:10 +02:00
WerWolv
2b0367cca6 impr: Better handling of the scaling warning when using custom fonts 2024-07-06 11:30:59 +02:00
WerWolv
1f01f480e0 impr: Enable native scaling by default again 2024-07-06 11:29:52 +02:00
WerWolv
7a167962d6 fix: Font scaling not always being applied consistently 2024-07-06 11:29:14 +02:00
WerWolv
dae028d25d fix: Build issue due to uncaptured this pointer 2024-07-05 21:03:24 +02:00
WerWolv
88e2fa04e7 fix: Crash on macOS when dirtying or undirtying a provider from a thread
Fixes #1799
2024-07-05 20:59:20 +02:00
WerWolv
bb0a8047ea fix: Hex editor popups getting transparent when hovering over combo box popup 2024-07-05 19:26:08 +02:00
WerWolv
b652565b57 feat: Added DPI awareness on Windows, added FiraCode as optional default font 2024-07-05 17:39:07 +02:00
WerWolv
9aaf6f3105 web: Trigger right click when long touching area 2024-07-04 23:15:33 +02:00
WerWolv
c26eccfe28 web: Fix canvas to the top left of the screen 2024-07-04 21:37:51 +02:00
WerWolv
9fd547112d impr: Only handle SIGINT on release builds so IDEs can fast-kill ImHex 2024-07-04 21:28:43 +02:00
WerWolv
14bfc8af72 fix: Remove unnecessary touch padding 2024-07-04 21:18:46 +02:00
WerWolv
20f3458e37 patterns: Updated pattern language 2024-07-04 21:18:34 +02:00
WerWolv
6326e2d141 web: Improve logo size on mobile 2024-07-03 22:35:47 +02:00
WerWolv
23ca3c1d2d patterns: Updated pattern language 2024-07-03 22:35:47 +02:00
WerWolv
0656ab4b88 fix: Make sure welcome screen always stays in the background 2024-07-03 22:35:47 +02:00
WerWolv
90bb5d187c web: Fix touch input 2024-07-03 22:35:47 +02:00
WerWolv
75a62e2bde fix: Wrong start/end offset and size for static array entries in pattern data view 2024-07-03 16:58:56 +02:00
WerWolv
7cd36b80eb impr: Added tooltips to toolbar buttons 2024-07-03 16:58:25 +02:00
Bernard Teo
dd607621d7 build: Update nativefiledialog and keep dialogs on top (#1771)
This PR updates the nativefiledialog submodule and uses its new feature
to set the ImHex main window as the parent of the dialog window. This
ensures that the dialog stays on top of the main window. This is
currently supported by NFDe on Windows, macOS, and Linux/X11.
Linux/Wayland behaves as it did previously due to limitations in NFDe.

Note that macOS file dialogs have already been parented properly as NFDe
previously used the key window (the window currently receiving keyboard
events) on macOS. However, it's probably better to do the correct thing
and pass the main window to NFDe even on macOS.

### Problem description
The file dialog go behind the main window if the main window is clicked
while the file dialog is open.

### Implementation description
Update nativefiledialog and pass the `GLFWwindow*` of the main window to
the library function.

### Screenshots
Before:


https://github.com/WerWolv/ImHex/assets/6948096/589c3401-702a-4b0a-99ed-02d3e4d9080e

After:


https://github.com/WerWolv/ImHex/assets/6948096/8fef4900-eedc-48d5-8a4e-7bd81e37e3c0

### Additional things
I have tested this on Windows and Linux/X11, but did not test this on
macOS. It would be ideal if someone can help with this. (But as far as
NFDe is concerned, macOS `NSWindow*` handles have been tested (with
SDL2) and works.)

Co-authored-by: Nik <werwolv98@gmail.com>
2024-07-03 05:53:55 +00:00
WerWolv
2595febf14 patterns: Updated pattern language 2024-07-02 23:46:06 +02:00
WerWolv
dc058c4cf3 fix: Remove interactive help debug code 2024-07-02 23:17:12 +02:00
WerWolv
25824e1821 patterns: Updated pattern language 2024-07-02 23:16:32 +02:00
WerWolv
381c2d52ee web: Improved canvas webgl creation logic 2024-07-02 23:16:19 +02:00
WerWolv
4020ac9843 impr: Added nicer console warning when .NET runtime isn't installed 2024-07-02 23:15:54 +02:00
WerWolv
b3b7a19df4 fix: Wrong end address for bitfield fields in pattern data view 2024-07-02 17:38:53 +02:00
WerWolv
313e3e748f impr: Improved size display in pattern data view 2024-07-02 17:38:39 +02:00
WerWolv
09b9f26e6f patterns: Updated pattern language 2024-07-02 17:37:47 +02:00
WerWolv
01b9cc64d6 impr: Disable tab overlines 2024-07-01 23:53:14 +02:00
WerWolv
97bf1dc850 fix: Potential race condition with sorting in the pattern drawer 2024-07-01 23:36:17 +02:00
WerWolv
f94794fe3e patterns: Updated pattern language 2024-07-01 22:14:51 +02:00
WerWolv
68e528dd3a impr: Added Boost.Regex to about page 2024-07-01 22:01:28 +02:00
WerWolv
06ab1d34aa build: Updated ImGui, libfmt and libyara 2024-07-01 22:00:08 +02:00
WerWolv
2f2717e9aa impr: Completely eradicate Window resize flickering on Windows 2024-07-01 20:50:10 +02:00
WerWolv
88d24c2a03 web: Fix ImHex logo and progress bar default fill 2024-07-01 20:36:55 +02:00
WerWolv
ec2a2a6fbb git: Improve GPU information in the readme 2024-07-01 20:09:30 +02:00
WerWolv
60b81e714b impr: Prevent canvas flickering in web build 2024-07-01 20:09:16 +02:00
WerWolv
2cd8b13c1d build: Use ninja to build web version 2024-07-01 20:07:21 +02:00
Ikko Eltociear Ashimine
4afedb5131 chore: Fixed typo in cmake script (#1783)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->
Accomodate -> Accommodate
### Implementation description
<!-- Explain what you did to correct the problem -->

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->
2024-07-01 08:24:59 +02:00
WerWolv
71880ad2ad git: Checkout correct repositories in plugin test CI 2024-06-30 22:35:15 +02:00
WerWolv
a30cce4cbc git: Checkout ImHex main repo in plugin template test runner 2024-06-30 22:25:09 +02:00
WerWolv
08b4f60ead git: Added CI runner to test plugin template building 2024-06-30 22:15:04 +02:00
WerWolv
11498bd09b build: Properly look for boost and libimhex library in sdk again 2024-06-30 21:55:29 +02:00
Nik
7384c88ad6 git: Update resource requirement in readme 2024-06-30 10:46:00 +02:00
WerWolv
6f22d70d59 fix: Updater executable not being launched correctly when path had spaces in it
Fixes #1780
2024-06-30 07:59:25 +02:00
WerWolv
adc279d681 impr: Further try to improve window resize flickering on Windows 2024-06-29 23:32:44 +02:00
WerWolv
f90dc5d619 fix: ImHex hanging at startup in certain cases 2024-06-29 21:13:04 +02:00
WerWolv
6fd594c1f4 fix: Don't delete font atlas after passing it to ImGui 2024-06-29 20:26:46 +02:00
WerWolv
b94a4288bf fix: Standard magic file not getting bundled into executable correctly 2024-06-29 19:43:24 +02:00
WerWolv
cbf415256b fix: Default folders still not being created correctly on Linux 2024-06-29 19:15:09 +02:00
WerWolv
4b1884944d fix: Exception when opening a null provider 2024-06-29 18:49:23 +02:00
WerWolv
5ff752c9af build: Bumped version to 1.36.0.WIP 2024-06-29 18:48:36 +02:00
WerWolv
0e331a7cd1 build: Bumped version to 1.35.1 2024-06-29 13:01:53 +02:00
WerWolv
10970d170c fix: Default folders not being created correctly anymore 2024-06-29 13:01:25 +02:00
912 changed files with 122385 additions and 45056 deletions

View File

@@ -1,69 +1,68 @@
# Generated from CLion Inspection settings
---
Checks: '-*,
mpi-*,
bugprone-*,
-bugprone-signal-handler,
-bugprone-narrowing-conversions,
-bugprone-redundant-branch-condition,
-bugprone-exception-escape,
-bugprone-shared-ptr-array-mismatch,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-signed-char-misuse,
-bugprone-unhandled-exception-at-new,
-bugprone-infinite-loop,
-bugprone-easily-swappable-parameters,
cert-err52-cpp,
cert-err60-cpp,
cert-err34-c,
cert-str34-c,
cert-dcl21-cpp,
cert-msc50-cpp,
cert-msc51-cpp,
cert-dcl58-cpp,
cert-flp30-c,
cppcoreguidelines-avoid-const-or-ref-data-members,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-slicing,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-narrowing-conversions,
google-default-arguments,
google-runtime-operator,
google-explicit-constructor,
hicpp-multiway-paths-covered,
hicpp-exception-baseclass,
misc-*,
-misc-definitions-in-headers,
-misc-unused-parameters,
-misc-unused-alias-decls,
-misc-use-anonymous-namespace,
-misc-misleading-identifier,
-misc-confusable-identifiers,
-misc-misleading-bidirectional,
-misc-static-assert,
-misc-no-recursion,
-misc-const-correctness,
modernize-*,
-modernize-use-trailing-return-type,
openmp-use-default-none,
performance-*,
-performance-no-int-to-ptr,
portability-*,
-portability-restrict-system-includes,
readability-*,
-readability-redundant-preprocessor,
-readability-named-parameter,
-readability-function-size,
-readability-use-anyofallof,
-readability-identifier-length,
-readability-magic-numbers,
-readability-braces-around-statements,
-readability-suspicious-call-argument,
-readability-isolate-declaration,
-readability-else-after-return,
-readability-redundant-access-specifiers,
-readability-function-cognitive-complexity,
-readability-identifier-naming,
*-include-cleaner,
-readability-qualified-auto'
Checks:
- -*
- mpi-*
- bugprone-*
- -bugprone-signal-handler
- -bugprone-narrowing-conversions
- -bugprone-redundant-branch-condition
- -bugprone-exception-escape
- -bugprone-shared-ptr-array-mismatch
- -bugprone-implicit-widening-of-multiplication-result
- -bugprone-signed-char-misuse
- -bugprone-unhandled-exception-at-new
- -bugprone-infinite-loop
- -bugprone-easily-swappable-parameters
- cert-err52-cpp
- cert-err60-cpp
- cert-err34-c
- cert-str34-c
- cert-dcl21-cpp
- cert-msc50-cpp
- cert-msc51-cpp
- cert-dcl58-cpp
- cert-flp30-c
- cppcoreguidelines-avoid-const-or-ref-data-members
- cppcoreguidelines-pro-type-member-init
- cppcoreguidelines-slicing
- cppcoreguidelines-interfaces-global-init
- cppcoreguidelines-pro-type-static-cast-downcast
- cppcoreguidelines-narrowing-conversions
- google-default-arguments
- google-runtime-operator
- google-explicit-constructor
- hicpp-multiway-paths-covered
- hicpp-exception-baseclass
- misc-*
- -misc-definitions-in-headers
- -misc-unused-parameters
- -misc-unused-alias-decls
- -misc-use-anonymous-namespace
- -misc-misleading-identifier
- -misc-confusable-identifiers
- -misc-misleading-bidirectional
- -misc-static-assert
- -misc-no-recursion
- -misc-const-correctness
- modernize-*
- -modernize-use-trailing-return-type
- openmp-use-default-none
- performance-*
- -performance-no-int-to-ptr
- portability-*
- -portability-restrict-system-includes
- readability-*
- -readability-redundant-preprocessor
- -readability-named-parameter
- -readability-function-size
- -readability-use-anyofallof
- -readability-identifier-length
- -readability-magic-numbers
- -readability-braces-around-statements
- -readability-suspicious-call-argument
- -readability-isolate-declaration
- -readability-else-after-return
- -readability-redundant-access-specifiers
- -readability-function-cognitive-complexity
- -readability-identifier-naming
- '*-include-cleaner'
- -readability-qualified-auto

View File

@@ -7,6 +7,7 @@ skip -rfu ^ImGui::
# Trigger breakpoint when execution reaches triggerSafeShutdown()
break triggerSafeShutdown
break __glibcxx_assert_fail
# Print backtrace after execution jumped to an invalid address
define fixbt

4
.github/FUNDING.yml vendored
View File

@@ -1,5 +1,5 @@
# Sponsor links
patreon: werwolv
custom: https://werwolv.net/donate
github: WerWolv
ko_fi: WerWolv
custom: "https://werwolv.net/donate"

View File

@@ -8,7 +8,7 @@ on:
jobs:
codeql:
name: 🐛 CodeQL
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
@@ -49,16 +49,18 @@ jobs:
set -x
mkdir -p build
cd build
CC=gcc-12 CXX=g++-12 cmake \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
CC=gcc-14 CXX=g++-14 cmake \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
-DIMHEX_EXCLUDE_PLUGINS="script_loader" \
-G Ninja \
..
make -j 4 install
ninja install
- name: 🗯️ Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

File diff suppressed because it is too large Load Diff

View File

@@ -1,80 +0,0 @@
name: Build for the web
on:
push:
branches:
- 'master'
- 'releases/**'
- 'tests/**'
pull_request:
workflow_dispatch:
env:
BUILD_TYPE: Release
permissions:
pages: write
id-token: write
actions: write
jobs:
build:
runs-on: ubuntu-22.04
name: 🌍 WebAssembly
steps:
- name: 🧰 Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 📁 Restore docker /cache
uses: actions/cache@v4
with:
path: cache
key: web-cache-${{ hashFiles('**/CMakeLists.txt') }}
- name: 🐳 Inject /cache into docker
uses: reproducible-containers/buildkit-cache-dance@v2
with:
cache-source: cache
cache-target: /cache
- name: 🛠️ Build using docker
run: |
docker buildx build . -f dist/web/Dockerfile --progress=plain --build-arg 'JOBS=4' --output out --target raw
- name: 🔨 Fix permissions
run: |
chmod -c -R +rX "out/"
- name: ⬆️ Upload artifacts
uses: actions/upload-pages-artifact@v2
with:
path: out/
# See https://github.com/actions/cache/issues/342#issuecomment-1711054115
- name: 🗑️ Delete old cache
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete "build-web-cache" --confirm
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: 📃 Deploy to GitHub Pages
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' && github.event.repository.fork == false }}
needs: build
steps:
- name: 🌍 Deploy
id: deployment
uses: actions/deploy-pages@v2

47
.github/workflows/dl-cache.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
# https://gist.github.com/iTrooz/d5bacca32c0974edc6c1ac3ad3ee82f3
# See https://github.com/cli/cli/issues/9125
# Extract archive with `tar -xf cache.tzst --transform 's@\.\./@#@g' -P` to avoid ../ errors
name: Download cache key
on:
workflow_dispatch:
inputs:
cache_key:
description: 'Cache key'
required: true
type: string
jobs:
cache-download:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Query cache version
id: version
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION=$(gh api repos/$GITHUB_REPOSITORY/actions/caches \
--jq "
.actions_caches[]
| select(.ref == \"refs/heads/$GITHUB_REF_NAME\")
| select(.key == \"${{ github.event.inputs.cache_key }}\")
| .version
")
echo "version=$VERSION" | tee $GITHUB_OUTPUT
- name: Restore cache
uses: iTrooz/cache/restore@restore_with_version
with:
# Path won't be actually used, we will match by 'version'.
path: .
key: ${{ github.event.inputs.cache_key }}
version: ${{ steps.version.outputs.version }}
- name: Upload cached folder as artifact
uses: actions/upload-artifact@v4
with:
name: cache-artifact
path: |
/home/runner/work/**/*.tzst

165
.github/workflows/nightly_release.yml vendored Normal file
View File

@@ -0,0 +1,165 @@
permissions:
contents: write
name: Nightly Release
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
nightly-release:
runs-on: ubuntu-24.04
name: 🌃 Update Nightly Release
steps:
- name: 🧰 Checkout
uses: actions/checkout@v4
with:
path: ImHex
fetch-depth: 0
fetch-tags: true
- name: 🌃 Check for new commits
id: check_commits
run: |
cd ImHex
git config --global --add safe.directory $(pwd)
if [ -z "$(git log nightly..HEAD --oneline)" ]; then
echo "No new commits since last nightly. Exiting."
echo "::set-output name=should_run::false"
else
echo "::set-output name=should_run::true"
fi
- name: 📜 Set version variable
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
run: |
project_version=`cat ImHex/VERSION`
echo "IMHEX_VERSION=$project_version" >> $GITHUB_ENV
- name: ⬇️ Download artifacts from latest workflow
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build.yml
branch: ${{ github.event.release.target_commitish }}
workflow_conclusion: success
skip_unpack: true
- name: 🗜️ Unzip files when needed
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
run: |
set -x
for zipfile in ./*.zip
do
if [ `zipinfo -1 "$zipfile" | wc -l` -eq 1 ];
then
echo "unzipping $zipfile"
unzip "$zipfile"
rm "$zipfile"
else
echo "keeping $zipfile zipped"
fi
done
- name: 🟩 Rename artifacts when needed
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
run: |
mv "Windows Portable x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-x86_64.zip
mv "Windows Portable arm64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-arm64.zip
mv "Windows Portable NoGPU x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-NoGPU-x86_64.zip
mv "ImHex Web.zip" imhex-${{ env.IMHEX_VERSION }}-Web.zip
rm artifact.tar || true
- name: 📖 Generate Release Notes
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
id: release_notes
continue-on-error: true
run: |
cd ImHex
echo "## Nightly ${GITHUB_SHA::7} Changelog" > changelog.md
git fetch --tags --recurse-submodules=no
git log nightly..origin/master --oneline --no-merges --pretty=format:'* %s' >> changelog.md
- name: ⬆️ Upload Unsigned x86_64 Windows Installer
if: false
uses: actions/upload-artifact@v4
id: upload-installer-x86_64
with:
if-no-files-found: error
name: Windows Installer ${{ matrix.architecture_name }}
path: |
imhex-*-x86_64.msi
- name: ⬆️ Upload Unsigned ARM64 Windows Installer
if: false
uses: actions/upload-artifact@v4
id: upload-installer-arm64
with:
if-no-files-found: error
name: Windows Installer ${{ matrix.architecture_name }}
path: |
imhex-*-arm64.msi
- name: 🗑️ Delete unsigned installers
if: false
run: |
rm imhex-*.msi
- name: 🗝️ Sign Installer
if: false
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'f605a0e8-86cd-411c-bb6f-e05025afcc33'
project-slug: 'ImHex'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-installer.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: '.'
- name: 📦 Update Pre-Release
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
run: |
set -e
cd ImHex
# Move nightly tag to latest commit
git tag -f nightly origin/master
git push origin nightly --force
# Auth for GitHub CLI
echo "${{ github.token }}" | gh auth login --with-token
# Delete existing assets
for asset in $(gh release view nightly --json assets --jq '.assets[].name'); do
gh release delete-asset nightly "$asset" --yes
done
# Update release notes
gh release edit nightly --notes-file changelog.md
# Upload new assets
gh release upload nightly ../*.* --clobber
- name: ⬆️ Publish x86_64 Snap package
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
continue-on-error: true
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: imhex-${{ env.IMHEX_VERSION }}-x86_64.snap
release: edge
- name: ⬆️ Publish arm64 Snap package
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
continue-on-error: true
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: imhex-${{ env.IMHEX_VERSION }}-arm64.snap
release: edge

View File

@@ -7,10 +7,16 @@ on:
release:
types: [published]
workflow_dispatch:
inputs:
commit_hash:
type: string
description: 'The commit hash to build (defaults to the latest commit on the default branch)'
required: false
default: ''
jobs:
release-update-repos:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
name: Release Update Repos
steps:
@@ -25,7 +31,7 @@ jobs:
project_version=`cat ImHex/VERSION`
tag_version="${{github.event.release.tag_name}}"
tag_version="${tag_version:1}"
if [ "$project_version" != "$tag_version" ]; then
if [ "$project_version" != "$tag_version" ] && [ ! -z "$tag_version" ]; then
echo "::warning::$project_version and $tag_version are not the same ! Refusing to populate release"
exit 1
fi
@@ -41,6 +47,7 @@ jobs:
tag: ImHex-v${{ env.IMHEX_VERSION }}
repo: PatternLanguage
token: ${{ secrets.RELEASE_TOKEN }}
skipIfReleaseExists: true
- name: 🎫 Create ImHex-Patterns release
uses: ncipollo/release-action@v1
@@ -51,6 +58,7 @@ jobs:
tag: ImHex-v${{ env.IMHEX_VERSION }}
repo: ImHex-Patterns
token: ${{ secrets.RELEASE_TOKEN }}
skipIfReleaseExists: true
- name: 🎫 Create imhex-download-sdk release
uses: ncipollo/release-action@v1
@@ -61,11 +69,13 @@ jobs:
tag: v${{ env.IMHEX_VERSION }}
repo: imhex-download-sdk
token: ${{ secrets.RELEASE_TOKEN }}
skipIfReleaseExists: true
release-upload-artifacts:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
name: Release Upload Artifacts
outputs:
IMHEX_VERSION: ${{ steps.verify_version.outputs.IMHEX_VERSION }}
steps:
- name: 🧰 Checkout
uses: actions/checkout@v4
@@ -74,29 +84,32 @@ jobs:
submodules: recursive
- name: 📜 Verify version and set version variable
id: verify_version
run: |
set -x
project_version=`cat ImHex/VERSION`
tag_version="${{github.event.release.tag_name}}"
tag_version="${tag_version:1}"
if [ "$project_version" != "$tag_version" ]; then
if [ "$project_version" != "$tag_version" ] && [ ! -z "$tag_version" ]; then
echo "::warning::$project_version and $tag_version are not the same ! Refusing to populate release"
exit 1
fi
echo "IMHEX_VERSION=$project_version" >> $GITHUB_ENV
echo "IMHEX_VERSION=$project_version" >> $GITHUB_OUTPUT
- name: 🗜️ Create tarball from sources with dependencies
run: tar --exclude-vcs -czvf Full.Sources.tar.gz ImHex
- name: ⬇️ Download artifacts from latest workflow
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{secrets.GITHUB_TOKEN}}
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build.yml
branch: ${{ github.event.release.target_commitish }}
workflow_conclusion: success
skip_unpack: true
commit: ${{ github.event.inputs.commit_hash }}
- name: 🗜️ Unzip files when needed
run: |
@@ -115,22 +128,87 @@ jobs:
- name: 🟩 Rename artifacts when needed
run: |
mv "Windows Portable x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-x86_64.zip
mv "Windows Portable NoGPU x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-NoGPU-x86_64.zip
mv "Windows Portable x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-x86_64.zip || true
mv "Windows Portable arm64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-arm64.zip || true
mv "Windows Portable NoGPU x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-NoGPU-x86_64.zip || true
mv "ImHex Web.zip" imhex-${{ env.IMHEX_VERSION }}-Web.zip || true
rm artifact.tar || true
- name: ⬆️ Upload Unsigned x86_64 Windows Installer
uses: actions/upload-artifact@v4
id: upload-installer-x86_64
with:
if-no-files-found: error
name: Windows Installer x86_64
path: |
imhex-*-x86_64.msi
- name: ⬆️ Upload Unsigned ARM64 Windows Installer
if: false
uses: actions/upload-artifact@v4
id: upload-installer-arm64
with:
if-no-files-found: error
name: Windows Installer ARM64
path: |
imhex-*-arm64.msi
- name: 🗑️ Delete unsigned installers
run: |
rm imhex-*-x86_64.msi
- name: 🗝️ Sign x86_64 Installer
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'f605a0e8-86cd-411c-bb6f-e05025afcc33'
project-slug: 'ImHex'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-installer-x86_64.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: '.'
- name: 🗝️ Sign ARM64 Installer
if: false
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'f605a0e8-86cd-411c-bb6f-e05025afcc33'
project-slug: 'ImHex'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-installer-arm64.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: '.'
- name: ⬆️ Upload everything to release
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
with:
files: '*'
release-update-aur:
name: Release update AUR package
needs: release-upload-artifacts
runs-on: ubuntu-24.04
steps:
- name: 🧰 Checkout
uses: actions/checkout@v4
with:
path: ImHex
- name: ⬇️ Download artifacts
run: |
tagname=${GITHUB_REF#refs/tags/}
version=${tagname#v}
wget https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-ArchLinux-x86_64.pkg.tar.zst
- name: ✒️ Prepare PKGBUILD
run: |
set -x
cp ImHex/dist/Arch/PKGBUILD .
hash=`md5sum imhex-${{ env.IMHEX_VERSION }}-ArchLinux-x86_64.pkg.tar.zst | cut -d ' ' -f 1`
hash=`md5sum imhex-${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}-ArchLinux-x86_64.pkg.tar.zst | cut -d ' ' -f 1`
sed -i 's/%version%/${{ env.IMHEX_VERSION }}/g' PKGBUILD
sed -i 's/%version%/${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}/g' PKGBUILD
sed -i "s/(SKIP)/($hash)/g" PKGBUILD
- name: ⬆️ Publish AUR package
@@ -144,10 +222,10 @@ jobs:
pkgname: imhex-bin
pkgbuild: ./PKGBUILD
commit_username: iTrooz
commit_email: itrooz@protonmail.com
commit_email: hey@itrooz.fr
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Bump to version ${{ env.IMHEX_VERSION }}
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
commit_message: Bump to version ${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}
ssh_keyscan_types: rsa,ecdsa,ed25519
release-update-winget:
name: Release update winget package
@@ -158,6 +236,7 @@ jobs:
shell: pwsh
run: |
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
- name: ⬆️ Update winget manifest
shell: pwsh
env:
@@ -171,3 +250,33 @@ jobs:
if ($version -notmatch "-") {
.\wingetcreate.exe submit .\manifests\w\WerWolv\ImHex\${version}\ --token $env:WINGET_GITHUB_TOKEN
}
release-update-snapstore:
name: Release update snapstore package
needs: release-upload-artifacts
runs-on: ubuntu-24.04
steps:
- name: ⬇️ Download artifacts
run: |
tagname=${GITHUB_REF#refs/tags/}
version=${tagname#v}
wget https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-x86_64.snap
wget https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-arm64.snap
- name: ⬆️ Publish x86_64 Snap package
continue-on-error: true
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: imhex-${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}-x86_64.snap
release: stable
- name: ⬆️ Publish arm64 Snap package
continue-on-error: true
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: imhex-${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}-arm64.snap
release: stable

31
.github/workflows/stale_issues.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * 0"
workflow_dispatch:
jobs:
close-issues:
if: false # Disabled for now until I actually have time to take care of all these issues
runs-on: ubuntu-24.04
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
operations-per-run: '200'
ascending: true
days-before-issue-stale: 334
days-before-issue-close: 30
stale-issue-label: "stale"
stale-issue-message: |
This issue is marked stale as it has been open for 11 months without activity.
Please try the latest ImHex version. (Avaiable here: https://imhex.download/ for release and https://imhex.download/#nightly for development version)
If the issue persists on the latest version, please make a comment on this issue again
Without response, this issue will be closed in one month.
close-issue-message: ""
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -6,6 +6,7 @@ on:
- 'master'
- 'releases/**'
- 'tests/**'
- 'feature/**'
pull_request:
branches:
- 'master'
@@ -15,7 +16,7 @@ on:
jobs:
tests:
name: 🧪 Unit Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
@@ -38,14 +39,13 @@ jobs:
run: |
sudo apt update
sudo bash dist/get_deps_debian.sh
sudo apt install gcovr -y
- name: 🛠️ Build
run: |
set -x
mkdir -p build
cd build
CC=gcc-12 CXX=g++-12 cmake \
CC=gcc-14 CXX=g++-14 cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DIMHEX_ENABLE_UNIT_TESTS=ON \
-DIMHEX_ENABLE_PLUGIN_TESTS=ON \
@@ -54,8 +54,10 @@ jobs:
-DCMAKE_C_FLAGS="-fuse-ld=lld -fsanitize=address,leak,undefined -fno-sanitize-recover=all --coverage" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld -fsanitize=address,leak,undefined -fno-sanitize-recover=all --coverage" \
-DIMHEX_OFFLINE_BUILD=ON \
-G Ninja \
..
make -j4 unit_tests
ninja unit_tests
ninja imhex_all
- name: 🧪 Perform plcli Integration Tests
run: |
@@ -68,16 +70,24 @@ jobs:
ctest --output-on-failure
# Generate report from all gcov .gcda files
- name: 🧪 Generate coverage report
run: |
gcovr --gcov-executable /usr/bin/gcov-12 -r . build --xml coverage_report.xml --verbose
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage_report.xml
#- name: 🧪 Generate coverage report
# run: |
# sudo apt install python3-pip python3-venv
# python3 -m venv venv
# . venv/bin/activate
# pip3 install gcovr
# cd build
# gcovr --gcov-executable /usr/bin/gcov-14 --exclude '.*/yara_rules/' --exclude '.*/third_party/' --exclude '.*/external/' --root .. --xml coverage_report.xml --verbose --gcov-ignore-errors all
#
#- name: Upload coverage reports to Codecov
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# if: ${{ env.CODECOV_TOKEN }}
# uses: codecov/codecov-action@v4
# with:
# fail_ci_if_error: true
# token: ${{ secrets.CODECOV_TOKEN }}
# file: build/coverage_report.xml
langs:
name: 🧪 Langs

23
.gitignore vendored
View File

@@ -1,11 +1,18 @@
.vscode/
.idea/
.kdev4/
/.vscode/
/.idea/
/.kdev4/
/.vs/
.venv/
cmake-build-*/
build*/
local/
venv/
/cmake-build-*/
/build*/
/local/
/venv/
/.cache/
/install/
/out/
/dist/ImHex.run.xml
*.mgc
*.kdev4
@@ -13,3 +20,5 @@ imgui.ini
.DS_Store
CMakeUserPresets.json
Brewfile.lock.json
vcpkg.json

12
.gitmodules vendored
View File

@@ -18,10 +18,6 @@
path = lib/third_party/capstone
url = https://github.com/capstone-engine/capstone
ignore = dirty
[submodule "lib/third_party/jthread/jthread"]
path = lib/third_party/jthread/jthread
url = https://github.com/josuttis/jthread
ignore = dirty
[submodule "lib/third_party/edlib"]
path = lib/third_party/edlib
url = https://github.com/Martinsos/edlib
@@ -43,4 +39,10 @@
[submodule "lib/third_party/HashLibPlus"]
path = lib/third_party/HashLibPlus
url = https://github.com/WerWolv/HashLibPlus
url = https://github.com/WerWolv/HashLibPlus
[submodule "lib/external/disassembler"]
path = lib/external/disassembler
url = https://github.com/WerWolv/Disassembler
[submodule "lib/third_party/md4c"]
path = lib/third_party/md4c
url = https://github.com/mity/md4c

View File

@@ -1,27 +1,38 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.25)
# Options
option(IMHEX_PLUGINS_IN_SHARE "Put the plugins in share/imhex/plugins instead of lib[..]/imhex/plugins (Linux only)" OFF)
## General
option(IMHEX_STRIP_RELEASE "Strip the release builds" ON )
option(IMHEX_OFFLINE_BUILD "Enable offline build" OFF)
option(IMHEX_IGNORE_BAD_CLONE "Disable the bad clone prevention checks" OFF)
option(IMHEX_PATTERNS_PULL_MASTER "Download latest files from master branch of the ImHex-Patterns repo" OFF)
option(IMHEX_IGNORE_BAD_COMPILER "Allow compiling with an unsupported compiler" OFF)
option(IMHEX_USE_GTK_FILE_PICKER "Use GTK file picker instead of xdg-desktop-portals (Linux only)" OFF)
option(IMHEX_DISABLE_STACKTRACE "Disables support for printing stack traces" OFF)
option(IMHEX_BUNDLE_DOTNET "Bundle .NET runtime" ON )
option(IMHEX_ENABLE_LTO "Enables Link Time Optimizations if possible" OFF)
option(IMHEX_USE_DEFAULT_BUILD_SETTINGS "Use default build settings" OFF)
option(IMHEX_STRICT_WARNINGS "Enable most available warnings and treat them as errors" ON )
option(IMHEX_STATIC_LINK_PLUGINS "Statically link all plugins into the main executable" OFF)
option(IMHEX_BUILD_HARDENING "Enable hardening flags for build" ON )
option(IMHEX_GENERATE_PACKAGE "Specify if a native package should be built. (Windows and MacOS only)" OFF)
option(IMHEX_ENABLE_UNITY_BUILD "Enables building ImHex as a unity build." OFF)
option(IMHEX_ENABLE_PRECOMPILED_HEADERS "Enable precompiled headers" OFF)
option(IMHEX_ENABLE_CXX_MODULES "Enable C++20 Module compilation. Testing only!" OFF)
option(IMHEX_ENABLE_CPPCHECK "Enable cppcheck static analysis" OFF)
option(IMHEX_BUNDLE_PLUGIN_SDK "Enable bundling of Plugin SDK into install package" ON )
## Testing
option(IMHEX_ENABLE_UNIT_TESTS "Enable building unit tests" ON )
option(IMHEX_ENABLE_IMGUI_TEST_ENGINE "Enable the ImGui Test Engine" OFF)
option(IMHEX_ENABLE_STD_ASSERTS "Enable debug asserts in the C++ std library. (Breaks Plugin ABI!)" OFF)
## Debug info
option(IMHEX_COMPRESS_DEBUG_INFO "Compress debug information" ON )
option(IMHEX_GENERATE_PDBS "Enable generating PDB files in non-debug builds (Windows only)" OFF)
option(IMHEX_REPLACE_DWARF_WITH_PDB "Remove DWARF information from binaries when generating PDBS (Windows only)" OFF)
option(IMHEX_ENABLE_STD_ASSERTS "Enable debug asserts in the C++ std library. (Breaks Plugin ABI!)" OFF)
option(IMHEX_ENABLE_UNIT_TESTS "Enable building unit tests" OFF)
option(IMHEX_ENABLE_PRECOMPILED_HEADERS "Enable precompiled headers" OFF)
option(IMHEX_COMPRESS_DEBUG_INFO "Compress debug information" ON )
option(IMHEX_STRICT_WARNINGS "Enable most available warnings and treat them as errors" ON )
option(IMHEX_DISABLE_STACKTRACE "Disables support for printing stack traces" OFF)
## Plugins
option(IMHEX_STATIC_LINK_PLUGINS "Statically link all plugins into the main executable" OFF)
option(IMHEX_ENABLE_PLUGIN_TESTS "Enable building plugin tests" ON )
option(IMHEX_INCLUDE_PLUGINS "Semicolon-separated list of plugins to include in the build (empty = build all)" "" )
option(IMHEX_EXCLUDE_PLUGINS "Semicolon-separated list of plugins to exclude from the build" "" )
set(IMHEX_BASE_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_MODULE_PATH "${IMHEX_BASE_FOLDER}/cmake/modules")
@@ -31,15 +42,17 @@ include("${IMHEX_BASE_FOLDER}/cmake/ide_helpers.cmake")
# Basic compiler and cmake configurations
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_SCAN_FOR_MODULES ${IMHEX_ENABLE_CXX_MODULES})
set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmake")
# Setup project
loadVersion(IMHEX_VERSION IMHEX_VERSION_PLAIN)
setVariableInParent(IMHEX_VERSION ${IMHEX_VERSION})
configureCMake()
project(imhex
configureCMake()
project(ImHex
LANGUAGES C CXX
VERSION ${IMHEX_VERSION_PLAIN}
DESCRIPTION "The ImHex Hex Editor"
@@ -69,19 +82,24 @@ addBundledLibraries()
add_subdirectory(lib/libimhex)
add_subdirectory(main)
addPluginDirectories()
add_subdirectory(lib/trace)
# Add unit tests
if (IMHEX_ENABLE_UNIT_TESTS)
enable_testing()
add_subdirectory(tests EXCLUDE_FROM_ALL)
if (NOT TARGET unit_tests)
enable_testing()
add_custom_target(unit_tests)
add_subdirectory(tests EXCLUDE_FROM_ALL)
endif ()
endif ()
# Configure more resources that will be added to the install package
generatePDBs()
generateSDKDirectory()
if (IMHEX_BUNDLE_PLUGIN_SDK)
generateSDKDirectory()
endif()
# Handle package generation
createPackage()
# Accomodate IDEs with FOLDER support
# Accommodate IDEs with FOLDER support
tweakTargetsForIDESupport()

View File

@@ -45,7 +45,30 @@
"IMHEX_IDE_HELPERS_OVERRIDE_XCODE_COMPILER": "ON"
}
}
},
{
"name": "vs2022",
"displayName": "Visual Studio 2022",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_MANIFEST_DIR": "${sourceDir}/dist"
}
},
{
"name": "vs2022-x86",
"displayName": "Visual Studio 2022 x86",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_MANIFEST_DIR": "${sourceDir}/dist"
},
"environment": {
"VSCMD_ARG_TGT_ARCH": "x86"
}
}
],
"buildPresets": [
{

View File

@@ -10,9 +10,7 @@ This document is a guide for developers who want to contribute to ImHex in any w
If you'd like to add new features, the best way to start is by joining our Discord and telling us about your idea. We can then discuss the best way to implement it and how it should be integrated into ImHex or if it should be done in a separate plugin.
There are standalone plugin templates that use ImHex as a submodule. You can find them here:
- https://github.com/WerWolv/ImHex-Cpp-Plugin-Template
- https://github.com/WerWolv/ImHex-Rust-Plugin-Template
There are standalone plugin templates that use ImHex as a submodule. You can find them located in the README's [Plugin Development](README.md#plugin-development) section.
### Adding a new language
@@ -32,18 +30,18 @@ ImHex is written in C++ and usually uses the latest compiler and standard librar
### Structure
- `main`: Contains the main application code
- Important to understand here is that the main ImHex application is basically just an empty shell.
- Important to understand here is that the main ImHex application is basically just an empty shell.
- All it does is create a Window and a OpenGL context using GLFW, load all available plugins, properly configure ImGui and render it to the screen.
- Everything else is done inside of plugins. ImHex comes with a few plugins by default, most notably the `builtin` plugin which contains the majority of the application code.
- In most cases, this code doesn't need to be modified. Most features should be self-contained inside a plugin.
- `lib`
- `libimhex`: Contains all helper utilities as well as various APIs for plugins to interact with ImHex.
- The library's main purpose is for Dependency Inversion. The ImHex main application as well as libimhex do not know about the existence of plugins at build time. Plugins and the main application instead link against libimhex and use it as a common API to interact with each other.
- Since libimhex is a doesn't know about the existence of plugins, it cannot depend on any of them. This includes localizations and things that get registered by plugins after launch.
- Since libimhex itself doesn't know about the existence of plugins, it cannot depend on any of them. This includes localizations and things that get registered by plugins after launch.
- Even if the builtin plugin is technically always available, it is still a plugin and should be treated that way.
- All important APIs can be found in the `hex/api` include directory and are documented in the respective header file.
- `external`: All libraries that need custom patches or aren't typically available in package managers go into here.
- If you'd like to add new features to the Pattern language, please make a PR to https://github.com/WerWolv/PatternLanguage instead. ImHex usually depends on the latest commit of the master branch of this repo.
- If you'd like to add new features to the Pattern language, please make a PR to https://github.com/WerWolv/PatternLanguage instead. ImHex usually depends on the latest commit of the master branch of this repo.
- `plugins`
- `builtin`: The builtin plugin. Contains the majority of the application code.
- It's the heart of ImHex's functionality. It contains most of the default views, providers, etc. so if you want to add new functionality to ImHex, this is the place to start.

View File

@@ -32,6 +32,13 @@ To install the Flatpak, make sure you have the Flathub repository added to your
```bash
flatpak install flathub net.werwolv.ImHex
# or install the file directly
flatpak install ./imhex-*.flatpak
```
#### Snap
```bash
snap install ./imhex-*.snap
```
#### Ubuntu DEB Package

8
PRIVACY.md Normal file
View File

@@ -0,0 +1,8 @@
# Privacy Policy
ImHex collects **anonymous** user statistics based on the user's preferences which are set on first launch and can be opted in or out at any moment through the settings interface.
These statistics contain basic system information such as: ImHex Version, System Architecture, OS, OS Version or Linux Distro version of the GPU in use. This information is linked to a randomly generated ID which cannot be used to identify a specific user.
Additionally, we allow uploading of anonymized crash log files in case of an error. These are never uploaded automatically but only after explicit consent by the user. This decision is not saved so logs can be uploaded on a per-error basis.
Information collected may be analyzed by members of our development team and will never be shared with third parties outside of the team. We may occasionally share general usage statistics publically in a summarized manner (For example a graph stating 70% of users are using a specific OS). We will never share information about individual users, even if they are anonymous.

View File

@@ -29,17 +29,26 @@
## Supporting
If you like my work, please consider supporting me on GitHub Sponsors, Patreon or PayPal. Thanks a lot!
If you like my work, please consider supporting me on GitHub Sponsors, Ko-Fi or PayPal. Thanks a lot!
<p align="center">
<a href="https://github.com/sponsors/WerWolv"><img src="https://werwolv.net/assets/github_banner.png" alt="GitHub donate button" /></a>
<a href="https://www.patreon.com/werwolv"><img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Patreon donate button" /></a>
<a href="https://ko-fi.com/WerWolv"><img src="https://werwolv.net/assets/kofi_banner.png" alt="Ko-Fi donate button" /></a>
<a href="https://werwolv.net/donate"><img src="https://werwolv.net/assets/paypal_banner.png" alt="PayPal donate button" /></a>
</p>
### Notable Sponsors
| | |
|:---------------------------------------------------------------------------------------------------:|-----------------------------------------------------------------------------------|
| [![JetBrains logo](https://avatars.githubusercontent.com/u/878437?s=48)](https://www.jetbrains.com) | JetBrains, providing us with free All Products Pack licenses for development |
| [![SignPath logo](https://avatars.githubusercontent.com/u/34448643?s=48)](https://signpath.io/) | SignPath, providing us with free Code Signing Certificates for our Windows builds |
| [![AWS logo](https://avatars.githubusercontent.com/u/2232217?s=48)](https://aws.amazon.com) | Amazon, providing us with free AWS Cloud Credits for our CI |
Would you like to appear here as well? Contact us at [imhex@werwolv.net](mailto:imhex@werwolv.net)!
## Screenshots
![Hex editor, patterns and data information](https://github.com/WerWolv/ImHex/assets/10835354/4f358238-2d27-41aa-9015-a2c6cc3708cf)
![Bookmarks, disassembler and data processor](https://github.com/WerWolv/ImHex/assets/10835354/183bc2cc-2439-4ded-b4c5-b140e19fc92f)
![Hex editor, patterns and data information](https://github.com/user-attachments/assets/902a7c4c-410d-490f-999e-14c856fec027)
![Bookmarks, data information, find view and data processor](https://github.com/user-attachments/assets/58eefa1f-31c9-4bb8-a1c1-8cdd8ddbd29f)
<details>
<summary><strong>More Screenshots</strong></summary>
@@ -107,6 +116,7 @@ If you like my work, please consider supporting me on GitHub Sponsors, Patreon o
- Base64 files
- IPS and IPS32 patches
- Markdown reports
- Binary arrays for various programming languages
</details>
<details>
<summary><strong>Data Inspector</strong></summary>
@@ -140,8 +150,13 @@ If you like my work, please consider supporting me on GitHub Sponsors, Patreon o
- GDB Server
- Access the RAM of a running process or embedded devices through GDB
- Intel Hex and Motorola SREC data
- Base64 encoded data
- UDP Packets
- Support for displaying raw data received over UDP
- Process Memory
- Inspect the entire address space of a running process
- Remote Files over SSH with SFTP
- Support for loading files from remote servers using SSH and SFTP
</details>
<details>
<summary><strong>Data searching</strong></summary>
@@ -212,6 +227,7 @@ If you like my work, please consider supporting me on GitHub Sponsors, Patreon o
- WebAssembly
- MOS65XX
- Berkeley Packet Filter
- Support for writing custom disassemblers for your own architectures
</details>
<details>
<summary><strong>Bookmarks</strong></summary>
@@ -261,6 +277,7 @@ If you like my work, please consider supporting me on GitHub Sponsors, Patreon o
- Division by invariant multiplication calculator
- TCP Client/Server
- Euclidean algorithm calculator
- HTTP Requests
</details>
<details>
<summary><strong>Built-in Content updater</strong></summary>
@@ -314,23 +331,28 @@ To use ImHex, the following minimal system requirements need to be met.
> ImHex requires a GPU with OpenGL 3.0 support in general.
> There are releases available (with the `-NoGPU` suffix) that are software rendered and don't require a GPU, however these can be a lot slower than the GPU accelerated versions.
>
> If possible at all, make ImHex use the dedicated GPU on your system instead of the integrated one (especially Intel HD GPUs are known to cause issues).
> If possible at all, make ImHex use the dedicated GPU on your system instead of the integrated one.
> ImHex will usually run fine with integrated GPUs as well but certain Intel HD GPU drivers on Windows are known to cause graphical artifacts.
- **OS**:
- **Windows**: Windows 7 or higher (Windows 10/11 recommended)
- **macOS**: macOS 12.1 (Monterey) or higher,
- Lower versions are supported, but you'll need to compile ImHex yourself
- **Linux**: "Modern" Linux. The following distributions have official releases available. Other distros are supported through the AppImage and Flatpak releases.
- Ubuntu 22.04/23.04
- Fedora 36/37
- RHEL/AlmaLinux 9
- **macOS**: macOS 15 (Sequoia) or higher,
- Lower versions should still work too, but you'll need to compile ImHex yourself. The release binaries will NOT work due to GitHub not having any macOS 15 or lower CI runners available.
- The macOS build is not signed and will require you to manually allow them in the Security & Privacy settings.
- **Linux**: "Modern" Linux. The following distributions have official releases available. Other distros are supported through the AppImage, Flatpak and Snap releases.
- Ubuntu and Debian
- Fedora
- RHEL/AlmaLinux
- Arch Linux
- **CPU**: x86_64 (64 Bit)
- Basically any other distro will work as well when compiling ImHex from sources.
- **FreeBSD**: Tested on FreeBSD 14.3
- Other versions will most likely work too but are untested
- **CPU**: Officially supported are x86, AMD64 and ARM64, though any Little Endian CPU should work.
- **GPU**: OpenGL 3.0 or higher
- Intel HD drivers are really buggy and often cause graphic artifacts
- Integrated Intel HD iGPUs are supported, however certain drivers are known to cause various graphical artifacts, especially on Windows. Use at your own risk.
- In case you don't have a GPU available, there are software rendered releases available for Windows and macOS
- **RAM**: 256MB, more may be required for more complicated analysis
- **Storage**: 100MB
- **RAM**: ~50MiB, more is required for more complex analysis
- **Storage**: ~100MiB
## Installing
@@ -339,8 +361,10 @@ Information on how to install ImHex can be found in the [Install](/INSTALL.md) g
## Compiling
To compile ImHex on any platform, GCC (or Clang) is required with a version that supports C++23 or higher.
On macOS, Clang is also required to compile some ObjC code.
All releases are being built using latest available GCC.
Windows and Linux releases are being built using latest available GCC.
MacOS releases are being built using latest available LLVM Clang.
Important to note is, the MSVC and AppleClang compilers are both **NOT** supported since they're both generally severely outdated and lack features GCC and LLVM Clang have.
> [!NOTE]
> Many dependencies are bundled into the repository using submodules so make sure to clone it using the `--recurse-submodules` option.
@@ -351,9 +375,20 @@ For more information, check out the [Compiling](/dist/compiling) guide.
## Contributing
See [Contributing](/CONTRIBUTING.md)
## Plugin development
## Plugin development
To develop plugins for ImHex, use the following template project to get started. You then have access to the entirety of libimhex as well as the ImHex API and the Content Registry to interact with ImHex or to add new content.
To build a plugin, you will need to use our SDK
### Getting the SDK locally
You can build the SDK by compiling ImHex like this:
- `cmake -G Ninja -DIMHEX_BUNDLE_PLUGIN_SDK=ON -B build`
- `cd build`
- `DESTDIR=install ninja install`
The SDK will then be available at `install/usr/local/share/imhex/sdk`. You will need to set the variable `IMHEX_SDK_PATH` to that (absolute) path.
### Getting the SDK in a Github Actions CI
You can use [this action](https://github.com/WerWolv/imhex-download-sdk) to automatically download the SDK to your Github Runner
- [ImHex Plugin Template](https://github.com/WerWolv/ImHex-Plugin-Template)
@@ -361,9 +396,10 @@ To develop plugins for ImHex, use the following template project to get started.
### Contributors
- [AxCut](https://github.com/paxcut) for a gigantic amount of contributions to the Pattern Text Editor and tons of other parts of ImHex
- [iTrooz](https://github.com/iTrooz) for getting ImHex onto the Web as well as hundreds of contributions in every part of the project
- [jumanji144](https://github.com/jumanji144) for huge contributions to the Pattern Language and ImHex's infrastructure
- [Mary](https://github.com/marysaka) for her immense help porting ImHex to MacOS and help during development
- [Mary](https://github.com/marysaka) for her immense help porting ImHex to macOS and help during development
- [Roblabla](https://github.com/Roblabla) for adding MSI Installer support to ImHex
- [Mailaender](https://github.com/Mailaender) for getting ImHex onto Flathub
- Everybody else who has reported issues on Discord or GitHub that I had great conversations with :)
@@ -394,3 +430,18 @@ Notable exceptions to this are the following parts which are under the LGPLv2.1
- **/plugins/ui**: The UI plugin library that contains some common UI elements that can be used by other plugins
The reason for this is to allow for proprietary plugins to be developed for ImHex.
### Code Signing Policy
Free code signing provided by [SignPath.io](https://about.signpath.io/),
certificate by [SignPath Foundation](https://signpath.org/).
This program will not transfer any information to other networked systems
unless specifically requested by the user or the person installing or
operating it.
#### People with direct push access
- [WerWolv](https://github.com/WerWolv)
- [iTrooz](https://github.com/iTrooz)
- [jumanji144](https://github.com/jumanji144)
- [AxCut](https://github.com/paxcut)

View File

@@ -1 +1 @@
1.35.0
1.38.1

0
changelog.md Normal file
View File

View File

@@ -1,3 +1,100 @@
# Some libraries we use set the BUILD_SHARED_LIBS variable to ON, which causes CMake to
# display a warning about options being set using set() instead of option().
# Explicitly set the policy to NEW to suppress the warning.
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0141 NEW)
if (POLICY CMP0177)
set(CMAKE_POLICY_DEFAULT_CMP0177 OLD)
cmake_policy(SET CMP0177 OLD)
endif()
function(getTarget target type)
get_target_property(IMPORTED_TARGET ${target} IMPORTED)
if (IMPORTED_TARGET)
set(${type} INTERFACE PARENT_SCOPE)
else()
set(${type} PRIVATE PARENT_SCOPE)
endif()
endfunction()
function(addCFlag)
if (ARGC EQUAL 1)
add_compile_options($<$<COMPILE_LANGUAGE:C>:${ARGV0}>)
elseif (ARGC EQUAL 2)
getTarget(${ARGV1} TYPE)
target_compile_options(${ARGV1} ${TYPE} $<$<COMPILE_LANGUAGE:C>:${ARGV0}>)
endif()
endfunction()
function(addCXXFlag)
if (ARGC EQUAL 1)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:${ARGV0}>)
elseif (ARGC EQUAL 2)
getTarget(${ARGV1} TYPE)
target_compile_options(${ARGV1} ${TYPE} $<$<COMPILE_LANGUAGE:CXX>:${ARGV0}>)
endif()
endfunction()
function(addObjCFlag)
if (ARGC EQUAL 1)
add_compile_options($<$<COMPILE_LANGUAGE:OBJC>:${ARGV0}>)
elseif (ARGC EQUAL 2)
getTarget(${ARGV1} TYPE)
target_compile_options(${ARGV1} ${TYPE} $<$<COMPILE_LANGUAGE:OBJC>:${ARGV0}>)
endif()
endfunction()
function(addLinkerFlag)
if (ARGC EQUAL 1)
add_link_options(${ARGV0})
elseif (ARGC EQUAL 2)
getTarget(${ARGV1} TYPE)
target_link_options(${ARGV1} ${TYPE} ${ARGV0})
endif()
endfunction()
function(addCCXXFlag)
addCFlag(${ARGV0} ${ARGV1})
addCXXFlag(${ARGV0} ${ARGV1})
endfunction()
function(addCommonFlag)
addCFlag(${ARGV0} ${ARGV1})
addCXXFlag(${ARGV0} ${ARGV1})
addObjCFlag(${ARGV0} ${ARGV1})
endfunction()
function(addCppCheck target)
if (NOT IMHEX_ENABLE_CPPCHECK)
return()
endif()
find_program(cppcheck_exe NAMES cppcheck REQUIRED)
if (NOT cppcheck_exe)
return()
endif()
set(target_build_dir $<TARGET_FILE_DIR:${target}>)
set(cppcheck_opts
--enable=all
--inline-suppr
--quiet
--std=c++23
--check-level=exhaustive
--error-exitcode=10
--suppressions-list=${CMAKE_SOURCE_DIR}/dist/cppcheck.supp
--checkers-report=${target_build_dir}/cppcheck-report.txt
)
set_target_properties(${target} PROPERTIES
CXX_CPPCHECK "${cppcheck_exe};${cppcheck_opts}"
)
endfunction()
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "Disable deprecated warnings" FORCE)
include(FetchContent)
if(IMHEX_STRIP_RELEASE)
@@ -59,7 +156,9 @@ macro(detectOS)
set(CMAKE_INSTALL_LIBDIR ".")
set(PLUGINS_INSTALL_LOCATION "plugins")
add_compile_definitions(WIN32_LEAN_AND_MEAN)
add_compile_definitions(NOMINMAX)
add_compile_definitions(UNICODE)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
elseif (APPLE)
add_compile_definitions(OS_MACOS)
set(CMAKE_INSTALL_BINDIR ".")
@@ -76,15 +175,11 @@ macro(detectOS)
endif()
include(GNUInstallDirs)
if(IMHEX_PLUGINS_IN_SHARE)
set(PLUGINS_INSTALL_LOCATION "share/imhex/plugins")
else()
set(PLUGINS_INSTALL_LOCATION "${CMAKE_INSTALL_LIBDIR}/imhex/plugins")
set(PLUGINS_INSTALL_LOCATION "${CMAKE_INSTALL_LIBDIR}/imhex/plugins")
# Add System plugin location for plugins to be loaded from
# IMPORTANT: This does not work for Sandboxed or portable builds such as the Flatpak or AppImage release
add_compile_definitions(SYSTEM_PLUGINS_LOCATION="${CMAKE_INSTALL_FULL_LIBDIR}/imhex")
endif()
# Add System plugin location for plugins to be loaded from
# IMPORTANT: This does not work for Sandboxed or portable builds such as the Flatpak or AppImage release
add_compile_definitions(SYSTEM_PLUGINS_LOCATION="${CMAKE_INSTALL_FULL_LIBDIR}/imhex")
else ()
message(FATAL_ERROR "Unknown / unsupported system!")
@@ -106,11 +201,14 @@ macro(configurePackingResources)
set(CPACK_GENERATOR "WIX")
set(CPACK_PACKAGE_NAME "ImHex")
set(CPACK_PACKAGE_VENDOR "WerWolv")
set(CPACK_WIX_VERSION 4)
set(CPACK_WIX_UPGRADE_GUID "05000E99-9659-42FD-A1CF-05C554B39285")
set(CPACK_WIX_PRODUCT_ICON "${PROJECT_SOURCE_DIR}/resources/dist/windows/icon.ico")
set(CPACK_WIX_UI_BANNER "${PROJECT_SOURCE_DIR}/resources/dist/windows/wix_banner.png")
set(CPACK_WIX_UI_DIALOG "${PROJECT_SOURCE_DIR}/resources/dist/windows/wix_dialog.png")
set(CPACK_WIX_CULTURES "en-US;de-DE;ja-JP;it-IT;pt-BR;zh-CN;zh-TW")
set(CPACK_WIX_CULTURES "en-US;de-DE;ja-JP;it-IT;pt-BR;zh-CN;zh-TW;ru-RU")
set(CPACK_WIX_PATCH_FILE "${PROJECT_SOURCE_DIR}/resources/dist/windows/wix_patch.xml")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "ImHex")
set_property(INSTALL "$<TARGET_FILE_NAME:main>"
PROPERTY CPACK_START_MENU_SHORTCUTS "ImHex"
@@ -189,6 +287,17 @@ macro(createPackage)
list(APPEND PLUGIN_TARGET_FILES "$<TARGET_FILE:${plugin}>")
endforeach ()
if (DEFINED VCPKG_TARGET_TRIPLET)
set(VCPKG_DEPS_FOLDER "")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(VCPKG_DEPS_FOLDER "${CMAKE_BINARY_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}/debug/bin")
else()
set(VCPKG_DEPS_FOLDER "${CMAKE_BINARY_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}/bin")
endif()
install(CODE "set(VCPKG_DEPS_FOLDER \"${VCPKG_DEPS_FOLDER}\")")
endif()
# Grab all dynamically linked dependencies.
install(CODE "set(CMAKE_INSTALL_BINDIR \"${CMAKE_INSTALL_BINDIR}\")")
install(CODE "set(PLUGIN_TARGET_FILES \"${PLUGIN_TARGET_FILES}\")")
@@ -202,10 +311,15 @@ macro(createPackage)
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
)
if(_c_deps_FILENAMES)
if(_c_deps_FILENAMES AND _c_deps AND NOT (_c_deps STREQUAL ""))
message(WARNING "Conflicting dependencies for library: \"${_c_deps}\"!")
endif()
if (DEFINED VCPKG_DEPS_FOLDER)
file(GLOB VCPKG_DEPS "${VCPKG_DEPS_FOLDER}/*.dll")
list(APPEND _r_deps ${VCPKG_DEPS})
endif()
foreach(_file ${_r_deps})
file(INSTALL
DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
@@ -216,29 +330,25 @@ macro(createPackage)
endforeach()
]])
downloadImHexPatternsFiles("./")
downloadImHexPatternsFiles(".")
elseif(UNIX AND NOT APPLE)
set_target_properties(libimhex PROPERTIES SOVERSION ${IMHEX_VERSION})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dist/DEBIAN/control.in ${CMAKE_BINARY_DIR}/DEBIAN/control)
configure_file(${IMHEX_BASE_FOLDER}/dist/DEBIAN/control.in ${CMAKE_BINARY_DIR}/DEBIAN/control)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/share/licenses/imhex)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/icon.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME imhex.png)
install(FILES ${IMHEX_BASE_FOLDER}/LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/share/licenses/imhex)
install(FILES ${IMHEX_BASE_FOLDER}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
install(FILES ${IMHEX_BASE_FOLDER}/dist/imhex.mime.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mime/packages RENAME imhex.xml)
install(FILES ${IMHEX_BASE_FOLDER}/resources/icon.svg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME imhex.svg)
downloadImHexPatternsFiles("./share/imhex")
# install AppStream file
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dist/net.werwolv.imhex.metainfo.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo)
# install symlink for the old standard name
file(CREATE_LINK net.werwolv.imhex.metainfo.xml ${CMAKE_CURRENT_BINARY_DIR}/net.werwolv.imhex.appdata.xml SYMBOLIC)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/net.werwolv.imhex.appdata.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo)
install(FILES ${IMHEX_BASE_FOLDER}/dist/net.werwolv.ImHex.metainfo.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo)
endif()
if (APPLE)
if (IMHEX_GENERATE_PACKAGE)
set(EXTRA_BUNDLE_LIBRARY_PATHS ${EXTRA_BUNDLE_LIBRARY_PATHS} "${IMHEX_SYSTEM_LIBRARY_PATH}")
include(PostprocessBundle)
set_target_properties(libimhex PROPERTIES SOVERSION ${IMHEX_VERSION})
@@ -247,6 +357,7 @@ macro(createPackage)
# Fix rpath
install(CODE "execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@executable_path/../Frameworks/\" $<TARGET_FILE:main>)")
install(CODE "execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@executable_path/../Frameworks/\" $<TARGET_FILE:updater>)")
add_custom_target(build-time-make-plugins-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${IMHEX_BUNDLE_PATH}/Contents/MacOS/plugins")
add_custom_target(build-time-make-resources-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${IMHEX_BUNDLE_PATH}/Contents/Resources")
@@ -255,6 +366,16 @@ macro(createPackage)
install(FILES ${IMHEX_ICON} DESTINATION "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/Resources")
install(TARGETS main BUNDLE DESTINATION ".")
install(TARGETS updater DESTINATION "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/MacOS")
install(
FILES ${IMHEX_BASE_FOLDER}/dist/cli/imhex.sh
DESTINATION "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/MacOS/cli"
RENAME imhex
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
# Update library references to make the bundle portable
postprocess_bundle(imhex_all main)
@@ -285,6 +406,28 @@ macro(createPackage)
if (TARGET main-forwarder)
install(TARGETS main-forwarder BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if (WIN32)
install(
FILES ${IMHEX_BASE_FOLDER}/dist/cli/imhex.bat
DESTINATION ${CMAKE_INSTALL_BINDIR}/cli
RENAME imhex.bat
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
else()
install(
FILES ${IMHEX_BASE_FOLDER}/dist/cli/imhex.sh
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/imhex
RENAME imhex
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
endif()
endif()
if (IMHEX_GENERATE_PACKAGE)
@@ -307,11 +450,14 @@ endfunction()
macro(configureCMake)
message(STATUS "Configuring ImHex v${IMHEX_VERSION}")
# Enable C and C++ languages
enable_language(C CXX)
if (DEFINED CMAKE_TOOLCHAIN_FILE)
message(STATUS "Using toolchain file: \"${CMAKE_TOOLCHAIN_FILE}\"")
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Enable position independent code for all targets" FORCE)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
# Configure use of recommended build tools
if (IMHEX_USE_DEFAULT_BUILD_SETTINGS)
message(STATUS "Configuring CMake to use recommended build tools...")
@@ -344,9 +490,9 @@ macro(configureCMake)
if (LD_LLD_PATH)
set(CMAKE_LINKER ${LD_LLD_PATH})
if (NOT XCODE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=lld")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld")
if (NOT XCODE AND NOT MSVC)
add_link_options("-fuse-ld=lld")
add_link_options("-fuse-ld=lld")
endif()
else ()
message(WARNING "lld not found, using default linker!")
@@ -358,37 +504,31 @@ macro(configureCMake)
message(WARNING "ninja not found, using default generator!")
endif ()
endif()
# Enable LTO if desired and supported
if (IMHEX_ENABLE_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT result OUTPUT output_error)
if (result)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
message(STATUS "LTO enabled!")
else ()
message(WARNING "LTO is not supported: ${output_error}")
endif ()
endif ()
# Some libraries we use set the BUILD_SHARED_LIBS variable to ON, which causes CMake to
# display a warning about options being set using set() instead of option().
# Explicitly set the policy to NEW to suppress the warning.
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "Disable deprecated warnings" FORCE)
endmacro()
function(configureProject)
# Enable C and C++ languages
enable_language(C CXX)
if (XCODE)
# Support Xcode's multi configuration paradigm by placing built artifacts into separate directories
set(IMHEX_MAIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Configs/$<CONFIG>" PARENT_SCOPE)
else()
set(IMHEX_MAIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
endif()
# Enable LTO if desired and supported
if (IMHEX_ENABLE_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT result OUTPUT output_error)
if (result OR WIN32)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION $<$<CONFIG:Release,RelWithDebInfo,MinSizeRel>:ON>)
message(STATUS "LTO enabled!")
else ()
message(WARNING "LTO is not supported: ${output_error}")
endif ()
endif ()
endfunction()
macro(setDefaultBuiltTypeIfUnset)
@@ -406,6 +546,10 @@ function(loadVersion version plain_version)
string(REPLACE ".WIP" "" read_version_plain ${read_version})
set(${version} ${read_version} PARENT_SCOPE)
set(${plain_version} ${read_version_plain} PARENT_SCOPE)
if (read_version MATCHES ".+\.WIP")
set(IMHEX_PATTERNS_PULL_MASTER ON PARENT_SCOPE)
endif()
endfunction()
function(detectBadClone)
@@ -415,6 +559,9 @@ function(detectBadClone)
file (GLOB EXTERNAL_DIRS "lib/external/*" "lib/third_party/*")
foreach (EXTERNAL_DIR ${EXTERNAL_DIRS})
if(NOT IS_DIRECTORY "${EXTERNAL_DIR}")
continue()
endif()
file(GLOB_RECURSE RESULT "${EXTERNAL_DIR}/*")
list(LENGTH RESULT ENTRY_COUNT)
if(ENTRY_COUNT LESS_EQUAL 1)
@@ -432,6 +579,8 @@ function(verifyCompiler)
message(FATAL_ERROR "ImHex requires GCC 12.0.0 or newer. Please use the latest GCC version.")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "17.0.0")
message(FATAL_ERROR "ImHex requires Clang 17.0.0 or newer. Please use the latest Clang version.")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
elseif (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
message(FATAL_ERROR "ImHex can only be compiled with GCC or Clang. ${CMAKE_CXX_COMPILER_ID} is not supported.")
endif()
@@ -440,7 +589,9 @@ endfunction()
macro(detectBundledPlugins)
file(GLOB PLUGINS_DIRS "plugins/*")
if (NOT DEFINED IMHEX_INCLUDE_PLUGINS)
if (IMHEX_INCLUDE_PLUGINS)
set(PLUGINS ${IMHEX_INCLUDE_PLUGINS})
else()
foreach(PLUGIN_DIR ${PLUGINS_DIRS})
if (EXISTS "${PLUGIN_DIR}/CMakeLists.txt")
get_filename_component(PLUGIN_NAME ${PLUGIN_DIR} NAME)
@@ -449,8 +600,6 @@ macro(detectBundledPlugins)
endif ()
endif()
endforeach()
else()
set(PLUGINS ${IMHEX_INCLUDE_PLUGINS})
endif()
foreach(PLUGIN_NAME ${PLUGINS})
@@ -461,9 +610,13 @@ macro(detectBundledPlugins)
message(FATAL_ERROR "No bundled plugins enabled")
endif()
if (NOT ("builtin" IN_LIST PLUGINS))
message(FATAL_ERROR "The 'builtin' plugin is required for ImHex to work!")
endif ()
set(REQUIRED_PLUGINS builtin fonts ui)
foreach(PLUGIN ${REQUIRED_PLUGINS})
list(FIND PLUGINS ${PLUGIN} PLUGIN_INDEX)
if (PLUGIN_INDEX EQUAL -1)
message(FATAL_ERROR "Required plugin '${PLUGIN}' is not enabled!")
endif()
endforeach()
endmacro()
macro(setVariableInParent variable value)
@@ -484,52 +637,61 @@ function(downloadImHexPatternsFiles dest)
set(PATTERNS_BRANCH ImHex-v${IMHEX_VERSION})
endif ()
FetchContent_Declare(
imhex_patterns
GIT_REPOSITORY https://github.com/WerWolv/ImHex-Patterns.git
GIT_TAG origin/master
)
message(STATUS "Downloading ImHex-Patterns repo branch ${PATTERNS_BRANCH}...")
FetchContent_MakeAvailable(imhex_patterns)
message(STATUS "Finished downloading ImHex-Patterns")
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/ImHex-Patterns")
install(CODE "set(PATTERNS_BRANCH \"${PATTERNS_BRANCH}\")")
install(CODE "set(imhex_patterns_SOURCE_DIR \"${imhex_patterns_SOURCE_DIR}\")")
install(CODE [[
message(STATUS "Downloading ImHex patterns from branch '${PATTERNS_BRANCH}'...")
if (NOT EXISTS "${imhex_patterns_SOURCE_DIR}")
file(MAKE_DIRECTORY "${imhex_patterns_SOURCE_DIR}")
execute_process(
COMMAND
git clone --recurse-submodules --branch ${PATTERNS_BRANCH} https://github.com/WerWolv/ImHex-Patterns.git "${imhex_patterns_SOURCE_DIR}"
COMMAND_ERROR_IS_FATAL ANY
)
endif()
]])
else ()
set(imhex_patterns_SOURCE_DIR "")
# Maybe patterns are cloned to a subdirectory
if (NOT EXISTS ${imhex_patterns_SOURCE_DIR})
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ImHex-Patterns")
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ImHex-Patterns")
endif()
# Or a sibling directory
if (NOT EXISTS ${imhex_patterns_SOURCE_DIR})
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../ImHex-Patterns")
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../ImHex-Patterns")
endif()
endif ()
if (NOT EXISTS ${imhex_patterns_SOURCE_DIR})
message(WARNING "Failed to locate ImHex-Patterns repository, some resources will be missing during install!")
elseif(XCODE)
# The Xcode build has multiple configurations, which each need a copy of these files
file(GLOB_RECURSE sourceFilePaths LIST_DIRECTORIES NO CONFIGURE_DEPENDS RELATIVE "${imhex_patterns_SOURCE_DIR}"
"${imhex_patterns_SOURCE_DIR}/constants/*"
"${imhex_patterns_SOURCE_DIR}/encodings/*"
"${imhex_patterns_SOURCE_DIR}/includes/*"
"${imhex_patterns_SOURCE_DIR}/patterns/*"
"${imhex_patterns_SOURCE_DIR}/magic/*"
"${imhex_patterns_SOURCE_DIR}/nodes/*"
)
list(FILTER sourceFilePaths EXCLUDE REGEX "_schema.json$")
install(CODE "set(imhex_patterns_SOURCE_DIR \"${imhex_patterns_SOURCE_DIR}\")")
foreach(relativePath IN LISTS sourceFilePaths)
file(GENERATE OUTPUT "${dest}/${relativePath}" INPUT "${imhex_patterns_SOURCE_DIR}/${relativePath}")
endforeach()
if(XCODE)
install(CODE [[
# The Xcode build has multiple configurations, which each need a copy of these files
file(GLOB_RECURSE sourceFilePaths LIST_DIRECTORIES NO CONFIGURE_DEPENDS RELATIVE "${imhex_patterns_SOURCE_DIR}"
"${imhex_patterns_SOURCE_DIR}/constants/*"
"${imhex_patterns_SOURCE_DIR}/encodings/*"
"${imhex_patterns_SOURCE_DIR}/includes/*"
"${imhex_patterns_SOURCE_DIR}/patterns/*"
"${imhex_patterns_SOURCE_DIR}/magic/*"
"${imhex_patterns_SOURCE_DIR}/nodes/*"
)
list(FILTER sourceFilePaths EXCLUDE REGEX "_schema.json$")
foreach(relativePath IN LISTS sourceFilePaths)
file(GENERATE OUTPUT "${dest}/${relativePath}" INPUT "${imhex_patterns_SOURCE_DIR}/${relativePath}")
endforeach()
]])
else()
set(PATTERNS_FOLDERS_TO_INSTALL constants encodings includes patterns magic nodes)
foreach (FOLDER ${PATTERNS_FOLDERS_TO_INSTALL})
install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION "${dest}" PATTERN "**/_schema.json" EXCLUDE)
endforeach ()
if (NOT (imhex_patterns_SOURCE_DIR STREQUAL ""))
set(PATTERNS_FOLDERS_TO_INSTALL constants encodings includes patterns magic nodes)
foreach (FOLDER ${PATTERNS_FOLDERS_TO_INSTALL})
install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION "${dest}" PATTERN "**/_schema.json" EXCLUDE)
endforeach ()
endif()
endif ()
endfunction()
@@ -551,64 +713,125 @@ macro(setupDebugCompressionFlag)
elseif (COMPRESS_AVAILABLE_COMPILER AND COMPRESS_AVAILABLE_LINKER)
message("Using default compression for debug info because both compiler and linker support it")
set(DEBUG_COMPRESSION_FLAG "-gz" CACHE STRING "Cache to use for debug info compression")
else()
set(DEBUG_COMPRESSION_FLAG "" CACHE STRING "Cache to use for debug info compression")
endif()
endif()
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} ${DEBUG_COMPRESSION_FLAG}")
addCommonFlag(${DEBUG_COMPRESSION_FLAG})
endmacro()
macro(setupCompilerFlags target)
# IMHEX_COMMON_FLAGS: flags common for C, C++, Objective C, etc.. compilers
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
addCommonFlag("/W4" ${target})
addCommonFlag("/wd4127" ${target}) # conditional expression is constant
addCommonFlag("/wd4242" ${target}) # 'identifier': conversion from 'type1' to 'type2', possible loss of data
addCommonFlag("/wd4244" ${target}) # 'conversion': conversion from 'type1' to 'type2', possible loss of data
addCommonFlag("/wd4267" ${target}) # 'var': conversion from 'size_t' to 'type', possible loss of data
addCommonFlag("/wd4305" ${target}) # truncation from 'double' to 'float'
addCommonFlag("/wd4996" ${target}) # 'function': was declared deprecated
addCommonFlag("/wd5244" ${target}) # 'include' in the purview of module 'module' appears erroneous
if (IMHEX_STRICT_WARNINGS)
addCommonFlag("/WX" ${target})
endif()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
addCommonFlag("-Wall" ${target})
addCommonFlag("-Wextra" ${target})
addCommonFlag("-Wpedantic" ${target})
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# Define strict compilation flags
if (IMHEX_STRICT_WARNINGS)
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -Wall -Wextra -Wpedantic -Werror")
addCommonFlag("-Werror" ${target})
endif()
if (UNIX AND NOT APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -rdynamic")
addCommonFlag("-rdynamic" ${target})
endif()
set(IMHEX_CXX_FLAGS "-fexceptions -frtti")
addCXXFlag("-fexceptions" ${target})
addCXXFlag("-frtti" ${target})
addCommonFlag("-fno-omit-frame-pointer" ${target})
# Disable some warnings
set(IMHEX_C_CXX_FLAGS "-Wno-unknown-warning-option -Wno-array-bounds -Wno-deprecated-declarations -Wno-unknown-pragmas")
addCCXXFlag("-Wno-array-bounds" ${target})
addCCXXFlag("-Wno-deprecated-declarations" ${target})
addCCXXFlag("-Wno-unknown-pragmas" ${target})
addCXXFlag("-Wno-include-angled-in-module-purview" ${target})
# Enable hardening flags
if (IMHEX_BUILD_HARDENING)
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
addCommonFlag("-U_FORTIFY_SOURCE" ${target})
addCommonFlag("-D_FORTIFY_SOURCE=3" ${target})
if (NOT EMSCRIPTEN)
addCommonFlag("-fstack-protector-strong" ${target})
endif()
endif()
endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (IMHEX_ENABLE_UNITY_BUILD AND WIN32)
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -Wa,-mbig-obj")
if (WIN32)
addLinkerFlag("-Wa,mbig-obj" ${target})
endif ()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND APPLE)
addCCXXFlag("-Wno-unknown-warning-option" ${target})
# On macOS, when using clang from Homebrew, properly setup the libc++ library path so
# it's using the one from Homebrew instead of the system one.
execute_process(COMMAND brew --prefix llvm OUTPUT_VARIABLE LLVM_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT LLVM_PREFIX STREQUAL "" AND ${CMAKE_CXX_COMPILER} STREQUAL "${LLVM_PREFIX}/bin/clang++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG)
endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
addCommonFlag("/bigobj" ${target})
addCFlag("/std:clatest" ${target})
addCXXFlag("/std:c++latest" ${target})
endif()
# Disable some warnings for gcc
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(IMHEX_C_CXX_FLAGS "${IMHEX_C_CXX_FLAGS} -Wno-restrict -Wno-stringop-overread -Wno-stringop-overflow -Wno-dangling-reference")
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
addCCXXFlag("-Wno-restrict" ${target})
addCCXXFlag("-Wno-stringop-overread" ${target})
addCCXXFlag("-Wno-stringop-overflow" ${target})
addCCXXFlag("-Wno-dangling-reference" ${target})
endif()
# Define emscripten-specific disabled warnings
if (EMSCRIPTEN)
set(IMHEX_C_CXX_FLAGS "${IMHEX_C_CXX_FLAGS} -pthread -Wno-dollar-in-identifier-extension -Wno-pthreads-mem-growth")
addCCXXFlag("-pthread" ${target})
addCCXXFlag("-Wno-dollar-in-identifier-extension" ${target})
addCCXXFlag("-Wno-pthreads-mem-growth" ${target})
endif ()
if (IMHEX_COMPRESS_DEBUG_INFO)
setupDebugCompressionFlag()
endif()
# Set actual CMake flags
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS} ${IMHEX_CXX_FLAGS}")
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${IMHEX_COMMON_FLAGS}")
# Only generate minimal debug information for stacktraces in RelWithDebInfo builds
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -g1")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Add flags for debug info in inline functions
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -gstatement-frontiers -ginline-points")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -gstatement-frontiers -ginline-points")
if (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
addCCXXFlag("-g1" ${target})
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Add flags for debug info in inline functions
addCCXXFlag("-gstatement-frontiers" ${target})
addCCXXFlag("-ginline-points" ${target})
endif()
endif()
endmacro()
@@ -626,11 +849,16 @@ macro(setUninstallTarget)
endmacro()
macro(addBundledLibraries)
# Make sure the build is using vcpkg on Windows and Emscripten, otherwise none of these dependencies will be found
if (MSVC OR EMSCRIPTEN)
if (NOT (CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg"))
message(AUTHOR_WARNING "Your current environment probably needs to be setup to use vcpkg, otherwise none of the dependencies will be found!")
endif()
endif()
set(EXTERNAL_LIBS_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/lib/external")
set(THIRD_PARTY_LIBS_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/lib/third_party")
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/imgui)
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/microtar EXCLUDE_FROM_ALL)
@@ -640,6 +868,7 @@ macro(addBundledLibraries)
set(FPHSA_NAME_MISMATCHED ON CACHE BOOL "")
if(NOT USE_SYSTEM_FMT)
set(FMT_INSTALL OFF CACHE BOOL "Disable install targets for libfmt" FORCE)
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/fmt EXCLUDE_FROM_ALL)
set(FMT_LIBRARIES fmt::fmt-header-only)
else()
@@ -679,8 +908,19 @@ macro(addBundledLibraries)
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/lunasvg EXCLUDE_FROM_ALL)
set(LUNASVG_LIBRARIES lunasvg)
else()
find_package(LunaSVG REQUIRED)
set(LUNASVG_LIBRARIES lunasvg)
find_package(lunasvg REQUIRED)
set(LUNASVG_LIBRARIES lunasvg::lunasvg)
endif()
if (NOT USE_SYSTEM_MD4C)
set(BUILD_MD2HTML_EXECUTABLE OFF CACHE BOOL "Disable md2html executable" FORCE)
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/md4c EXCLUDE_FROM_ALL)
add_library(md4c_lib INTERFACE)
add_library(md4c::md4c ALIAS md4c_lib)
target_include_directories(md4c_lib INTERFACE ${THIRD_PARTY_LIBS_FOLDER}/md4c/src)
target_link_libraries(md4c_lib INTERFACE md4c)
else()
find_package(md4c REQUIRED)
endif()
if (NOT USE_SYSTEM_LLVM)
@@ -689,34 +929,23 @@ macro(addBundledLibraries)
find_package(LLVM REQUIRED Demangle)
endif()
if (NOT USE_SYSTEM_JTHREAD)
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/jthread EXCLUDE_FROM_ALL)
set(JTHREAD_LIBRARIES jthread)
else()
find_path(JOSUTTIS_JTHREAD_INCLUDE_DIRS "condition_variable_any2.hpp")
include_directories(${JOSUTTIS_JTHREAD_INCLUDE_DIRS})
add_library(jthread INTERFACE)
target_include_directories(jthread INTERFACE ${JOSUTTIS_JTHREAD_INCLUDE_DIRS})
set(JTHREAD_LIBRARIES jthread)
endif()
if (USE_SYSTEM_BOOST)
find_package(boost REQUIRED)
find_package(Boost REQUIRED CONFIG COMPONENTS regex)
set(BOOST_LIBRARIES Boost::regex)
else()
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/boost ${CMAKE_CURRENT_BINARY_DIR}/boost EXCLUDE_FROM_ALL)
set(BOOST_LIBRARIES boost::regex)
endif()
set(LIBPL_BUILD_CLI_AS_EXECUTABLE OFF CACHE BOOL "" FORCE)
set(LIBPL_ENABLE_PRECOMPILED_HEADERS ${IMHEX_ENABLE_PRECOMPILED_HEADERS} CACHE BOOL "" FORCE)
if (WIN32)
set(LIBPL_SHARED_LIBRARY ON CACHE BOOL "" FORCE)
else()
set(LIBPL_SHARED_LIBRARY OFF CACHE BOOL "" FORCE)
endif()
set(LIBPL_SHARED_LIBRARY OFF CACHE BOOL "" FORCE)
add_subdirectory(${EXTERNAL_LIBS_FOLDER}/pattern_language EXCLUDE_FROM_ALL)
add_subdirectory(${EXTERNAL_LIBS_FOLDER}/disassembler EXCLUDE_FROM_ALL)
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/imgui)
if (LIBPL_SHARED_LIBRARY)
install(
@@ -741,30 +970,6 @@ macro(addBundledLibraries)
find_package(mbedTLS 3.4.0 REQUIRED)
find_package(Magic 5.39 REQUIRED)
if (NOT IMHEX_DISABLE_STACKTRACE)
if (WIN32)
message(STATUS "StackWalk enabled!")
set(LIBBACKTRACE_LIBRARIES DbgHelp.lib)
else ()
find_package(Backtrace)
if (${Backtrace_FOUND})
message(STATUS "Backtrace enabled! Header: ${Backtrace_HEADER}")
if (Backtrace_HEADER STREQUAL "backtrace.h")
set(LIBBACKTRACE_LIBRARIES ${Backtrace_LIBRARY})
set(LIBBACKTRACE_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})
add_compile_definitions(BACKTRACE_HEADER=<${Backtrace_HEADER}>)
add_compile_definitions(HEX_HAS_BACKTRACE)
elseif (Backtrace_HEADER STREQUAL "execinfo.h")
set(LIBBACKTRACE_LIBRARIES ${Backtrace_LIBRARY})
set(LIBBACKTRACE_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})
add_compile_definitions(BACKTRACE_HEADER=<${Backtrace_HEADER}>)
add_compile_definitions(HEX_HAS_EXECINFO)
endif()
endif()
endif()
endif()
endmacro()
function(enableUnityBuild TARGET)
@@ -773,71 +978,22 @@ function(enableUnityBuild TARGET)
endif ()
endfunction()
function(generatePDBs)
if (NOT IMHEX_GENERATE_PDBS)
return()
endif ()
if (NOT WIN32 OR CMAKE_BUILD_TYPE STREQUAL "Debug")
return()
endif ()
include(FetchContent)
FetchContent_Declare(
cv2pdb
URL "https://github.com/rainers/cv2pdb/releases/download/v0.52/cv2pdb-0.52.zip"
DOWNLOAD_EXTRACT_TIMESTAMP ON
)
FetchContent_Populate(cv2pdb)
set(PDBS_TO_GENERATE main main-forwarder libimhex ${PLUGINS})
foreach (PDB ${PDBS_TO_GENERATE})
if (PDB STREQUAL "main")
set(GENERATED_PDB imhex)
elseif (PDB STREQUAL "main-forwarder")
set(GENERATED_PDB imhex-gui)
elseif (PDB STREQUAL "libimhex")
set(GENERATED_PDB libimhex)
else ()
set(GENERATED_PDB plugins/${PDB})
endif ()
if (IMHEX_REPLACE_DWARF_WITH_PDB)
set(PDB_OUTPUT_PATH ${CMAKE_BINARY_DIR}/${GENERATED_PDB})
else ()
set(PDB_OUTPUT_PATH)
endif()
add_custom_target(${PDB}_pdb DEPENDS ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND
(
${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb &&
${cv2pdb_SOURCE_DIR}/cv2pdb64.exe $<TARGET_FILE:${PDB}> ${PDB_OUTPUT_PATH} &&
${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/${GENERATED_PDB}
) || (exit 0)
COMMAND_EXPAND_LISTS)
install(FILES ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb DESTINATION ".")
add_dependencies(imhex_all ${PDB}_pdb)
endforeach ()
function(setSDKPaths)
if (WIN32)
set(SDK_PATH "./sdk" PARENT_SCOPE)
elseif (APPLE)
set(SDK_PATH "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/Resources/sdk" PARENT_SCOPE)
else()
set(SDK_PATH "share/imhex/sdk" PARENT_SCOPE)
endif()
set(SDK_BUILD_PATH "${CMAKE_BINARY_DIR}/sdk" PARENT_SCOPE)
endfunction()
function(generateSDKDirectory)
if (WIN32)
set(SDK_PATH "./sdk")
elseif (APPLE)
set(SDK_PATH "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/Resources/sdk")
else()
set(SDK_PATH "share/imhex/sdk")
endif()
set(SDK_BUILD_PATH "${CMAKE_BINARY_DIR}/sdk")
setSDKPaths()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/libimhex DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/trace DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/external DESTINATION "${SDK_PATH}/lib")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/third_party/imgui DESTINATION "${SDK_PATH}/lib/third_party" PATTERN "**/source/*" EXCLUDE)
if (NOT USE_SYSTEM_FMT)
@@ -846,11 +1002,27 @@ function(generateSDKDirectory)
if (NOT USE_SYSTEM_NLOHMANN_JSON)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/third_party/nlohmann_json DESTINATION "${SDK_PATH}/lib/third_party")
endif()
if (NOT USE_SYSTEM_BOOST)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/third_party/boost DESTINATION "${SDK_PATH}/lib/third_party")
endif()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/modules DESTINATION "${SDK_PATH}/cmake")
install(FILES ${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake DESTINATION "${SDK_PATH}/cmake")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/sdk/ DESTINATION "${SDK_PATH}")
install(TARGETS libimhex ARCHIVE DESTINATION "${SDK_PATH}/lib")
install(TARGETS tracing ARCHIVE DESTINATION "${SDK_PATH}/lib")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/ui/include DESTINATION "${SDK_PATH}/lib/ui/include")
install(FILES ${CMAKE_SOURCE_DIR}/plugins/ui/CMakeLists.txt DESTINATION "${SDK_PATH}/lib/ui/")
if (WIN32)
install(TARGETS ui ARCHIVE DESTINATION "${SDK_PATH}/lib")
endif()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/fonts/include DESTINATION "${SDK_PATH}/lib/fonts/include")
install(FILES ${CMAKE_SOURCE_DIR}/plugins/fonts/CMakeLists.txt DESTINATION "${SDK_PATH}/lib/fonts/")
if (WIN32)
install(TARGETS fonts ARCHIVE DESTINATION "${SDK_PATH}/lib")
endif()
endfunction()
function(addIncludesFromLibrary target library)
@@ -864,11 +1036,12 @@ function(precompileHeaders target includeFolder)
endif()
file(GLOB_RECURSE TARGET_INCLUDES "${includeFolder}/**/*.hpp")
file(GLOB_RECURSE LIBIMHEX_INCLUDES "${CMAKE_SOURCE_DIR}/lib/libimhex/include/**/*.hpp")
set(SYSTEM_INCLUDES "<algorithm>;<array>;<atomic>;<chrono>;<cmath>;<cstddef>;<cstdint>;<cstdio>;<cstdlib>;<cstring>;<exception>;<filesystem>;<functional>;<iterator>;<limits>;<list>;<map>;<memory>;<optional>;<ranges>;<set>;<stdexcept>;<string>;<string_view>;<thread>;<tuple>;<type_traits>;<unordered_map>;<unordered_set>;<utility>;<variant>;<vector>")
set(INCLUDES "${SYSTEM_INCLUDES};${TARGET_INCLUDES}")
set(INCLUDES "${SYSTEM_INCLUDES};${TARGET_INCLUDES};${LIBIMHEX_INCLUDES}")
string(REPLACE ">" "$<ANGLE-R>" INCLUDES "${INCLUDES}")
target_precompile_headers(${target}
PUBLIC
"$<$<COMPILE_LANGUAGE:CXX>:${INCLUDES}>"
)
endfunction()
endfunction()

View File

@@ -89,4 +89,5 @@ if (CoreClrEmbed_INCLUDE_DIR AND CoreClrEmbed_LIBRARY)
set(CoreClrEmbed_LIBRARIES "${CoreClrEmbed_LIBRARY}" CACHE STRING "CoreClrEmbed libraries" FORCE)
set(CoreClrEmbed_SHARED_LIBRARIES "${CoreClrEmbed_SHARED_LIBRARY}" CACHE STRING "CoreClrEmbed shared libraries" FORCE)
set(CoreClrEmbed_INCLUDE_DIRS "${CoreClrEmbed_INCLUDE_DIR}" CACHE STRING "CoreClrEmbed include directories" FORCE)
set(CoreClrEmbed_VERSION "${CORECLR_RUNTIME_VERSION_FULL}" CACHE STRING "CoreClrEmbed version" FORCE)
endif()

View File

@@ -0,0 +1,60 @@
find_path(LZ4_INCLUDE_DIR
NAMES lz4.h
HINTS "${LZ4_INCLUDEDIR}" "${LZ4_HINTS}/include"
PATHS
/usr/local/include
/usr/include
)
find_library(LZ4_LIBRARY
NAMES lz4 liblz4
HINTS "${LZ4_LIBDIR}" "${LZ4_HINTS}/lib"
PATHS
/usr/local/lib
/usr/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args( LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR )
if( LZ4_FOUND )
include( CheckIncludeFile )
include( CMakePushCheckState )
set( LZ4_INCLUDE_DIRS ${LZ4_INCLUDE_DIR} )
set( LZ4_LIBRARIES ${LZ4_LIBRARY} )
cmake_push_check_state()
set( CMAKE_REQUIRED_INCLUDES ${LZ4_INCLUDE_DIRS} )
check_include_file( lz4frame.h HAVE_LZ4FRAME_H )
cmake_pop_check_state()
if (WIN32)
set ( LZ4_DLL_DIR "${LZ4_HINTS}/bin"
CACHE PATH "Path to LZ4 DLL"
)
file( GLOB _lz4_dll RELATIVE "${LZ4_DLL_DIR}"
"${LZ4_DLL_DIR}/lz4*.dll"
)
set ( LZ4_DLL ${_lz4_dll}
# We're storing filenames only. Should we use STRING instead?
CACHE FILEPATH "LZ4 DLL file name"
)
file( GLOB _lz4_pdb RELATIVE "${LZ4_DLL_DIR}"
"${LZ4_DLL_DIR}/lz4*.pdb"
)
set ( LZ4_PDB ${_lz4_pdb}
CACHE FILEPATH "LZ4 PDB file name"
)
mark_as_advanced( LZ4_DLL_DIR LZ4_DLL LZ4_PDB )
endif()
else()
set( LZ4_INCLUDE_DIRS )
set( LZ4_LIBRARIES )
endif()
mark_as_advanced( LZ4_LIBRARIES LZ4_INCLUDE_DIRS )
add_library( LZ4::lz4 INTERFACE IMPORTED )
set_property( TARGET LZ4::lz4 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIRS} )
set_property( TARGET LZ4::lz4 PROPERTY INTERFACE_LINK_LIBRARIES ${LZ4_LIBRARIES} )

View File

@@ -38,4 +38,8 @@ if (ZSTD_FOUND)
message(STATUS "Found Zstd: ${ZSTD_LIBRARY}")
endif()
mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)
mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)
add_library(ZSTD::zstd INTERFACE IMPORTED)
set_property(TARGET ZSTD::zstd PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR})
set_property(TARGET ZSTD::zstd PROPERTY INTERFACE_LINK_LIBRARIES ${ZSTD_LIBRARY})

View File

@@ -0,0 +1,15 @@
find_path(LIBSSH2_INCLUDE_DIR libssh2.h)
find_library(LIBSSH2_LIBRARY NAMES ssh2 libssh2)
if(LIBSSH2_INCLUDE_DIR)
file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" libssh2_version_str REGEX "^#define[\t ]+LIBSSH2_VERSION[\t ]+\"(.*)\"")
string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1" LIBSSH2_VERSION "${libssh2_version_str}")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibSSH2
REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR
VERSION_VAR LIBSSH2_VERSION)
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)

View File

@@ -26,8 +26,9 @@ SET(MBEDTLS_FIND_QUIETLY TRUE)
FIND_LIBRARY(MBEDTLS_LIBRARY NAMES mbedtls libmbedtls libmbedx509)
FIND_LIBRARY(MBEDX509_LIBRARY NAMES mbedx509 libmbedx509)
FIND_LIBRARY(MBEDCRYPTO_LIBRARY NAMES mbedcrypto libmbedcrypto)
FIND_LIBRARY(TFPSACRYPTO_LIBRARY NAMES libtfpsacrypto tfpsacrypto)
IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND MBEDCRYPTO_LIBRARY)
IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND (MBEDCRYPTO_LIBRARY OR TFPSACRYPTO_LIBRARY))
SET(MBEDTLS_FOUND TRUE)
ENDIF()
@@ -37,10 +38,25 @@ IF(MBEDTLS_FOUND)
GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY} NAME_WE)
GET_FILENAME_COMPONENT(MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY} NAME_WE)
GET_FILENAME_COMPONENT(MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY} NAME_WE)
GET_FILENAME_COMPONENT(TFPSACRYPTO_LIBRARY_FILE ${TFPSACRYPTO_LIBRARY} NAME_WE)
STRING(REGEX REPLACE "^lib" "" MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY_FILE})
STRING(REGEX REPLACE "^lib" "" MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY_FILE})
STRING(REGEX REPLACE "^lib" "" MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE})
SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDCRYPTO_LIBRARY_FILE}")
STRING(REGEX REPLACE "^lib" "" TFPSACRYPTO_LIBRARY_FILE ${TFPSACRYPTO_LIBRARY_FILE})
if (TFPSACRYPTO_LIBRARY)
SET(MBEDTLS_CRYPTO_LIBRARY_FILE ${TFPSACRYPTO_LIBRARY_FILE})
elseif (MBEDCRYPTO_LIBRARY)
SET(MBEDTLS_CRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE})
else ()
MESSAGE(FATAL_ERROR "Could not find mbedTLS Crypto library")
endif()
if (MSVC)
SET(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY_FILE}.lib ${MBEDX509_LIBRARY_FILE}.lib ${MBEDTLS_CRYPTO_LIBRARY_FILE}.lib)
else()
SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDTLS_CRYPTO_LIBRARY_FILE}")
endif()
IF(NOT MBEDTLS_FIND_QUIETLY)
MESSAGE(STATUS "Found mbedTLS:")
@@ -55,9 +71,9 @@ IF(MBEDTLS_FOUND)
MESSAGE(STATUS " Crypto: ${MBEDCRYPTO_LIBRARY}")
ENDIF(NOT MBEDTLS_FIND_QUIETLY)
ELSE(MBEDTLS_FOUND)
IF(MBEDTLS_FIND_REQUIRED)
IF(mbedTLS_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find mbedTLS")
ENDIF(MBEDTLS_FIND_REQUIRED)
ENDIF(mbedTLS_FIND_REQUIRED)
ENDIF(MBEDTLS_FOUND)
MARK_AS_ADVANCED(
@@ -67,4 +83,4 @@ MARK_AS_ADVANCED(
MBEDTLS_LIBRARY
MBEDX509_LIBRARY
MBEDCRYPTO_LIBRARY
)
)

View File

@@ -1,4 +1,5 @@
macro(add_imhex_plugin)
setSDKPaths()
# Parse arguments
set(options LIBRARY_PLUGIN)
set(oneValueArgs NAME IMHEX_VERSION)
@@ -28,95 +29,140 @@ macro(add_imhex_plugin)
endif()
endif()
if (IMHEX_PLUGIN_LIBRARY_PLUGIN)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION "${SDK_PATH}/lib/plugins/${IMHEX_PLUGIN_NAME}")
endif()
# Define new project for plugin
project(${IMHEX_PLUGIN_NAME})
# Create a new shared library for the plugin source code
add_library(${IMHEX_PLUGIN_NAME} ${IMHEX_PLUGIN_LIBRARY_TYPE} ${IMHEX_PLUGIN_SOURCES})
if (IMHEX_PLUGIN_IMPORTED)
add_library(${IMHEX_PLUGIN_NAME} SHARED IMPORTED GLOBAL)
# Add include directories and link libraries
target_include_directories(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_INCLUDES})
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_LIBRARIES})
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE libimhex ${FMT_LIBRARIES} imgui_all_includes libwolv)
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl)
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl-gen)
if (WIN32)
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/${IMHEX_PLUGIN_NAME}${IMHEX_PLUGIN_SUFFIX}"
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/../lib${IMHEX_PLUGIN_NAME}.dll.a"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/include")
elseif (APPLE)
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../../MacOS/plugins/${IMHEX_PLUGIN_NAME}${IMHEX_PLUGIN_SUFFIX}"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/include")
else()
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/${IMHEX_PLUGIN_NAME}${IMHEX_PLUGIN_SUFFIX}"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/include")
endif()
else()
# Create a new shared library for the plugin source code
add_library(${IMHEX_PLUGIN_NAME} ${IMHEX_PLUGIN_LIBRARY_TYPE} ${IMHEX_PLUGIN_SOURCES})
precompileHeaders(${IMHEX_PLUGIN_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/include")
# Add include directories and link libraries
target_include_directories(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_INCLUDES})
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_LIBRARIES})
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE libimhex ${FMT_LIBRARIES} imgui_all_includes libwolv)
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl)
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl-gen)
# Add IMHEX_PROJECT_NAME and IMHEX_VERSION define
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PROJECT_NAME="${IMHEX_PLUGIN_NAME}")
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_VERSION="${IMHEX_VERSION_STRING}")
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PLUGIN_NAME=${IMHEX_PLUGIN_NAME})
precompileHeaders(${IMHEX_PLUGIN_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/include")
# Enable required compiler flags
enableUnityBuild(${IMHEX_PLUGIN_NAME})
setupCompilerFlags(${IMHEX_PLUGIN_NAME})
# Add IMHEX_PROJECT_NAME and IMHEX_VERSION define
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PROJECT_NAME="${IMHEX_PLUGIN_NAME}")
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_VERSION="${IMHEX_VERSION_STRING}")
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PLUGIN_NAME=${IMHEX_PLUGIN_NAME})
# Configure build properties
set_target_properties(${IMHEX_PLUGIN_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${IMHEX_MAIN_OUTPUT_DIRECTORY}/plugins"
CXX_STANDARD 23
PREFIX ""
SUFFIX ${IMHEX_PLUGIN_SUFFIX}
)
# Enable required compiler flags
enableUnityBuild(${IMHEX_PLUGIN_NAME})
setupCompilerFlags(${IMHEX_PLUGIN_NAME})
addCppCheck(${IMHEX_PLUGIN_NAME})
# Set rpath of plugin libraries to the plugins folder
if (APPLE)
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES BUILD_RPATH "@executable_path/../Frameworks;@executable_path/plugins")
endif()
# Setup a romfs for the plugin
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
set(LIBROMFS_PROJECT_NAME ${IMHEX_PLUGIN_NAME})
add_subdirectory(${IMHEX_BASE_FOLDER}/lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/libromfs)
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE ${LIBROMFS_LIBRARY})
foreach(feature ${IMHEX_PLUGIN_FEATURES})
string(TOUPPER ${feature} feature)
add_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature}=0)
endforeach()
# Add the new plugin to the main dependency list so it gets built by default
if (TARGET imhex_all)
add_dependencies(imhex_all ${IMHEX_PLUGIN_NAME})
endif()
if (IMHEX_EXTERNAL_PLUGIN_BUILD)
install(TARGETS ${IMHEX_PLUGIN_NAME} DESTINATION ".")
endif()
# Fix rpath
if (APPLE)
set_target_properties(
${IMHEX_PLUGIN_NAME}
# Configure build properties
set_target_properties(${IMHEX_PLUGIN_NAME}
PROPERTIES
INSTALL_RPATH "@executable_path/../Frameworks;@executable_path/plugins"
RUNTIME_OUTPUT_DIRECTORY "${IMHEX_MAIN_OUTPUT_DIRECTORY}/plugins"
CXX_STANDARD 23
PREFIX ""
SUFFIX ${IMHEX_PLUGIN_SUFFIX}
)
elseif (UNIX)
set(PLUGIN_RPATH "")
list(APPEND PLUGIN_RPATH "$ORIGIN")
if (IMHEX_PLUGIN_ADD_INSTALL_PREFIX_TO_RPATH)
list(APPEND PLUGIN_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# Set rpath of plugin libraries to the plugins folder
if (WIN32)
if (IMHEX_PLUGIN_LIBRARY_PLUGIN)
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
endif()
elseif (APPLE)
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES BUILD_RPATH "@executable_path/../Frameworks;@executable_path/plugins")
endif()
set_target_properties(
${IMHEX_PLUGIN_NAME}
PROPERTIES
# Setup a romfs for the plugin
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
set(LIBROMFS_PROJECT_NAME ${IMHEX_PLUGIN_NAME})
add_subdirectory(${IMHEX_BASE_FOLDER}/lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/libromfs)
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE ${LIBROMFS_LIBRARY})
set(FEATURE_DEFINE_CONTENT)
if (IMHEX_PLUGIN_FEATURES)
list(LENGTH IMHEX_PLUGIN_FEATURES IMHEX_FEATURE_COUNT)
math(EXPR IMHEX_FEATURE_COUNT "${IMHEX_FEATURE_COUNT} - 1" OUTPUT_FORMAT DECIMAL)
foreach(index RANGE 0 ${IMHEX_FEATURE_COUNT} 2)
list(SUBLIST IMHEX_PLUGIN_FEATURES ${index} 2 IMHEX_PLUGIN_FEATURE)
list(GET IMHEX_PLUGIN_FEATURE 0 feature_define)
list(GET IMHEX_PLUGIN_FEATURE 1 feature_description)
string(TOUPPER ${feature_define} feature_define)
add_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature_define}=0)
set(FEATURE_DEFINE_CONTENT "${FEATURE_DEFINE_CONTENT}{ \"${feature_description}\", IMHEX_FEATURE_ENABLED(${feature_define}) },")
endforeach()
endif()
target_compile_options(${IMHEX_PLUGIN_NAME} PRIVATE -DIMHEX_PLUGIN_FEATURES_CONTENT=${FEATURE_DEFINE_CONTENT})
# Add the new plugin to the main dependency list so it gets built by default
if (TARGET imhex_all)
add_dependencies(imhex_all ${IMHEX_PLUGIN_NAME})
endif()
if (IMHEX_EXTERNAL_PLUGIN_BUILD)
install(TARGETS ${IMHEX_PLUGIN_NAME} DESTINATION ".")
endif()
# Fix rpath
if (APPLE)
set_target_properties(
${IMHEX_PLUGIN_NAME}
PROPERTIES
INSTALL_RPATH "@executable_path/../Frameworks;@executable_path/plugins"
)
elseif (UNIX)
set(PLUGIN_RPATH "")
list(APPEND PLUGIN_RPATH "$ORIGIN")
if (IMHEX_PLUGIN_ADD_INSTALL_PREFIX_TO_RPATH)
list(APPEND PLUGIN_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
set_target_properties(
${IMHEX_PLUGIN_NAME}
PROPERTIES
INSTALL_RPATH_USE_ORIGIN ON
INSTALL_RPATH "${PLUGIN_RPATH}"
)
endif()
)
endif()
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt AND IMHEX_ENABLE_UNIT_TESTS AND IMHEX_ENABLE_PLUGIN_TESTS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_NAME}_tests)
target_compile_definitions(${IMHEX_PLUGIN_NAME}_tests PRIVATE IMHEX_PROJECT_NAME="${IMHEX_PLUGIN_NAME}-tests")
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt AND IMHEX_ENABLE_UNIT_TESTS AND IMHEX_ENABLE_PLUGIN_TESTS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_NAME}_tests)
target_compile_definitions(${IMHEX_PLUGIN_NAME}_tests PRIVATE IMHEX_PROJECT_NAME="${IMHEX_PLUGIN_NAME}-tests")
endif()
endif()
endmacro()
macro(add_romfs_resource input output)
if (NOT EXISTS ${input})
message(WARNING "Resource file ${input} does not exist")
endif()
configure_file(${input} ${CMAKE_CURRENT_BINARY_DIR}/romfs/${output} COPYONLY)
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/romfs)
@@ -130,4 +176,4 @@ macro (enable_plugin_feature feature)
remove_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature}=0)
add_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature}=1)
endmacro()
endmacro()

View File

@@ -29,30 +29,45 @@ add_subdirectory_if_exists(lib/third_party/nlohmann_json)
set(NLOHMANN_JSON_LIBRARIES nlohmann_json PARENT_SCOPE)
set(NLOHMANN_JSON_LIBRARIES nlohmann_json)
add_subdirectory_if_exists(lib/third_party/boost)
set(BOOST_LIBRARIES boost::regex PARENT_SCOPE)
set(BOOST_LIBRARIES boost::regex)
add_subdirectory(lib/external/libwolv EXCLUDE_FROM_ALL)
set(LIBPL_ENABLE_CLI OFF CACHE BOOL "" FORCE)
add_subdirectory(lib/external/pattern_language EXCLUDE_FROM_ALL)
find_package(CURL REQUIRED)
find_package(mbedTLS 3.4.0 REQUIRED)
set(CURL_LIBRARIES ${CURL_LIBRARIES} PARENT_SCOPE)
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARIES} PARENT_SCOPE)
set(IMHEX_PLUGIN_IMPORTED ON)
add_subdirectory(lib/libimhex)
add_subdirectory(lib/trace)
add_subdirectory(lib/fonts)
add_subdirectory(lib/ui)
set(IMHEX_PLUGIN_IMPORTED OFF)
if (WIN32)
set_target_properties(libimhex PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../libimhex.dll"
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex.dll.a"
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/liblibimhex.dll.a"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
set_target_properties(tracing PROPERTIES
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/libtracing.a"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/trace/include")
elseif (APPLE)
file(GLOB LIBIMHEX_DYLIB "${CMAKE_CURRENT_SOURCE_DIR}/../../Frameworks/libimhex.*.dylib")
set_target_properties(libimhex PROPERTIES
IMPORTED_LOCATION "${LIBIMHEX_DYLIB}"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
set_target_properties(tracing PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../libtracing.a"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/trace/include")
else()
set_target_properties(libimhex PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../libimhex.so"
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/libimhex.so"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
set_target_properties(tracing PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libtracing.a"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/trace/include")
endif()

View File

@@ -1,7 +1,7 @@
#include <hex/plugin.hpp>
// Browse through the headers in lib/libimhex/include/hex/api/ to see what you can do with the API.
// Most important ones are <hex/api/imhex_api.hpp> and <hex/api/content_registry.hpp>
// Most important ones are the things under imhex_api and content_registry
// This is the main entry point of your plugin. The code in the body of this construct will be executed
// when ImHex starts up and loads the plugin.

146
dist/AppImage/AppImageBuilder.yml vendored Normal file
View File

@@ -0,0 +1,146 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
version: 1
AppDir:
path: .AppDir
app_info:
id: imhex
name: ImHex
icon: imhex
version: "{{VERSION}}"
exec: usr/bin/imhex
exec_args: $@
apt:
arch:
- all
- "{{ARCHITECTURE_PACKAGE}}"
allow_unauthenticated: true
sources:
- sourceline: 'deb [arch=amd64] https://us.archive.ubuntu.com/ubuntu/ noble main restricted universe multiverse'
- sourceline: 'deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe multiverse'
include:
- libgdk-pixbuf2.0-0
- libgdk-pixbuf2.0-common
- shared-mime-info
- librsvg2-common
- libbz2-1.0
- libcap2
- libdbus-1-3
- libfontconfig1
- libgpg-error0
- liblzma5
- libnss-mdns
- libpcre3
- libselinux1
- libtinfo6
- libmd4c-dev
- libmd4c-html0-dev
files:
include:
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libLLVM-13.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libOpenGL.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libX11.so.6"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXau.so.6"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXcomposite.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXcursor.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXdamage.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXdmcp.so.6"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXext.so.6"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXfixes.so.3"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXi.so.6"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXinerama.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXrandr.so.2"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXrender.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXxf86vm.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libatk-1.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libatk-bridge-2.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libatspi.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libblkid.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libbrotlicommon.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libbrotlidec.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libbsd.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libcairo-gobject.so.2"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libcairo.so.2"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libcurl-gnutls.so.4"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libdatrie.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libedit.so.2"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libelf.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libepoxy.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libffi.so.8"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libfontconfig.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libfreetype.so.6"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libfribidi.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgcrypt.so.20"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgdk-3.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgdk_pixbuf-2.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgio-2.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libglfw.so.3"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libglib-2.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgmodule-2.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgmp.so.10"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgnutls.so.30"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgobject-2.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgraphite2.so.3"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libharfbuzz.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libhogweed.so.6"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libicudata.so.70"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libicuuc.so.70"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libidn2.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libjpeg.so.8"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/liblber-2.5.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libldap-2.5.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/liblz4.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmagic.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmbedcrypto.so.7"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmbedtls.so.14"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmbedx509.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmd.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmount.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libnettle.so.8"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libp11-kit.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpango-1.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpangocairo-1.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpangoft2-1.0.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpcre2-8.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpixman-1.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpng16.so.16"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libsasl2.so.2"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libsensors.so.5"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libstdc++.so.6"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libsystemd.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libtasn1.so.6"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libthai.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libunistring.so.2"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libuuid.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libvulkan.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libwayland-client.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libwayland-cursor.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libwayland-egl.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxcb-dri2.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxcb-dri3.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxcb-present.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxcb-sync.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxkbcommon.so.0"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxml2.so.2"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxshmfence.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libzstd.so.1"
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmd4c.so"
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
runtime:
env:
APPDIR_LIBRARY_PATH: '$APPDIR/usr/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu:$APPDIR/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu:$APPDIR/usr/lib:$APPDIR/usr/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders'
GTK_EXE_PREFIX: $APPDIR/usr
GTK_DATA_PREFIX: $APPDIR
XDG_DATA_DIRS: '/usr/local/share:/usr/share:$APPDIR/usr/share:$XDG_DATA_DIRS:$APPDIR/usr/local/share:$APPDIR/usr/local/lib:$APPDIR/usr/local/share'
XDG_CONFIG_DIRS: '$XDG_CONFIG_DIRS:$APPDIR/usr/local/share'
AppImage:
arch: "{{ARCHITECTURE_APPIMAGE_BUILDER}}"
comp: zstd
update-information: gh-releases-zsync|WerWolv|ImHex|latest|imhex-*-{{ARCHITECTURE_FILE_NAME}}.AppImage.zsync
file_name: imhex-{{VERSION}}-{{ARCHITECTURE_FILE_NAME}}.AppImage

93
dist/AppImage/Dockerfile vendored Normal file
View File

@@ -0,0 +1,93 @@
FROM ubuntu:24.04 as build
# Used to invalidate layer cache but not mount cache
# See https://github.com/moby/moby/issues/41715#issuecomment-733976493
ARG UNIQUEKEY 1
COPY dist/get_deps_debian.sh /tmp
RUN --mount=type=cache,target=/var/apt/cache <<EOF
# Install apt dependencies
set -xe
apt update
# general deps
apt install -y ccache git wget
# appimage tools deps
apt install -y python3-pip python3-venv python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse ninja-build
apt install -y squashfs-tools zsync
# imhex deps
/tmp/get_deps_debian.sh
EOF
ENV PATH="/cache/bin/:${PATH}"
# Copy Imhex source
COPY . /imhex
ARG LTO=ON
ARG BUILD_TYPE=RelWithDebInfo
ARG GIT_COMMIT_HASH
ARG GIT_BRANCH
ARG ARCHITECTURE_PACKAGE=x86_64
ARG ARCHITECTURE_FILE_NAME=amd64
ARG ARCHITECTURE_APPIMAGE_BUILDER=x86_64
WORKDIR /build
# Ubuntu sh doesnt support string substitution
SHELL ["bash", "-c"]
RUN <<EOF
# Prepare ImHex build
set -xe
CC=gcc-14 CXX=g++-14 cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
-DIMHEX_COMMIT_HASH_LONG="${GIT_COMMIT_HASH}" \
-DIMHEX_COMMIT_BRANCH="${GIT_BRANCH}" \
-DIMHEX_ENABLE_LTO=${LTO} \
-DIMHEX_BUNDLE_PLUGIN_SDK=OFF \
`# To prevent using a libdir with an architecture-specific name` \
-DCMAKE_INSTALL_LIBDIR="lib" \
/imhex
EOF
ENV CCACHE_DIR /cache/ccache
RUN --mount=type=cache,target=/cache <<EOF
# Build Imhex
set -xe
ccache -zs
DESTDIR=AppDir ninja install
ccache -s
EOF
RUN <<EOF
# Download appimage-builder
set -xe
mkdir -p /cache/bin
wget -nc https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O /cache/bin/appimagetool || true
chmod +x /cache/bin/appimagetool
python3 -m venv venv
. venv/bin/activate
pip3 install git+https://github.com/AppImageCrafters/appimage-builder@e995e8e
# Package ImHex as AppImage
export VERSION=$(cat /imhex/VERSION)
export ARCHITECTURE_PACKAGE=${ARCHITECTURE_PACKAGE}
export ARCHITECTURE_FILE_NAME=${ARCHITECTURE_FILE_NAME}
export ARCHITECTURE_APPIMAGE_BUILDER=${ARCHITECTURE_APPIMAGE_BUILDER}
appimage-builder --recipe /imhex/dist/AppImage/AppImageBuilder.yml
EOF
FROM scratch
# Copy build artifact
COPY --from=build /build/*.AppImage /build/*.AppImage.zsync ./

View File

@@ -1,137 +0,0 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
version: 1
AppDir:
path: .AppDir
app_info:
id: imhex
name: ImHex
icon: imhex
version: "{{VERSION}}"
exec: usr/bin/imhex
exec_args: $@
apt:
arch:
- amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy universe
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates universe
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy multiverse
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted
universe multiverse
- sourceline: deb http://security.ubuntu.com/ubuntu jammy-security main restricted
- sourceline: deb http://security.ubuntu.com/ubuntu jammy-security universe
- sourceline: deb http://security.ubuntu.com/ubuntu jammy-security multiverse
include:
- librsvg2-common
- libbz2-1.0:amd64
- libcap2:amd64
- libdbus-1-3:amd64
- libgpg-error0:amd64
- liblzma5:amd64
- libnss-mdns:amd64
- libpcre3:amd64
- libselinux1:amd64
- libtinfo6:amd64
files:
include:
- /lib/x86_64-linux-gnu/libLLVM-13.so.1
- /lib/x86_64-linux-gnu/libOpenGL.so.0
- /lib/x86_64-linux-gnu/libX11.so.6
- /lib/x86_64-linux-gnu/libXau.so.6
- /lib/x86_64-linux-gnu/libXcomposite.so.1
- /lib/x86_64-linux-gnu/libXcursor.so.1
- /lib/x86_64-linux-gnu/libXdamage.so.1
- /lib/x86_64-linux-gnu/libXdmcp.so.6
- /lib/x86_64-linux-gnu/libXext.so.6
- /lib/x86_64-linux-gnu/libXfixes.so.3
- /lib/x86_64-linux-gnu/libXi.so.6
- /lib/x86_64-linux-gnu/libXinerama.so.1
- /lib/x86_64-linux-gnu/libXrandr.so.2
- /lib/x86_64-linux-gnu/libXrender.so.1
- /lib/x86_64-linux-gnu/libXxf86vm.so.1
- /lib/x86_64-linux-gnu/libatk-1.0.so.0
- /lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0
- /lib/x86_64-linux-gnu/libatspi.so.0
- /lib/x86_64-linux-gnu/libblkid.so.1
- /lib/x86_64-linux-gnu/libbrotlicommon.so.1
- /lib/x86_64-linux-gnu/libbrotlidec.so.1
- /lib/x86_64-linux-gnu/libbsd.so.0
- /lib/x86_64-linux-gnu/libcairo-gobject.so.2
- /lib/x86_64-linux-gnu/libcairo.so.2
- /lib/x86_64-linux-gnu/libcurl-gnutls.so.4
- /lib/x86_64-linux-gnu/libdatrie.so.1
- /lib/x86_64-linux-gnu/libedit.so.2
- /lib/x86_64-linux-gnu/libelf.so.1
- /lib/x86_64-linux-gnu/libepoxy.so.0
- /lib/x86_64-linux-gnu/libffi.so.8
- /lib/x86_64-linux-gnu/libfontconfig.so.1
- /lib/x86_64-linux-gnu/libfreetype.so.6
- /lib/x86_64-linux-gnu/libfribidi.so.0
- /lib/x86_64-linux-gnu/libgcrypt.so.20
- /lib/x86_64-linux-gnu/libgdk-3.so.0
- /lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
- /lib/x86_64-linux-gnu/libgio-2.0.so.0
- /lib/x86_64-linux-gnu/libglfw.so.3
- /lib/x86_64-linux-gnu/libglib-2.0.so.0
- /lib/x86_64-linux-gnu/libgmodule-2.0.so.0
- /lib/x86_64-linux-gnu/libgmp.so.10
- /lib/x86_64-linux-gnu/libgnutls.so.30
- /lib/x86_64-linux-gnu/libgobject-2.0.so.0
- /lib/x86_64-linux-gnu/libgraphite2.so.3
- /lib/x86_64-linux-gnu/libharfbuzz.so.0
- /lib/x86_64-linux-gnu/libhogweed.so.6
- /lib/x86_64-linux-gnu/libicudata.so.70
- /lib/x86_64-linux-gnu/libicuuc.so.70
- /lib/x86_64-linux-gnu/libidn2.so.0
- /lib/x86_64-linux-gnu/libjpeg.so.8
- /lib/x86_64-linux-gnu/liblber-2.5.so.0
- /lib/x86_64-linux-gnu/libldap-2.5.so.0
- /lib/x86_64-linux-gnu/liblz4.so.1
- /lib/x86_64-linux-gnu/libmagic.so.1
- /lib/x86_64-linux-gnu/libmbedcrypto.so.7
- /lib/x86_64-linux-gnu/libmbedtls.so.14
- /lib/x86_64-linux-gnu/libmbedx509.so.1
- /lib/x86_64-linux-gnu/libmd.so.0
- /lib/x86_64-linux-gnu/libmount.so.1
- /lib/x86_64-linux-gnu/libnettle.so.8
- /lib/x86_64-linux-gnu/libp11-kit.so.0
- /lib/x86_64-linux-gnu/libpango-1.0.so.0
- /lib/x86_64-linux-gnu/libpangocairo-1.0.so.0
- /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
- /lib/x86_64-linux-gnu/libpcre2-8.so.0
- /lib/x86_64-linux-gnu/libpixman-1.so.0
- /lib/x86_64-linux-gnu/libpng16.so.16
- /lib/x86_64-linux-gnu/libsasl2.so.2
- /lib/x86_64-linux-gnu/libsensors.so.5
- /lib/x86_64-linux-gnu/libstdc++.so.6
- /lib/x86_64-linux-gnu/libsystemd.so.0
- /lib/x86_64-linux-gnu/libtasn1.so.6
- /lib/x86_64-linux-gnu/libthai.so.0
- /lib/x86_64-linux-gnu/libunistring.so.2
- /lib/x86_64-linux-gnu/libuuid.so.1
- /lib/x86_64-linux-gnu/libvulkan.so.1
- /lib/x86_64-linux-gnu/libwayland-client.so.0
- /lib/x86_64-linux-gnu/libwayland-cursor.so.0
- /lib/x86_64-linux-gnu/libwayland-egl.so.1
- /lib/x86_64-linux-gnu/libxcb-dri2.so.0
- /lib/x86_64-linux-gnu/libxcb-dri3.so.0
- /lib/x86_64-linux-gnu/libxcb-present.so.0
- /lib/x86_64-linux-gnu/libxcb-sync.so.1
- /lib/x86_64-linux-gnu/libxkbcommon.so.0
- /lib/x86_64-linux-gnu/libxml2.so.2
- /lib/x86_64-linux-gnu/libxshmfence.so.1
- /lib/x86_64-linux-gnu/libzstd.so.1
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
AppImage:
arch: x86_64
update-information: gh-releases-zsync|WerWolv|ImHex|latest|imhex-*-x86_64.AppImage.zsync
file_name: imhex-{{VERSION}}-x86_64.AppImage

View File

@@ -13,10 +13,13 @@ RUN pacman -S --needed --noconfirm \
glfw-x11 \
file \
mbedtls \
fontconfig \
freetype2 \
curl \
dbus \
xdg-desktop-portal
xdg-desktop-portal \
libssh2 \
md4c
# Clone ImHex
RUN git clone https://github.com/WerWolv/ImHex --recurse-submodules /root/ImHex

6
dist/Arch/PKGBUILD vendored
View File

@@ -8,8 +8,8 @@ pkgdesc="A Hex Editor for Reverse Engineers, Programmers and people who value th
arch=("x86_64")
url="https://github.com/WerWolv/ImHex"
license=('GPL2')
depends=(glfw mbedtls freetype2 libglvnd dbus gtk3 curl fmt yara nlohmann-json zlib bzip2 xz zstd)
makedepends=(git)
depends=(glfw mbedtls fontconfig freetype2 libglvnd dbus gtk3 curl fmt yara zlib bzip2 xz zstd libssh2)
makedepends=(git nlohmann-json)
provides=(imhex)
conflicts=(imhex)
source=("$url/releases/download/v$pkgver/imhex-$pkgver-ArchLinux-x86_64.pkg.tar.zst")
@@ -26,5 +26,5 @@ package() {
install -d "$pkgdir/usr/share/imhex"
cp -r "$srcdir/usr/share/imhex/"{constants,encodings,includes,magic,patterns} "$pkgdir/usr/share/imhex"
cp -r "$srcdir/usr/share/"{applications,licenses,pixmaps} "$pkgdir/usr/share"
cp -r "$srcdir/usr/share/"{applications,licenses,pixmaps,mime} "$pkgdir/usr/share"
}

View File

@@ -4,7 +4,7 @@ Section: editors
Priority: optional
Architecture: amd64
License: GNU GPL-2
Depends: libglfw3 | libglfw3-wayland, libmagic1, libmbedtls14, libfreetype6, libopengl0, libdbus-1-3, xdg-desktop-portal
Depends: libfontconfig1, libglfw3 | libglfw3-wayland, libmagic1, libmbedtls14, libfreetype6, libopengl0, libdbus-1-3, xdg-desktop-portal, libssh2-1, libmd4c0
Maintainer: WerWolv <hey@werwolv.net>
Description: ImHex Hex Editor
A Hex Editor for Reverse Engineers, Programmers and

View File

@@ -20,13 +20,17 @@ DEPEND=""
RDEPEND="${DEPEND}
media-libs/glfw
sys-apps/file
dev-libs/mbedtls
dev-cpp/nlohmann_json
dbus
xdg-desktop-portal
net-libs/mbedtls
sys-apps/dbus
sys-apps/xdg-desktop-portal
sys-libs/zlib
app-arch/bzip2
app-arch/lzma
app-arch/zstd
app-arch/bzip2
app-arch/lzma
app-arch/zstd
app-arch/lz4
net-libs/libssh2
dev-libs/md4c
"
BDEPEND="${DEPEND}
dev-cpp/nlohmann_json
"
BDEPEND="${DEPEND}"

13
dist/ImHex.run.xml vendored Normal file
View File

@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ImHex" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$CMakeCurrentBuildDir$" PASS_PARENT_ENVS_2="true" PROJECT_NAME="ImHex" TARGET_NAME="imhex_all" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="ImHex" RUN_TARGET_NAME="main">
<envs>
<env name="NO_DEBUG_BANNER" value="1" />
</envs>
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
<configuration default="false" name="CMake Debug" type="CMakeListConfigurationType" factoryName="CMakeListConfigurationFactory">
<method v="2" />
</configuration>
</component>

View File

@@ -1,84 +0,0 @@
FROM ubuntu:22.04 as build
# Used to invalidate layer cache but not mount cache
# See https://github.com/moby/moby/issues/41715#issuecomment-733976493
ARG UNIQUEKEY 1
COPY dist/get_deps_debian.sh /tmp
RUN --mount=type=cache,target=/var/apt/cache <<EOF
# Install apt dependencies
set -xe
apt update
# general deps
apt install -y ccache git wget
# appimage tools deps
apt install -y python3-pip python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse ninja-build
apt install -y squashfs-tools zsync
# imhex deps
/tmp/get_deps_debian.sh
EOF
RUN --mount=type=cache,target=/cache <<EOF
# Download appimage-builder
set -xe
mkdir -p /cache/bin
wget -nc https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /cache/bin/appimagetool || true
chmod +x /cache/bin/appimagetool
pip3 install git+https://github.com/AppImageCrafters/appimage-builder@f38699e
EOF
ENV PATH="/cache/bin/:${PATH}"
# Copy Imhex source
COPY . /imhex
ARG LTO=ON
ARG BUILD_TYPE=RelWithDebInfo
ARG GIT_COMMIT_HASH
ARG GIT_BRANCH
WORKDIR /build
SHELL ["bash", "-c"] # Ubuntu sh doesnt support string substitution
RUN <<EOF
# Prepare ImHex build
set -xe
CC=gcc-12 CXX=g++-12 cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
-DIMHEX_COMMIT_HASH_LONG="${GIT_COMMIT_HASH}" \
-DIMHEX_COMMIT_BRANCH="${GIT_BRANCH}" \
-DIMHEX_ENABLE_LTO=${LTO} \
-DIMHEX_PLUGINS_IN_SHARE=ON \
/imhex
EOF
ENV CCACHE_DIR /cache/ccache
RUN --mount=type=cache,target=/cache <<EOF
# Build Imhex
set -xe
ccache -zs
DESTDIR=AppDir ninja install
ccache -s
EOF
RUN <<EOF
# Package ImHex as AppImage
set -xe
export VERSION=$(cat /imhex/VERSION)
appimage-builder --recipe /imhex/dist/AppImageBuilder.yml
EOF
FROM scratch
# Copy build artifact
COPY --from=build /build/*.AppImage /build/*.AppImage.zsync ./

3
dist/cli/imhex.bat vendored Normal file
View File

@@ -0,0 +1,3 @@
@echo off
start "" "%~dp0..\imhex.exe" %*

5
dist/cli/imhex.sh vendored Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
script_path=$(readlink -f "$0")
script_dir=$(dirname "${script_path}")
"${script_dir}/../imhex" "$@" > /dev/null 2>&1 &

View File

@@ -9,7 +9,7 @@ On Linux, ImHex is built through regular GCC (or optionally Clang).
cd ImHex
mkdir -p build
cd build
CC=gcc-12 CXX=g++-12 \
CC=gcc-14 CXX=g++-14 \
cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/usr" \

View File

@@ -3,7 +3,7 @@
On macOS, ImHex is built through regular GCC and LLVM clang.
1. Clone the repo using `git clone https://github.com/WerWolv/ImHex --recurse-submodules`
2. Install all the dependencies using `brew bundle --no-lock --file dist/Brewfile`
2. Install all the dependencies using `brew bundle --no-lock --file dist/macOS/Brewfile`
3. Build ImHex itself using the following commands:
```sh
cd ImHex
@@ -19,4 +19,4 @@ cmake -G "Ninja" \
-DIMHEX_GENERATE_PACKAGE=ON \
..
ninja install
```
```

20
dist/cppcheck.supp vendored Normal file
View File

@@ -0,0 +1,20 @@
missingIncludeSystem
constParameter
unusedFunction
preprocessorErrorDirective
checkersReport
noExplicitConstructor
unmatchedSuppression
useInitializationList
useStlAlgorithm
knownConditionTrueFalse
internalAstError
unsignedPositive
variableScope
unusedPrivateFunction
constParameterCallback
*:*/lib/third_party/*
*:*/external/pattern_language/external/*
*:*/external/disassembler/external/*
*:*/lib/libimhex/source/ui/imgui_imhex_extensions.cpp

54
dist/flake.nix vendored Normal file
View File

@@ -0,0 +1,54 @@
{
description = "ImHex";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in {
devShells = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
buildInputs = [
pkgs.cmake
pkgs.clang
pkgs.lld
pkgs.nghttp3
pkgs.pkg-config
pkgs.glfw
pkgs.fontconfig
pkgs.file
pkgs.mbedtls
pkgs.freetype
pkgs.dbus
pkgs.gtk3
pkgs.curl
pkgs.fmt
pkgs.yara
pkgs.nlohmann_json
pkgs.ninja
pkgs.zlib
pkgs.bzip2
pkgs.xz
pkgs.zstd
pkgs.lz4
pkgs.libssh2
pkgs.md4c
];
shellHook = ''
export CC=${pkgs.clang}/bin/clang
export CXX=${pkgs.clang}/bin/clang++
'';
};
});
};
}

139
dist/flatpak/net.werwolv.ImHex.yaml vendored Normal file
View File

@@ -0,0 +1,139 @@
app-id: net.werwolv.ImHex
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
command: imhex
rename-desktop-file: imhex.desktop
finish-args:
- --share=ipc
- --share=network
- --socket=wayland
- --socket=fallback-x11
- --filesystem=host
- --device=dri
modules:
- name: glfw
buildsystem: cmake-ninja
builddir: true
config-opts:
- -DBUILD_SHARED_LIBS=ON
- -DGLFW_BUILD_EXAMPLES=OFF
- -DGLFW_BUILD_TESTS=OFF
- -DGLFW_BUILD_DOCS=OFF
sources:
- type: archive
url: https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip
sha256: b5ec004b2712fd08e8861dc271428f048775200a2df719ccf575143ba749a3e9
cleanup:
- /include
- /lib/pkgconfig
- /lib/pkgconfig
- /lib64/pkgconfig
- /lib/cmake
- /lib64/cmake
- name: mbedtls
buildsystem: cmake-ninja
config-opts:
- -DCMAKE_C_FLAGS=-fPIC
- -DENABLE_TESTING=OFF
- -DENABLE_PROGRAMS=OFF
sources:
- type: archive
url: https://github.com/ARMmbed/mbedtls/archive/refs/tags/v3.4.0.tar.gz
sha256: 1b899f355022e8d02c4d313196a0a16af86c5a692456fa99d302915b8cf0320a
cleanup:
- /include
- /lib/pkgconfig
- /lib64/pkgconfig
- /lib/cmake
- /lib64/cmake
- name: fmt
buildsystem: cmake-ninja
config-opts:
- -DBUILD_SHARED_LIBS=ON
- -DFMT_TEST=OFF
sources:
- type: archive
url: https://github.com/fmtlib/fmt/releases/download/10.0.0/fmt-10.0.0.zip
sha256: 4943cb165f3f587f26da834d3056ee8733c397e024145ca7d2a8a96bb71ac281
cleanup:
- /include
- /lib/pkgconfig
- /lib64/pkgconfig
- /lib/cmake
- /lib64/cmake
- name: yara
buildsystem: autotools
sources:
- type: git
url: https://github.com/VirusTotal/yara.git
tag: v4.3.1
commit: a6f6ce1d6d74a03c396660db25765f2a794d9e30
cleanup:
- /include
- /lib/pkgconfig
- /lib64/pkgconfig
- /lib/cmake
- /lib64/cmake
- name: libssh2
buildsystem: cmake-ninja
config-opts:
- -DBUILD_SHARED_LIBS=ON
- -DENABLE_ZLIB_COMPRESSION=OFF
- -DENABLE_MANUAL=OFF
- -DENABLE_EXAMPLES=OFF
- -DENABLE_TESTING=OFF
sources:
- type: git
url: https://github.com/libssh2/libssh2.git
tag: libssh2-1.11.1
cleanup:
- /include
- /lib/pkgconfig
- /lib64/pkgconfig
- /lib/cmake
- /lib64/cmake
- name: md4c
buildsystem: cmake-ninja
config-opts:
- -DBUILD_SHARED_LIBS=ON
- -DMD4C_BUILD_TESTS=OFF
- -DMD4C_BUILD_EXAMPLES=OFF
- -DMD4C_BUILD_DOCS=OFF
sources:
- type: git
url: https://github.com/mity/md4c.git
tag: release-0.5.2
- name: imhex
buildsystem: cmake-ninja
builddir: true
config-opts:
- -DUSE_SYSTEM_CURL=ON
- -DUSE_SYSTEM_FMT=ON
- -DUSE_SYSTEM_YARA=ON
- -DIMHEX_OFFLINE_BUILD=ON
- -DIMHEX_BUNDLE_PLUGIN_SDK=OFF
- -DCMAKE_INSTALL_LIBDIR=lib
- -DCMAKE_INSTALL_RPATH='$ORIGIN/../lib:$ORIGIN/../lib64'
sources:
- type: dir
path: ../..
- type: git
url: https://github.com/WerWolv/ImHex-Patterns.git
tag: master
dest: ImHex-Patterns
x-checker-data:
type: git
tag-pattern: ^ImHex-v([\d.]+)$
post-install:
- mkdir -p ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps
- cp ${FLATPAK_DEST}/share/pixmaps/imhex.svg ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/${FLATPAK_ID}.svg
- desktop-file-edit --set-key="Icon" --set-value="${FLATPAK_ID}" "${FLATPAK_DEST}/share/applications/imhex.desktop"

69
dist/fonts/move_private_use_area.py vendored Normal file
View File

@@ -0,0 +1,69 @@
from fontTools.ttLib import TTFont
from fontTools.ttLib.tables._c_m_a_p import CmapSubtable
import argparse
# Default PUAs
SOURCE_PUA_START = 0xEA00
SOURCE_PUA_END = 0x100F2
TARGET_PUA_START = 0xF0000
def move_pua_glyphs(input_font_path, output_font_path):
font = TTFont(input_font_path)
cmap_table = font['cmap']
glyph_set = font.getGlyphSet()
# Track moved glyphs
moved = 0
new_mapping = {}
# Collect original mappings in the PUA
for cmap in cmap_table.tables:
if cmap.isUnicode():
for codepoint, glyph_name in cmap.cmap.items():
if SOURCE_PUA_START <= codepoint <= SOURCE_PUA_END:
offset = codepoint - SOURCE_PUA_START
new_codepoint = TARGET_PUA_START + offset
new_mapping[new_codepoint] = glyph_name
moved += 1
if moved == 0:
print("No glyphs found in the source Private Use Area.")
return
# Remove old PUA entries from existing cmap subtables
for cmap in cmap_table.tables:
if cmap.isUnicode():
cmap.cmap = {
cp: gn for cp, gn in cmap.cmap.items()
if not (SOURCE_PUA_START <= cp <= SOURCE_PUA_END)
}
# Create or update a format 12 cmap subtable
found_format12 = False
for cmap in cmap_table.tables:
if cmap.format == 12 and cmap.platformID == 3 and cmap.platEncID in (10, 1):
cmap.cmap.update(new_mapping)
found_format12 = True
break
if not found_format12:
# Create a new format 12 subtable
cmap12 = CmapSubtable.newSubtable(12)
cmap12.platformID = 3
cmap12.platEncID = 10 # UCS-4
cmap12.language = 0
cmap12.cmap = new_mapping
cmap_table.tables.append(cmap12)
print(f"Moved {moved} glyphs from U+{SOURCE_PUA_START:X}U+{SOURCE_PUA_END:X} to U+{TARGET_PUA_START:X}+")
font.save(output_font_path)
print(f"Saved modified font to {output_font_path}")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Move PUA glyphs in a TTF file to another Unicode range.")
parser.add_argument("input", help="Input TTF file path")
parser.add_argument("output", help="Output TTF file path")
args = parser.parse_args()
move_pua_glyphs(args.input, args.output)

60
dist/fonts/ttf_to_header_file.py vendored Normal file
View File

@@ -0,0 +1,60 @@
import argparse
from fontTools.ttLib import TTFont
import os
def unicode_to_utf8_escape(codepoint):
return ''.join([f'\\x{b:02x}' for b in chr(codepoint).encode('utf-8')])
def format_macro_name(prefix, glyph_name):
# Convert names like 'repo-forked' -> 'ICON_VS_REPO_FORKED'
return "ICON_" + prefix + "_" + glyph_name.upper().replace('-', '_')
def generate_font_header(font_path, output_path, font_macro_name, font_file_macro):
font = TTFont(font_path)
# Use cmap to get Unicode to glyph mapping
codepoint_to_names = {}
for table in font["cmap"].tables:
if table.isUnicode():
for codepoint, glyph_name in table.cmap.items():
codepoint_to_names.setdefault(codepoint, []).append(glyph_name)
if not codepoint_to_names:
print("No Unicode-mapped glyphs found in the font.")
return
# Remove any glyph that is lower than 0xFF
codepoint_to_names = {cp: names for cp, names in codepoint_to_names.items() if cp >= 0xFF}
min_cp = min(codepoint_to_names)
max_cp = max(codepoint_to_names)
with open(output_path, "w", encoding="utf-8") as out:
out.write("#pragma once\n\n")
out.write(f'#define FONT_ICON_FILE_NAME_{font_macro_name} "{font_file_macro}"\n\n')
out.write(f"#define ICON_MIN_{font_macro_name} 0x{min_cp:04x}\n")
out.write(f"#define ICON_MAX_16_{font_macro_name} 0x{max_cp:04x}\n")
out.write(f"#define ICON_MAX_{font_macro_name} 0x{max_cp:04x}\n")
written = set()
for codepoint in sorted(codepoint_to_names):
utf8 = unicode_to_utf8_escape(codepoint)
comment = f"// U+{codepoint:04X}"
glyph_names = sorted(set(codepoint_to_names[codepoint]))
for i, glyph_name in enumerate(glyph_names):
macro = format_macro_name(font_macro_name, glyph_name)
if macro in written:
continue
out.write(f"#define {macro} \"{utf8}\"\t{comment}\n")
written.add(macro)
print(f"Header generated at {output_path}")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate C header file from TTF glyphs.")
parser.add_argument("font", help="Input .ttf font file")
parser.add_argument("output", help="Output .h file")
parser.add_argument("macro_name", help="Macro prefix")
args = parser.parse_args()
generate_font_header(args.font, args.output, args.macro_name, os.path.basename(args.font))

View File

@@ -32,11 +32,17 @@ def main(args: list) -> int:
sorted_commits = {}
for commit in master_commits:
category, commit_name = commit.split(":", 1)
if commit == "":
continue
if category not in sorted_commits:
sorted_commits[category] = []
sorted_commits[category].append(commit_name)
try:
category, commit_name = commit.split(":", 1)
if category not in sorted_commits:
sorted_commits[category] = []
sorted_commits[category].append(commit_name)
except:
print(f"Failed to parse commit: {commit}")
for category in sorted_commits:
print(f"## {category}\n")

View File

@@ -5,6 +5,7 @@ pacman -S $@ --needed \
gcc \
lld \
glfw \
fontconfig \
file \
mbedtls \
freetype2 \
@@ -18,4 +19,7 @@ pacman -S $@ --needed \
zlib \
bzip2 \
xz \
zstd
zstd \
lz4 \
libssh2 \
md4c

View File

@@ -8,8 +8,8 @@ fi
apt install -y \
build-essential \
gcc-12 \
g++-12 \
gcc-14 \
g++-14 \
lld \
${PKGCONF:-} \
cmake \
@@ -18,6 +18,7 @@ apt install -y \
libglm-dev \
libmagic-dev \
libmbedtls-dev \
libfontconfig-dev \
libfreetype-dev \
libdbus-1-dev \
libcurl4-gnutls-dev \
@@ -26,4 +27,8 @@ apt install -y \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
libzstd-dev
libzstd-dev \
liblz4-dev \
libssh2-1-dev \
libmd4c-dev \
libmd4c-html0-dev

View File

@@ -4,6 +4,7 @@ dnf install -y \
cmake \
dbus-devel \
file-devel \
fontconfig-devel \
freetype-devel \
libcurl-devel \
gcc-c++ \
@@ -16,4 +17,6 @@ dnf install -y \
libzstd-devel \
zlib-devel \
bzip2-devel \
xz-devel
xz-devel \
lz4-devel \
libssh2-devel

View File

@@ -1,20 +1,23 @@
#!/usr/bin/env sh
pacman -S --needed --noconfirm pactoys
pacman -S --needed --noconfirm pactoys unzip git
pacboy -S --needed --noconfirm \
gcc:p \
lld:p \
cmake:p \
ccache:p \
glfw:p \
file:p \
curl-winssl:p \
mbedtls:p \
freetype:p \
dlfcn:p \
ninja:p \
capstone:p \
zlib:p \
bzip2:p \
xz:p \
zstd:p
gcc:p \
lld:p \
cmake:p \
ccache:p \
glfw:p \
file:p \
curl-winssl:p \
mbedtls:p \
freetype:p \
dlfcn:p \
ninja:p \
capstone:p \
zlib:p \
bzip2:p \
xz:p \
zstd:p \
lz4:p \
libssh2-wincng:p \
md4c:p

View File

@@ -3,8 +3,9 @@
zypper install \
cmake \
ninja \
gcc12 \
gcc12-c++ \
gcc14 \
gcc14-c++ \
fontconfig-devel \
freetype2-devel \
libcurl-devel \
dbus-1-devel \
@@ -16,4 +17,7 @@ zypper install \
libzstd-devel \
zlib-devel \
bzip3-devel \
xz-devel
xz-devel \
lz4-dev \
libssh2-devel \
md4c-devel

7
dist/imhex.desktop vendored
View File

@@ -1,4 +1,5 @@
[Desktop Entry]
Version=1.0
Name=ImHex
Comment=ImHex Hex Editor
GenericName=Hex Editor
@@ -9,3 +10,9 @@ StartupNotify=true
Categories=Development;IDE;
StartupWMClass=imhex
Keywords=static-analysis;reverse-engineering;disassembler;disassembly;hacking;forensics;hex-editor;cybersecurity;security;binary-analysis;
MimeType=application/vnd.imhex.proj;
Actions=NewFile;
[Desktop Action NewFile]
Exec=imhex --new
Name=Create New File

8
dist/imhex.mime.xml vendored Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/vnd.imhex.proj">
<comment>ImHex Project</comment>
<glob pattern="*.hexproj"/>
</mime-type>
</mime-info>

61
dist/langtool.py vendored
View File

@@ -92,18 +92,7 @@ def main():
with lang_file_path.open("w", encoding="utf-8") as new_lang_file:
new_lang_data = {
"code": lang,
"language": (
exist_lang_data["language"]
if exist_lang_data
else input("Enter language name: ")
),
"country": (
exist_lang_data["country"]
if exist_lang_data
else input("Enter country name: ")
),
"translations": {},
}
json.dump(new_lang_data, new_lang_file, indent=4, ensure_ascii=False)
@@ -124,21 +113,24 @@ def main():
with lang_file_path.open("r+", encoding="utf-8") as target_lang_file:
lang_data = json.load(target_lang_file)
for key, value in default_lang_data["translations"].items():
for key, value in default_lang_data.items():
has_translation = (
key in lang_data["translations"]
and lang_data["translations"][key] != INVALID_TRANSLATION
key in lang_data
and lang_data[key] != INVALID_TRANSLATION
)
if not has_translation and not (
(command == "retranslate" or command == "untranslate")
and re.compile(args.keys).fullmatch(key)
if (
has_translation
and not (
(command == "retranslate" or command == "untranslate")
and re.compile(args.keys).fullmatch(key)
)
and not command == "fmtzh"
):
continue
if command == "check":
print(
f"Error: Translation {lang_data['code']} is missing translation for key '{key}'"
f"Error: Translation {lang_file_path} is missing translation for key '{key}'"
)
exit(2)
elif (
command == "translate"
or command == "retranslate"
@@ -147,42 +139,45 @@ def main():
if command == "untranslate" and not has_translation:
continue
reference_tranlsation = (
" '%s'" % reference_lang_data["translations"][key]
if reference_lang_data
" '%s'" % reference_lang_data[key]
if (
reference_lang_data
and key in reference_lang_data
)
else ""
)
print(
f"\033[1m'{key}' '{value}'{reference_tranlsation}\033[0m => {lang_data['language']}",
f"\033[1m'{key}' '{value}'{reference_tranlsation}\033[0m => ",
end="",
)
if has_translation:
translation = lang_data["translations"][key]
translation = lang_data[key]
print(f" <= \033[1m'{translation}'\033[0m")
print() # for a new line
if command == "untranslate":
lang_data["translations"][key] = INVALID_TRANSLATION
lang_data[key] = INVALID_TRANSLATION
continue
try:
new_value = input("=> ")
lang_data["translations"][key] = new_value
lang_data[key] = new_value
except KeyboardInterrupt:
break
elif command == "update" or command == "create":
lang_data["translations"][key] = INVALID_TRANSLATION
lang_data[key] = INVALID_TRANSLATION
elif command == "fmtzh":
if has_translation:
lang_data["translations"][key] = fmtzh(
lang_data["translations"][key]
lang_data[key] = fmtzh(
lang_data[key]
)
keys_to_remove = []
for key, value in lang_data["translations"].items():
if key not in default_lang_data["translations"]:
for key, value in lang_data.items():
if key not in default_lang_data:
keys_to_remove.append(key)
for key in keys_to_remove:
lang_data["translations"].pop(key)
lang_data.pop(key)
print(
f"Removed unused key '{key}' from translation '{lang_data['code']}'"
f"Removed unused key '{key}' from translation '{lang_file_path}'"
)
target_lang_file.seek(0)

View File

@@ -1,5 +1,5 @@
From 9c8665af4c2e2ce66555c15c05c72027bfdf0cb6 Mon Sep 17 00:00:00 2001
From: iTrooz <itrooz@protonmail.com>
From: iTrooz <hey@itrooz.fr>
Date: Mon, 29 Aug 2022 17:29:38 +0200
Subject: [PATCH] Use software rendering on MacOS

View File

@@ -6,11 +6,12 @@ brew "freetype2"
brew "libmagic"
brew "pkg-config"
brew "curl"
brew "gcc@12"
brew "llvm"
brew "glfw"
brew "ninja"
brew "zlib"
brew "xz"
brew "bzip2"
brew "zstd"
brew "zstd"
brew "libssh2"
brew "md4c"

View File

@@ -1,18 +1,29 @@
# This base image is also known as "crosscompile". See arm64.crosscompile.Dockerfile
FROM ghcr.io/itrooz/macos-crosscompile:clang17-nosdk as build
FROM ghcr.io/werwolv/macos-crosscompile:4c4af2d1a6a102fab93cc9cd660280c2ec9d72af as build
ENV MACOSX_DEPLOYMENT_TARGET 12.1
ENV MACOSX_DEPLOYMENT_TARGET 13.0
# -- DOWNLOADING STUFF
# Update vcpkg
RUN <<EOF
cp /vcpkg/triplets/community/arm-osx-mytriplet.cmake /tmp/arm-osx-mytriplet.cmake
git -C /vcpkg clean -ffdx
git -C /vcpkg checkout origin/master
git -C /vcpkg reset --hard
git -C /vcpkg pull
/vcpkg/bootstrap-vcpkg.sh
cp /tmp/arm-osx-mytriplet.cmake /vcpkg/triplets/community/arm-osx-mytriplet.cmake
EOF
## Install make
RUN --mount=type=cache,target=/var/lib/apt/lists/ apt update && apt install -y make
RUN --mount=type=cache,target=/var/lib/apt/lists/ apt update && apt install -y make cmake
## fix environment
### add install_name_tool for cmake command that won't have the right env set (see PostprocessBundle.cmake function postprocess_bundle())
RUN cp /osxcross/build/cctools-port/cctools/misc/install_name_tool /usr/bin/install_name_tool
### a cmake thing wants 'otool' and not '' apparently
RUN cp /osxcross/target/bin/aarch64-apple-darwin23-otool /usr/bin/otool
RUN cp /osxcross/target/bin/aarch64-apple-darwin24-otool /usr/bin/otool
## Clone glfw
RUN <<EOF
@@ -25,17 +36,17 @@ EOF
RUN --mount=type=cache,target=/cache <<EOF
## Download SDK is missing (it may have been removed from the image)
set -xe
if [ ! -d /osxcross/target/SDK/MacOSX14.0.sdk ]; then
wget https://github.com/joseluisq/macosx-sdks/releases/download/14.0/MacOSX14.0.sdk.tar.xz -O /cache/MacOSX14.0.sdk.tar.xz -nc || true
if [ ! -d /osxcross/target/SDK/MacOSX15.0.sdk ]; then
wget https://github.com/joseluisq/macosx-sdks/releases/download/15.0/MacOSX15.0.sdk.tar.xz -O /cache/MacOSX15.0.sdk.tar.xz -nc || true
mkdir -p /osxcross/target/SDK
tar -C /osxcross/target/SDK -xf /cache/MacOSX14.0.sdk.tar.xz
tar -C /osxcross/target/SDK -xf /cache/MacOSX15.0.sdk.tar.xz
fi
EOF
## Download libmagic
### Clone libmagic
RUN git clone --depth 1 --branch FILE5_45 https://github.com/file/file /mnt/file
RUN git clone --depth 1 --branch FILE5_46 https://github.com/file/file /mnt/file
### Download libmagic dependencies
RUN --mount=type=cache,target=/var/lib/apt/lists/ apt update && apt install -y libtool autoconf
@@ -56,6 +67,8 @@ vcpkg install --triplet=arm-osx-mytriplet zlib
vcpkg install --triplet=arm-osx-mytriplet bzip2
vcpkg install --triplet=arm-osx-mytriplet liblzma
vcpkg install --triplet=arm-osx-mytriplet zstd
vcpkg install --triplet=arm-osx-mytriplet openssl
vcpkg install --triplet=arm-osx-mytriplet libssh2
EOF
## Install glfw3 dep
@@ -88,7 +101,7 @@ RUN --mount=type=cache,target=/cache <<EOF
make -j $JOBS install
# Now, we cross-compile it and install it in the libraries folder
CC=/osxcross/target/bin/aarch64-apple-darwin23-clang CXX=/osxcross/target/bin/aarch64-apple-darwin23-clang++ ./configure --prefix /vcpkg/installed/arm-osx-mytriplet --host $OSXCROSS_HOST
CC=/osxcross/target/bin/aarch64-apple-darwin24-clang CXX=/osxcross/target/bin/aarch64-apple-darwin24-clang++ ./configure --prefix /vcpkg/installed/arm-osx-mytriplet --host $OSXCROSS_HOST
make -j $JOBS
make install
@@ -118,7 +131,7 @@ if [ "$CUSTOM_GLFW" ]; then
cd /mnt/glfw
mkdir build
cd build
CC=o64-gcc CXX=o64-g++ cmake -G "Ninja" \
CC=o64-clang CXX=o64-clang++ cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
@@ -126,7 +139,7 @@ if [ "$CUSTOM_GLFW" ]; then
-DCMAKE_OBJC_COMPILER_LAUNCHER=ccache \
-DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=/vcpkg/installed/arm-osx-mytriplet \
-DVCPKG_TARGET_TRIPLET=arm-osx-mytriplet -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/osxcross/target/toolchain.cmake -DCMAKE_OSX_SYSROOT=/osxcross/target/SDK/MacOSX14.0.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=12.1 \
-DVCPKG_TARGET_TRIPLET=arm-osx-mytriplet -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/osxcross/target/toolchain.cmake -DCMAKE_OSX_SYSROOT=/osxcross/target/SDK/MacOSX14.0.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 \
..
ninja -j $JOBS install
@@ -137,24 +150,23 @@ EOF
# Build ImHex
## Copy ImHex
COPY --from=imhex / /mnt/ImHex
## Patch ImHex with hacks
# COPY toolchain.cmake.2 /osxcross/target/toolchain.cmake
# Configure ImHex build
## Configure ImHex build
RUN --mount=type=cache,target=/cache --mount=type=cache,target=/mnt/ImHex/build/_deps \
cd /mnt/ImHex && \
# compilers
CC=o64-clang CXX=o64-clang++ OBJC=/osxcross/target/bin/aarch64-apple-darwin23-clang OBJCXX=/osxcross/target/bin/aarch64-apple-darwin23-clang++ \
CC=o64-clang CXX=o64-clang++ OBJC=/osxcross/target/bin/aarch64-apple-darwin24-clang OBJCXX=/osxcross/target/bin/aarch64-apple-darwin24-clang++ \
cmake -G "Ninja" \
`# ccache flags` \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OBJC_COMPILER_LAUNCHER=ccache -DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
`# MacOS cross-compiling flags` \
-DVCPKG_TARGET_TRIPLET=arm-osx-mytriplet -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/osxcross/target/toolchain.cmake -DCMAKE_OSX_SYSROOT=/osxcross/target/SDK/MacOSX14.0.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=12.1 \
-DVCPKG_TARGET_TRIPLET=arm-osx-mytriplet -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/osxcross/target/toolchain.cmake -DCMAKE_OSX_SYSROOT=/osxcross/target/SDK/MacOSX14.0.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 \
`# Override compilers for code generators` \
-DNATIVE_CMAKE_C_COMPILER=/usr/bin/clang -DNATIVE_CMAKE_CXX_COMPILER=/usr/bin/clang++ \
`# Normal ImHex flags` \
-DIMHEX_GENERATE_PACKAGE=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
`# other flags` \
-DIMHEX_STRICT_WARNINGS=OFF \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
-DCMAKE_INSTALL_PREFIX=/mnt/ImHex/build/install \
-B build
## Build ImHex

View File

@@ -1,12 +1,12 @@
# This image is is provided for reference, but a (probably more up to date) image should be available at https://github.com/iTrooz/macos-crosscompile
# This image is provided for reference, but a (probably more up to date) image should be available at https://github.com/iTrooz/macos-crosscompile
FROM ubuntu:22.04
ENV PATH $PATH:/osxcross/target/bin
ENV LD_LIBRARY_PATH /osxcross/target/lib
ENV OSXCROSS_SDK /osxcross/target/SDK/MacOSX14.0.sdk
ENV OSXCROSS_TARGET darwin23
ENV OSXCROSS_TARGET darwin24
ENV OSXCROSS_TARGET_DIR /osxcross/target
ENV OSXCROSS_HOST aarch64-apple-darwin23
ENV OSXCROSS_HOST aarch64-apple-darwin24
# -- DOWNLOADING STUFF
@@ -68,19 +68,6 @@ RUN --mount=type=cache,target=/cache <<EOF
ccache -s
EOF
# Not needed, because we don't use gcc for cross-compiling anymore
# ## Install dependencies for gcc-13
# RUN apt install -y gcc g++ zlib1g-dev libmpc-dev libmpfr-dev libgmp-dev
# ## Build cross-compiler gcc-13
# RUN --mount=type=cache,target=/cache <<EOF
# set -xe
# ccache -zs
# cd /osxcross
# UNATTENDED=1 CC=/usr/lib/ccache/gcc CXX=/usr/lib/ccache/g++ GCC_VERSION=13.2.0 ./build_gcc.sh
# ccache -s
# EOF
ARG DELETE_SDK=1
RUN <<EOF

4
dist/msys2/PKGBUILD vendored
View File

@@ -20,7 +20,9 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-bzip2"
"${MINGW_PACKAGE_PREFIX}-xz"
"${MINGW_PACKAGE_PREFIX}-zstd")
"${MINGW_PACKAGE_PREFIX}-zstd"
"${MINGW_PACKAGE_PREFIX}-libssh2-wincng"
"${MINGW_PACKAGE_PREFIX}-md4c")
source=()
sha256sums=()

71
dist/net.werwolv.ImHex.metainfo.xml vendored Normal file
View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>net.werwolv.ImHex</id>
<name>ImHex</name>
<summary>Modern REing Hex Editor</summary>
<description>
<p>
ImHex is a modern Hex Editor for Reverse Engineers, Developers, Malware Analysists and Hackers who value
their retinas when working at 3 AM once again.
</p>
<p>
Features:
</p>
<ul>
<li>Featureful hex view</li>
<li>Custom C++-like pattern language for parsing and highlighting a file's content</li>
<li>Data importing and exporting</li>
<li>Data inspector allowing interpretation of data as many different types</li>
<li>Huge file support with fast and efficient loading</li>
<li>Strings search</li>
<li>File hashing support</li>
<li>Disassembler supporting many different architectures: ARM, x86, PowerPC, MIPS, and more</li>
<li>Bookmarks</li>
<li>Data analyzer</li>
<li>
Helpful tools such as an Itanium and MSVC demangler, ASCII table, Regex
replacer, mathematical expression evaluator (calculator), hexadecimal
color picker and many more
</li>
<li>Doesn't burn out your retinas when used in late-night sessions</li>
</ul>
</description>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0-only</project_license>
<developer id="net.werwolv">
<name>WerWolv</name>
</developer>
<url type="homepage">https://imhex.werwolv.net</url>
<url type="bugtracker">https://github.com/WerWolv/ImHex/issues</url>
<url type="help">https://docs.werwolv.net/imhex</url>
<url type="donation">https://github.com/sponsors/WerWolv</url>
<url type="contact">https://imhex.werwolv.net/discord</url>
<url type="vcs-browser">https://github.com/WerWolv/ImHex</url>
<url type="contribute">https://github.com/WerWolv/ImHex/blob/master/CONTRIBUTING.md</url>
<launchable type="desktop-id">imhex.desktop</launchable>
<screenshots>
<screenshot type="default" width="1920" height="1017">
<image type="source">https://raw.githubusercontent.com/flathub/net.werwolv.ImHex/master/screenshots/screenshot1.png</image>
<caption>Using a pattern to parse and highlight different sections of an ELF executable file</caption>
</screenshot>
<screenshot type="default" width="1920" height="1017">
<image type="source">https://raw.githubusercontent.com/flathub/net.werwolv.ImHex/master/screenshots/screenshot2.png</image>
<caption>Managing bookmarks, diffing two files and decrypting a region of data using the data preprocessor</caption>
</screenshot>
</screenshots>
<content_rating type="oars-1.1"/>
<branding>
<color type="primary" scheme_preference="light">#babec9</color>
<color type="primary" scheme_preference="dark">#0f0f0f</color>
</branding>
<releases>
<release version="1.0.0" date="2025-01-01">
<description></description>
</release>
</releases>
<update_contact>hey@werwolv.net</update_contact>
<recommends>
<control>keyboard</control>
<control>pointing</control>
</recommends>
</component>

View File

@@ -1,22 +0,0 @@
app-id: net.werwolv.ImHex
runtime: org.freedesktop.Platform
runtime-version: '20.08'
default-branch: stable
sdk: org.freedesktop.Sdk
command: imhex
finish-args:
- --share=ipc
- --socket=x11
- --filesystem=host
- --device=all
modules:
- name: imhex
buildsystem: cmake
config-opts:
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
sources:
- type: git
url: https://github.com/WerWolv/ImHex.git

View File

@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>imhex</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0</project_license>
<name>ImHex</name>
<developer_name>WerWolv</developer_name>
<update_contact>hey@werwolv.net</update_contact>
<summary>A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM</summary>
<description>
<p>ImHex is a feature-rich Hex Editor aimed towards Reverse Engineers working with foreign data formats, malware, executables and raw memory.
Besides all the features a common Hex Editor has, ImHex also features a custom scripting language used to declare and dissect data structures, support for running YARA rules, a node-based graphical data pre-processor and support for various data sources such as files, raw disks or GDB Servers.</p>
</description>
<launchable type="desktop-id">imhex.desktop</launchable>
<url type="homepage">https://imhex.werwolv.net</url>
<screenshots>
<screenshot type="default">
<image>https://user-images.githubusercontent.com/10835354/139717326-8044769d-527b-4d88-8adf-2d4ecafdca1f.png</image>
</screenshot>
<screenshot>
<image>https://user-images.githubusercontent.com/10835354/139717323-1f8c9d52-f7eb-4f43-9f11-097ac728ed6c.png</image>
</screenshot>
</screenshots>
<provides>
<id>imhex.desktop</id>
</provides>
<categories>
<category>Development</category>
</categories>
</component>

115
dist/rpm/imhex.spec vendored
View File

@@ -6,7 +6,7 @@ Release: 0%{?dist}
Summary: A hex editor for reverse engineers and programmers
License: GPL-2.0-only AND Zlib AND MIT AND Apache-2.0
# imhex is gplv2. capstone is custom. nativefiledialog is Zlib.
# imhex is gplv2. capstone is custom.
# see license dir for full breakdown
URL: https://imhex.werwolv.net/
# We need the archive with deps bundled
@@ -24,32 +24,41 @@ BuildRequires: libglvnd-devel
BuildRequires: glfw-devel
BuildRequires: json-devel
BuildRequires: libcurl-devel
BuildRequires: llvm-devel
BuildRequires: mbedtls-devel
BuildRequires: yara-devel
BuildRequires: nativefiledialog-extended-devel
BuildRequires: dotnet-sdk-8.0
BuildRequires: libarchive-devel
BuildRequires: libzstd-devel
BuildRequires: zlib-devel
BuildRequires: bzip2-devel
BuildRequires: xz-devel
%if 0%{?rhel}
BuildRequires: gcc-toolset-12
BuildRequires: llvm-devel
BuildRequires: mbedtls-devel
BuildRequires: yara-devel
BuildRequires: nativefiledialog-extended-devel
BuildRequires: lz4-devel
BuildRequires: libssh2-devel
%if 0%{?rhel} == 9
BuildRequires: gcc-toolset-14
%endif
%if 0%{?fedora} || 0%{?rhel} > 9
BuildRequires: capstone-devel
%endif
BuildRequires: lunasvg-devel
Provides: bundled(gnulib)
Provides: bundled(capstone) = 5.0-rc2
Provides: bundled(imgui)
%if 0%{?rhel} == 10
Provides: bundled(capstone) = 5.0.1
%endif
Provides: bundled(imgui) = 1.90.8
Provides: bundled(libromfs)
Provides: bundled(microtar)
Provides: bundled(libpl) = %{version}
Provides: bundled(xdgpp)
# working on packaging this, bundling for now as to now delay updates
Provides: bundled(miniaudio) = 0.11.11
# ftbfs on these arches. armv7hl might compile when capstone 5.x
# is released upstream and we can build against it
# [7:02 PM] WerWolv: We're not supporting 32 bit anyways soooo
# [11:38 AM] WerWolv: Officially supported are x86_64 and aarch64
ExclusiveArch: x86_64 %{arm64} ppc64le
ExclusiveArch: x86_64 %{arm64}
%description
ImHex is a Hex Editor, a tool to display, decode and analyze binary data to
@@ -63,14 +72,31 @@ displayed, a disassembler, diffing support, bookmarks and much much more. At the
same time ImHex is completely free and open source under the GPLv2 language.
%package devel
Summary: Development files for %{name}
License: GPL-2.0-only
%description devel
%{summary}
%prep
%autosetup -n ImHex
%autosetup -n ImHex -p1
# remove bundled libs we aren't using
rm -rf lib/third_party/{fmt,nlohmann_json,yara}
rm -rf lib/third_party/{curl,fmt,llvm,nlohmann_json,yara}
%if 0%{?fedora} || 0%{?rhel} > 9
rm -rf lib/third_party/capstone
%endif
# rhel 9 doesn't support all of the new appstream metainfo tags
%if 0%{?rhel} && 0%{?rhel} < 10
sed -i -e '/url type="vcs-browser"/d' \
-e '/url type="contribute"/d' \
dist/net.werwolv.ImHex.metainfo.xml
%endif
%build
%if 0%{?rhel}
. /opt/rh/gcc-toolset-12/enable
%if 0%{?rhel} == 9
. /opt/rh/gcc-toolset-14/enable
%set_build_flags
CXXFLAGS+=" -std=gnu++2b"
%endif
@@ -80,23 +106,31 @@ CXXFLAGS+=" -std=gnu++2b"
-D IMHEX_OFFLINE_BUILD=ON \
-D USE_SYSTEM_NLOHMANN_JSON=ON \
-D USE_SYSTEM_FMT=ON \
-D USE_SYSTEM_CURL=ON \
-D USE_SYSTEM_LLVM=ON \
-D USE_SYSTEM_MD4C=OFF \
%if 0%{?fedora} || 0%{?rhel} > 9
-D USE_SYSTEM_CAPSTONE=ON \
%endif
-D USE_SYSTEM_LUNASVG=ON \
-D USE_SYSTEM_YARA=ON \
-D USE_SYSTEM_NFD=ON \
-D IMHEX_USE_GTK_FILE_PICKER=ON \
-D IMHEX_BUNDLE_DOTNET=OFF \
# when capstone >= 5.x is released we should be able to build against \
# system libs of it \
# -D USE_SYSTEM_CAPSTONE=ON
-D IMHEX_ENABLE_UNIT_TESTS=ON \
%if 0%{?rhel}
-D IMHEX_BUILD_HARDENING=OFF
%endif
# disable built-in build hardening because it is already
# done in rhel buildroots. adding the flags again from
# upstream generates build errors
%cmake_build
%check
%if 0%{?rhel}
. /opt/rh/gcc-toolset-12/enable
%set_build_flags
CXXFLAGS+=" -std=gnu++2b"
%endif
# build binaries required for tests
%cmake_build --target unit_tests
%ctest --exclude-regex '(Helpers/StoreAPI|Helpers/TipsAPI|Helpers/ContentAPI)'
# Helpers/*API exclude tests that require network access
%install
@@ -104,15 +138,15 @@ CXXFLAGS+=" -std=gnu++2b"
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
# this is a symlink for the old appdata name that we don't need
rm -f %{buildroot}%{_metainfodir}/net.werwolv.%{name}.appdata.xml
rm -f %{buildroot}%{_metainfodir}/net.werwolv.ImHex.appdata.xml
# AppData
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/net.werwolv.%{name}.metainfo.xml
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/net.werwolv.ImHex.metainfo.xml
# install licenses
cp -a lib/third_party/nativefiledialog/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/nativefiledialog-LICENSE
cp -a lib/third_party/capstone/LICENSE.TXT %{buildroot}%{_datadir}/licenses/%{name}/capstone-LICENSE
cp -a lib/third_party/capstone/suite/regress/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/capstone-regress-LICENSE
%if 0%{?rhel} == 9
cp -a lib/third_party/capstone/LICENSES/LICENSE.TXT %{buildroot}%{_datadir}/licenses/%{name}/capstone-LICENSE
%endif
cp -a lib/third_party/microtar/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/microtar-LICENSE
cp -a lib/third_party/xdgpp/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/xdgpp-LICENSE
@@ -121,9 +155,16 @@ cp -a lib/third_party/xdgpp/LICENSE %{buildroot
%license %{_datadir}/licenses/%{name}/
%doc README.md
%{_bindir}/imhex
%{_bindir}/imhex-updater
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/imhex/imhex
%{_datadir}/pixmaps/%{name}.*
%{_datadir}/applications/%{name}.desktop
%{_libdir}/libimhex.so*
%{_libdir}/libimhex.so.*
%{_libdir}/%{name}/
%{_metainfodir}/net.werwolv.%{name}.metainfo.xml
%{_metainfodir}/net.werwolv.ImHex.metainfo.xml
%exclude %{_bindir}/imhex-updater
%{_datadir}/mime/packages/%{name}.xml
%files devel
%{_libdir}/libimhex.so
%{_datadir}/%{name}/sdk/

92
dist/snap/snapcraft.yaml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: imhex
title: ImHex
base: core24
version: ${IMHEX_VERSION_STRING}
summary: Hex editor for reverse engineering
description: ImHex is a hex editor for reverse engineering, reverse engineering, and analyzing binary files. It provides a powerful and flexible interface for working with binary data, including features like pattern matching, scripting, and a customizable user interface.
grade: stable
confinement: classic
contact: https://github.com/WerWolv/ImHex/discussions
issues: https://github.com/WerWolv/ImHex/issues
source-code: https://github.com/WerWolv/ImHex
website: https://imhex.werwolv.net
donation: https://github.com/sponsors/WerWolv
license: GPL-2.0-only
icon: resources/icon.svg
adopt-info: imhex
platforms:
amd64:
arm64:
apps:
imhex:
command: usr/local/bin/imhex
desktop: usr/local/share/applications/imhex.desktop
environment:
LD_LIBRARY_PATH: '$SNAP/usr/local/lib:$SNAP/usr/local/lib/imhex:$SNAP/usr/lib/x86_64-linux-gnu:$SNAP/usr/lib/aarch64-linux-gnu:$LD_LIBRARY_PATH'
XDG_DATA_DIRS: '$XDG_DATA_DIRS:$SNAP/usr/local/share:$SNAP/usr/local/lib:$SNAP/usr/local/share'
XDG_CONFIG_DIRS: '$XDG_CONFIG_DIRS:$SNAP/usr/local/share'
XDG_DATA_HOME: '$XDG_DATA_HOME:$SNAP_DATA'
parts:
imhex:
plugin: cmake
source: .
build-environment:
- CC: /usr/bin/gcc-14
- CXX: /usr/bin/g++-14
cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_C_COMPILER_LAUNCHER=${CCACHE}
- -DCMAKE_CXX_COMPILER_LAUNCHER=${CCACHE}
- -DIMHEX_PATTERNS_PULL_MASTER=ON
- -DIMHEX_BUNDLE_PLUGIN_SDK=OFF
cmake-generator: Ninja
build-packages:
- cmake
- ninja-build
- gcc-14
- g++-14
- git
- pkg-config
- libglfw3-dev
- libmagic-dev
- libmbedtls-dev
- libfontconfig-dev
- libfreetype-dev
- libdbus-1-dev
- libcurl4-gnutls-dev
- libgtk-3-dev
- zlib1g-dev
- libbz2-dev
- liblzma-dev
- libzstd-dev
- liblz4-dev
- libssh2-1-dev
- libmd4c-dev
- libmd4c-html0-dev
stage-packages:
- libglfw3
- libmagic1
- libmbedtls14
- libfontconfig1
- libfreetype6
- libdbus-1-3
- libcurl4-gnutls-dev
- libgtk-3-0
- zlib1g
- libbz2-1.0
- liblzma5
- libzstd1
- liblz4-1
- libssh2-1
prime:
- -usr/include/*
- -usr/local/include/*
- -usr/lib/**/*.a
- -usr/local/lib/**/*.a
- -usr/lib/**/*.la
- -usr/local/lib/**/*.la
- -usr/share/doc/*
- -usr/share/man/*

18
dist/vcpkg.json vendored Normal file
View File

@@ -0,0 +1,18 @@
{
"name": "vcpkg",
"version": "1.0.0",
"builtin-baseline": "7e21420f775f72ae938bdeb5e6068f722088f06a",
"dependencies": [
"libmagic",
"freetype",
"mbedtls",
"zlib",
"bzip2",
"liblzma",
"zstd",
"glfw3",
"curl",
"libssh2",
"md4c"
]
}

33
dist/web/Dockerfile vendored
View File

@@ -1,23 +1,24 @@
FROM emscripten/emsdk:3.1.51 as build
FROM emscripten/emsdk:4.0.21 AS build
# Used to invalidate layer cache but not mount cache
# See https://github.com/moby/moby/issues/41715#issuecomment-733976493
ARG UNIQUEKEY 1
ARG UNIQUEKEY=1
RUN apt update
RUN apt install -y git ccache autoconf automake libtool cmake pkg-config
RUN apt install -y git ccache autoconf automake libtool pkg-config ninja-build
RUN <<EOF
# Install vcpkg
# Note: we are a patch on the libmagic port
set -xe
git clone https://github.com/microsoft/vcpkg /vcpkg
git clone --depth 1 https://github.com/microsoft/vcpkg /vcpkg
/vcpkg/bootstrap-vcpkg.sh
sed -i 's/vcpkg_install_make(${EXTRA_ARGS})/vcpkg_install_make(${EXTRA_ARGS} SUBPATH src)/g' /vcpkg/ports/libmagic/portfile.cmake
EOF
# Patch vcpkg build instructions to add -pthread
# Patch vcpkg build instructions to add -pthread flag
# Even dependencies must be built with -pthread to be able to use USE_PTHREADS=1
RUN <<EOF
set -xe
@@ -27,7 +28,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
' >> /emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
EOF
ENV VCPKG_DEFAULT_BINARY_CACHE /cache/vcpkg
ENV VCPKG_DEFAULT_BINARY_CACHE=/cache/vcpkg
RUN --mount=type=cache,target=/cache <<EOF
# Install dependencies with vcpkg
set -xe
@@ -45,20 +46,22 @@ EOF
# Build ImHex
ARG JOBS=4
ENV CCACHE_DIR /cache/ccache
ENV CCACHE_DIR=/cache/ccache
RUN mkdir /build
WORKDIR /build
ARG BUILD_TYPE=Release
RUN --mount=type=cache,target=/cache \
--mount=type=bind,source=.,target=/imhex <<EOF
set -xe
ccache -zs
cmake /imhex \
/vcpkg/downloads/tools/cmake-*/cmake-*/bin/cmake /imhex \
-G "Ninja" \
-DIMHEX_OFFLINE_BUILD=ON \
-DIMHEX_STATIC_LINK_PLUGINS=ON \
-DIMHEX_EXCLUDE_PLUGINS="script_loader" \
-DIMHEX_EXCLUDE_PLUGINS="script_loader;remote" \
-DIMHEX_COMPRESS_DEBUG_INFO=OFF \
-DNATIVE_CMAKE_C_COMPILER=gcc \
-DNATIVE_CMAKE_CXX_COMPILER=g++ \
@@ -66,9 +69,11 @@ cmake /imhex
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
-DCMAKE_BUILD_TYPE=Release
-DLIBROMFS_COMPRESS_RESOURCES=OFF \
-DIMHEX_ENABLE_PLUGIN_TESTS=OFF \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
make -j $JOBS
ninja -j $JOBS
cp /imhex/dist/web/source/* /build
ccache -s
@@ -78,13 +83,12 @@ EOF
# See https://stackoverflow.com/questions/41701849/cannot-modify-accept-encoding-with-fetch https://github.com/AnthumChris/fetch-progress-indicators/issues/13
RUN du -b /build/imhex.wasm | cut -f1 > imhex.wasm.size
FROM scratch as raw
FROM scratch AS raw
COPY --from=build [ \
# ImHex \
"/build/imhex.wasm", \
"/build/imhex.wasm.size", \
"/build/imhex.js", \
"/build/imhex.worker.js", \
\
# Static files \
"/build/index.html", \
@@ -92,7 +96,7 @@ COPY --from=build [ \
"/build/wasm-config.js", \
"/build/enable-threads.js", \
"/build/favicon.ico", \
"/build/icon.png", \
"/build/icon.svg", \
"/build/manifest.json", \
"/build/robots.txt", \
"/build/sitemap.xml", \
@@ -103,3 +107,4 @@ COPY --from=build [ \
FROM nginx
COPY --from=raw . /usr/share/nginx/html
RUN chmod -R 755 /usr/share/nginx/html

View File

@@ -1,5 +1,4 @@
# docker compose -f dist/web/compose.yml up --build
version: '3'
services:
imhex_web:
image: imhex_web:latest

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

11
dist/web/source/icon.svg vendored Normal file
View File

@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" version="1">
<rect style="opacity:0.2" width="55" height="10" x="5" y="-60" rx="1.41" transform="rotate(90)"/>
<rect style="fill:#2b50a1" width="55" height="10" x="4" y="-60" rx="1.41" transform="rotate(90)"/>
<rect style="fill:#2b50a1" width="55" height="10" x="4" y="-14" rx="1.41" transform="rotate(90)"/>
<rect style="fill:#2b50a1" width="55" height="10" x="4" y="-33" rx="1.41" transform="rotate(90)"/>
<path style="opacity:0.2" d="M 5.3808594,5 C 4.6158118,5 4,5.6158118 4,6.3808594 V 13.619141 C 4,14.384188 4.6158118,15 5.3808594,15 H 31.619141 C 32.384188,15 33,14.384188 33,13.619141 V 6.3808594 C 33,5.6158118 32.384188,5 31.619141,5 Z M 40.400391,5 C 39.624791,5 39,5.6247906 39,6.4003906 V 13.599609 C 39,14.375209 39.624791,15 40.400391,15 H 58.599609 C 59.375209,15 60,14.375209 60,13.599609 V 6.4003906 C 60,5.6247906 59.375209,5 58.599609,5 Z M 5.3808594,50 C 4.6158118,50 4,50.615812 4,51.380859 v 7.238282 C 4,59.384188 4.6158118,60 5.3808594,60 H 31.619141 C 32.384188,60 33,59.384188 33,58.619141 V 51.380859 C 33,50.615812 32.384188,50 31.619141,50 Z"/>
<rect style="fill:#3a6be0" width="29" height="10" x="4" y="4" rx="1.381"/>
<rect style="fill:#3a6be0" width="21" height="10" x="39" y="4" rx="1.4"/>
<rect style="fill:#3a6be0" width="29" height="10" x="4" y="49" rx="1.381"/>
<path style="fill:#ffffff;opacity:0.1" d="M 5.3808594 4 C 4.6158118 4 4 4.6158118 4 5.3808594 L 4 6.3808594 C 4 5.6158118 4.6158118 5 5.3808594 5 L 31.619141 5 C 32.384188 5 33 5.6158118 33 6.3808594 L 33 5.3808594 C 33 4.6158118 32.384188 4 31.619141 4 L 5.3808594 4 z M 40.400391 4 C 39.624791 4 39 4.6247906 39 5.4003906 L 39 6.4003906 C 39 5.6247906 39.624791 5 40.400391 5 L 58.599609 5 C 59.375209 5 60 5.6247906 60 6.4003906 L 60 5.4003906 C 60 4.6247906 59.375209 4 58.599609 4 L 40.400391 4 z M 5.3808594 49 C 4.6158118 49 4 49.615812 4 50.380859 L 4 51.380859 C 4 50.615812 4.6158118 50 5.3808594 50 L 31.619141 50 C 32.384188 50 33 50.615812 33 51.380859 L 33 50.380859 C 33 49.615812 32.384188 49 31.619141 49 L 5.3808594 49 z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -11,7 +11,7 @@
<meta name="title" content="ImHex">
<meta name="description" content="Free and extremely powerful Online Hex Editor for your Web Browser. ImHex is a free and open source Hex Editor for Reverse Engineers and Developers and Data Analysts.">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="apple-touch-icon" href="icon.png">
<link rel="apple-touch-icon" href="icon.svg">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
@@ -38,7 +38,7 @@
"founder": "WerWolv",
"slogan": "A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.",
"url": "https://imhex.werwolv.net",
"logo": "https://imhex.werwolv.net/assets/logos/logo.png"
"logo": "https://imhex.werwolv.net/assets/logos/logo.svg"
}
</script>
@@ -62,7 +62,7 @@
</head>
<body>
<div id="loading" class="centered">
<img src="https://raw.githubusercontent.com/WerWolv/ImHex/master/plugins/builtin/romfs/assets/dark/banner.png" id="logo" alt="ImHex Logo">
<img src="https://raw.githubusercontent.com/WerWolv/ImHex/master/plugins/builtin/romfs/assets/dark/banner.svg" id="logo" alt="ImHex Logo">
<h1>A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.</h1>
<h2>Available both natively and on the web</h2>
<h5>ImHex runs directly in your web browser with the help of Emscripten and WebAssembly.</h5>

View File

@@ -10,8 +10,8 @@
],
"icons": [
{
"src": "icon.png",
"type": "image/png",
"src": "icon.svg",
"type": "image/svg",
"sizes": "640x640"
}
],

View File

@@ -57,6 +57,11 @@
<loc>https://web.imhex.werwolv.net?lang=it-IT</loc>
<lastmod>2024-01-02T11:44:00+00:00</lastmod>
</url>
<url>
<title>Русский</title>
<loc>https://web.imhex.werwolv.net?lang=ru-RU</loc>
<lastmod>2024-01-02T11:44:00+00:00</lastmod>
</url>
</urlset>

View File

@@ -137,7 +137,7 @@ a:hover {
:root {
--progress: 25%;
--progress: 0%;
}
.progress-bar-container {
@@ -174,4 +174,15 @@ a:hover {
.progress-moved .progress-bar {
width: var(--progress);
background-color: #3864cb;
}
#logo {
height: 25%;
margin-top: 50px;
}
.canvas-fixed {
position: absolute;
top: 0;
left: 0;
}

View File

@@ -9,8 +9,9 @@ fetch("imhex.wasm.size").then(async (resp) => {
// inspired from: https://github.com/WordPress/wordpress-playground/pull/46 (but had to be modified)
function monkeyPatch(progressFun) {
const _instantiateStreaming = WebAssembly.instantiateStreaming;
WebAssembly.instantiateStreaming = (response, ...args) => {
WebAssembly.instantiateStreaming = async (responsePromise, ...args) => {
// Do not collect wasm content length here see above
let response = await responsePromise
const file = response.url.substring(
new URL(response.url).origin.length + 1
);
@@ -58,8 +59,14 @@ monkeyPatch((file, done) => {
const mibTotal = (wasmSize / 1024**2).toFixed(1);
let root = document.querySelector(':root');
root.style.setProperty("--progress", `${percent}%`)
document.getElementById("progress-bar-content").innerHTML = `${percent}% &nbsp;[${mibNow} MiB / ${mibTotal} MiB]`;
if (root != null) {
root.style.setProperty("--progress", `${percent}%`)
let progressBar = document.getElementById("progress-bar-content");
if (progressBar != null) {
progressBar.innerHTML = `${percent}% &nbsp;[${mibNow} MiB / ${mibTotal} MiB]`;
}
}
});
function glfwSetCursorCustom(wnd, shape) {
@@ -100,10 +107,82 @@ var notWorkingTimer = setTimeout(() => {
var Module = {
preRun: [],
postRun: [],
postRun: function() {
// Patch the emscripten GLFW module to send mouse and touch events in the right order
// For ImGui interactions to correctly work with touch input, MousePos events need
// to be processed first and then MouseButton events in the next frame. By default,
// GLFW does the exact opposite, which causes buttons to require two taps to register
// and windows get "stuck" to the cursor when dragged or resized
GLFW.onMousemove = event => {
if (event.type === "touchmove") {
event.preventDefault();
let primaryChanged = false;
for (let i of event.changedTouches) {
if (GLFW.primaryTouchId === i.identifier) {
Browser.setMouseCoords(i.pageX, i.pageY);
primaryChanged = true;
break;
}
}
if (!primaryChanged) {
return;
}
} else {
Browser.calculateMouseEvent(event);
}
};
GLFW.onMouseButtonChanged = (event, status) => {
if (!GLFW.active) return;
if (event.target != Module["canvas"]) return;
const isTouchType = event.type === "touchstart" || event.type === "touchend" || event.type === "touchcancel";
let eventButton = 0;
if (isTouchType) {
event.preventDefault();
let primaryChanged = false;
if (GLFW.primaryTouchId === null && event.type === "touchstart" && event.targetTouches.length > 0) {
const chosenTouch = event.targetTouches[0];
GLFW.primaryTouchId = chosenTouch.identifier;
Browser.setMouseCoords(chosenTouch.pageX, chosenTouch.pageY);
primaryChanged = true;
} else if (event.type === "touchend" || event.type === "touchcancel") {
for (let i of event.changedTouches) {
if (GLFW.primaryTouchId === i.identifier) {
GLFW.primaryTouchId = null;
primaryChanged = true;
break;
}
}
}
if (!primaryChanged) {
return;
}
} else {
Browser.calculateMouseEvent(event);
eventButton = GLFW.DOMToGLFWMouseButton(event);
}
if (status == 1) {
GLFW.active.buttons |= (1 << eventButton);
try {
event.target.setCapture();
} catch (e) {}
} else {
GLFW.active.buttons &= ~(1 << eventButton);
}
if (GLFW.active.cursorPosFunc) {
getWasmTableEntry(GLFW.active.cursorPosFunc)(GLFW.active.id, Browser.mouseX, Browser.mouseY);
}
if (GLFW.active.mouseButtonFunc) {
getWasmTableEntry(GLFW.active.mouseButtonFunc)(GLFW.active.id, eventButton, status, GLFW.getModBits(GLFW.active));
}
};
},
onRuntimeInitialized: function() {
// Triggered when the wasm module is loaded and ready to use.
document.getElementById("loading").style.display = "none"
let loading = document.getElementById("loading");
if (loading != null)
document.getElementById("loading").style.display = "none"
document.getElementById("canvas").style.display = "initial"
clearTimeout(notWorkingTimer);
@@ -111,24 +190,65 @@ var Module = {
print: (function() { })(),
printErr: function(text) { },
canvas: (function() {
let canvas = document.getElementById('canvas');
// As a default initial behavior, pop up an alert when webgl context is lost. To make your
// application robust, you may want to override this behavior before shipping!
// See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
const canvas = document.getElementById('canvas');
canvas.addEventListener("webglcontextlost", function(e) {
alert('WebGL context lost, please reload the page');
e.preventDefault();
}, false);
return canvas;
// Turn long touches into right-clicks
let timer = null;
canvas.addEventListener('touchstart', event => {
timer = setTimeout(() => {
let eventArgs = {
bubbles: true,
cancelable: true,
view: window,
screenX: event.touches[0].screenX,
screenY: event.touches[0].screenY,
clientX: event.touches[0].clientX,
clientY: event.touches[0].clientY,
button: 2,
buttons: 2,
relatedTarget: event.target,
region: event.region
}
canvas.dispatchEvent(new MouseEvent('mousedown', eventArgs));
canvas.dispatchEvent(new MouseEvent('mouseup', eventArgs));
}, 400);
});
canvas.addEventListener('touchend', event => {
if (timer) {
clearTimeout(timer);
timer = null;
}
});
if (typeof WebGL2RenderingContext !== 'undefined') {
let gl = canvas.getContext('webgl2', { stencil: true });
if (!gl) {
console.error('WebGL 2 not available, falling back to WebGL');
gl = canvas.getContext('webgl', { stencil: true });
}
if (!gl) {
alert('WebGL not available with stencil buffer');
}
return canvas;
} else {
alert('WebGL 2 not supported by this browser');
}
})(),
setStatus: function(text) { },
totalDependencies: 0,
monitorRunDependencies: function(left) {
},
instantiateWasm: function(imports, successCallback) {
instantiateWasm: async function(imports, successCallback) {
imports.env.glfwSetCursor = glfwSetCursorCustom
imports.env.glfwCreateStandardCursor = glfwCreateStandardCursorCustom
instantiateAsync(wasmBinary, wasmBinaryFile, imports, (result) => {
successCallback(result.instance, result.module)
});
let result = await instantiateAsync(null, findWasmBinary(), imports);
successCallback(result.instance, result.module)
},
arguments: []
};
@@ -139,19 +259,25 @@ const urlParams = new URLSearchParams(queryString);
if (urlParams.has("lang")) {
Module["arguments"].push("--language");
Module["arguments"].push(urlParams.get("lang"));
} else if (urlParams.has("save-editor")) {
Module["arguments"].push("--save-editor");
Module["arguments"].push("gist");
Module["arguments"].push(urlParams.get("save-editor"));
}
window.addEventListener('resize', js_resizeCanvas, false);
function js_resizeCanvas() {
let canvas = document.getElementById('canvas');
canvas.width = Math.min(document.documentElement.clientWidth, window.innerWidth || 0);
canvas.height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0);
canvas.classList.add("canvas_full_screen")
canvas.top = document.documentElement.clientTop;
canvas.left = document.documentElement.clientLeft;
canvas.width = Math.min(document.documentElement.clientWidth, window.innerWidth || 0) * window.devicePixelRatio;
canvas.height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0) * window.devicePixelRatio;
}
if (GLFW.active && GLFW.active.windowPosFunc) {
getWasmTableEntry(GLFW.active.windowPosFunc)(GLFW.active.id, GLFW.active.x, GLFW.active.y);
// Prevent some default browser shortcuts from preventing ImHex ones to work
document.addEventListener('keydown', e => {
if (e.ctrlKey) {
if (e.which == 83) e.preventDefault();
}
GLFW.onWindowSizeChanged();
}
})

1
lib/external/disassembler vendored Submodule

View File

@@ -38,10 +38,16 @@ set(LIBIMHEX_SOURCES
source/helpers/debugging.cpp
source/helpers/default_paths.cpp
source/helpers/imgui_hooks.cpp
source/helpers/semantic_version.cpp
source/helpers/keys.cpp
source/helpers/udp_server.cpp
source/helpers/scaling.cpp
source/helpers/binary_pattern.cpp
source/test/tests.cpp
source/providers/provider.cpp
source/providers/cached_provider.cpp
source/providers/memory_provider.cpp
source/providers/undo/stack.cpp
@@ -49,21 +55,16 @@ set(LIBIMHEX_SOURCES
source/ui/view.cpp
source/ui/popup.cpp
source/ui/toast.cpp
source/ui/banner.cpp
source/subcommands/subcommands.cpp
)
if (APPLE)
set(OSX_11_0_SDK_PATH /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk)
if (NOT CMAKE_OSX_SYSROOT)
if (IS_DIRECTORY ${OSX_11_0_SDK_PATH})
set(CMAKE_OSX_SYSROOT ${OSX_11_0_SDK_PATH})
else ()
message(WARNING "CMAKE_OSX_SYSROOT not set and macOS 10.9 SDK not found! Using default one.")
endif ()
endif ()
set(LIBIMHEX_SOURCES ${LIBIMHEX_SOURCES} source/helpers/utils_macos.m)
set(LIBIMHEX_SOURCES ${LIBIMHEX_SOURCES}
source/helpers/utils_macos.m
source/helpers/macos_menu.m
)
endif ()
if (IMHEX_EXTERNAL_PLUGIN_BUILD)
@@ -76,10 +77,21 @@ else()
add_library(libimhex SHARED ${LIBIMHEX_SOURCES})
endif()
if (IMHEX_ENABLE_CXX_MODULES)
target_sources(libimhex
PUBLIC
FILE_SET cxx_modules TYPE CXX_MODULES
FILES
include/hex.cppm
)
endif()
set(LIBIMHEX_LIBRARY_TYPE PUBLIC)
target_compile_definitions(libimhex PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
endif()
addCppCheck(libimhex)
if (DEFINED IMHEX_COMMIT_HASH_LONG AND DEFINED IMHEX_COMMIT_BRANCH)
set(GIT_COMMIT_HASH_LONG "${IMHEX_COMMIT_HASH_LONG}")
@@ -114,37 +126,55 @@ endif ()
addDefineToSource(source/api/imhex_api.cpp "IMHEX_VERSION=\"${IMHEX_VERSION_STRING}\"")
string(TIMESTAMP IMHEX_BUILD_DATE UTC)
addDefineToSource(source/api/imhex_api.cpp "IMHEX_BUILD_DATE=\"${IMHEX_BUILD_DATE}\"")
enableUnityBuild(libimhex)
setupCompilerFlags(libimhex)
include(GenerateExportHeader)
generate_export_header(libimhex)
target_include_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} include ${XDGPP_INCLUDE_DIRS} ${MBEDTLS_INCLUDE_DIR} ${MAGIC_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS} ${LIBBACKTRACE_INCLUDE_DIRS})
target_link_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${MBEDTLS_LIBRARY_DIR} ${MAGIC_LIBRARY_DIRS})
if (NOT EMSCRIPTEN)
# curl is only used in non-emscripten builds
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} CURL::libcurl)
endif()
target_include_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} include ${XDGPP_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS})
if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
if (WIN32)
set_target_properties(libimhex PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
target_link_options(libimhex PRIVATE -Wl,--export-all-symbols)
if (NOT MSVC)
target_link_options(libimhex PRIVATE -Wl,--export-all-symbols)
endif()
target_link_libraries(libimhex PRIVATE Netapi32.lib)
target_compile_definitions(libimhex PRIVATE EXPORT_SYMBOLS=1)
elseif (APPLE)
find_library(FOUNDATION NAMES Foundation)
target_link_libraries(libimhex PUBLIC ${FOUNDATION})
find_library(USERNOTIFICATIONS NAMES UserNotifications)
target_link_libraries(libimhex PUBLIC ${FOUNDATION} ${USERNOTIFICATIONS})
endif ()
target_link_libraries(libimhex PRIVATE microtar libwolv ${NFD_LIBRARIES} magic dl ${JTHREAD_LIBRARIES})
target_link_libraries(libimhex PUBLIC libpl ${IMGUI_LIBRARIES})
target_link_libraries(libimhex PRIVATE libpl microtar ${NFD_LIBRARIES} magic)
target_link_libraries(libimhex PUBLIC libwolv libpl_includes libpl-gen ${IMGUI_LIBRARIES} ${JTHREAD_LIBRARIES})
if (IMHEX_ENABLE_IMGUI_TEST_ENGINE)
target_link_libraries(libimhex PUBLIC imgui_test_engine)
endif()
if (NOT WIN32)
target_link_libraries(libimhex PRIVATE dl)
endif()
if (NOT EMSCRIPTEN)
# curl is only used in non-emscripten builds
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} CURL::libcurl)
endif()
target_include_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${MBEDTLS_INCLUDE_DIR} ${LIBBACKTRACE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS})
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${MBEDTLS_LIBRARIES})
target_link_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${MBEDTLS_LIBRARY_DIR} ${MAGIC_LIBRARY_DIRS})
precompileHeaders(libimhex "${CMAKE_CURRENT_SOURCE_DIR}/include")
endif()
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${NLOHMANN_JSON_LIBRARIES} imgui_all_includes ${MBEDTLS_LIBRARIES} ${FMT_LIBRARIES} ${LUNASVG_LIBRARIES} boost::regex)
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${NLOHMANN_JSON_LIBRARIES} imgui_all_includes ${FMT_LIBRARIES} ${LUNASVG_LIBRARIES} ${BOOST_LIBRARIES} tracing)
set_property(TARGET libimhex PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE)

View File

@@ -0,0 +1,58 @@
module;
#include <cmath>
#include <map>
#include <string>
#include <string_view>
#include <vector>
#include <exception>
#include <algorithm>
#include <locale>
#include <array>
#include <filesystem>
#include <functional>
#include <memory>
#include <list>
#include <atomic>
#include <ranges>
#include <fstream>
#include <thread>
#include <future>
#include <fmt/format.h>
#include <nlohmann/json.hpp>
#include <wolv/io/file.hpp>
#include <imgui.h>
#include <imgui_internal.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <hex/helpers/auto_reset.hpp>
#include <hex/api/event_manager.hpp>
#include <hex/providers/provider.hpp>
#include <hex/providers/provider_data.hpp>
#include <hex/data_processor/node.hpp>
#include <hex/data_processor/link.hpp>
#include <hex/data_processor/attribute.hpp>
#include <pl/pattern_language.hpp>
export module hex;
#define HEX_MODULE_EXPORT
#include <hex/api/imhex_api/bookmarks.hpp>
#include <hex/api/imhex_api/hex_editor.hpp>
#include <hex/api/imhex_api/fonts.hpp>
#include <hex/api/imhex_api/messaging.hpp>
#include <hex/api/imhex_api/provider.hpp>
#include <hex/api/imhex_api/system.hpp>
#include <hex/api/task_manager.hpp>
#include <hex/api/achievement_manager.hpp>
#include <hex/api/layout_manager.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/api/plugin_manager.hpp>
#include <hex/api/shortcut_manager.hpp>
#include <hex/api/theme_manager.hpp>
#include <hex/api/tutorial_manager.hpp>
#include <hex/api/workspace_manager.hpp>

View File

@@ -1,4 +1,9 @@
#pragma once
#include <hex/helpers/types.hpp>
#include <hex/helpers/intrinsics.hpp>
#if defined(HEX_MODULE_EXPORT)
#define EXPORT_MODULE export
#else
#define EXPORT_MODULE
#endif

View File

@@ -14,8 +14,9 @@
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <hex/api/localization_manager.hpp>
#include <hex/helpers/auto_reset.hpp>
namespace hex {
EXPORT_MODULE namespace hex {
class AchievementManager;
@@ -144,62 +145,17 @@ namespace hex {
* @brief Returns the icon of the achievement
* @return Icon of the achievement
*/
[[nodiscard]] const ImGuiExt::Texture &getIcon() const {
if (m_iconData.empty())
return m_icon;
if (m_icon.isValid())
return m_icon;
m_icon = ImGuiExt::Texture::fromImage(m_iconData.data(), m_iconData.size(), ImGuiExt::Texture::Filter::Linear);
return m_icon;
[[nodiscard]] const char* getIcon() const {
return m_icon.c_str();
}
/**
* @brief Sets the icon of the achievement
* @param data Icon data
* @param icon Icon glyph
* @return Reference to the achievement
*/
Achievement& setIcon(std::span<const std::byte> data) {
m_iconData.reserve(data.size());
for (auto &byte : data)
m_iconData.emplace_back(static_cast<u8>(byte));
return *this;
}
/**
* @brief Sets the icon of the achievement
* @param data Icon data
* @return Reference to the achievement
*/
Achievement& setIcon(std::span<const u8> data) {
m_iconData.assign(data.begin(), data.end());
return *this;
}
/**
* @brief Sets the icon of the achievement
* @param data Icon data
* @return Reference to the achievement
*/
Achievement& setIcon(std::vector<u8> data) {
m_iconData = std::move(data);
return *this;
}
/**
* @brief Sets the icon of the achievement
* @param data Icon data
* @return Reference to the achievement
*/
Achievement& setIcon(const std::vector<std::byte> &data) {
m_iconData.reserve(data.size());
for (auto &byte : data)
m_iconData.emplace_back(static_cast<u8>(byte));
Achievement& setIcon(std::string icon) {
m_icon = std::move(icon);
return *this;
}
@@ -283,8 +239,7 @@ namespace hex {
std::function<void(Achievement &)> m_clickCallback;
std::vector<u8> m_iconData;
mutable ImGuiExt::Texture m_icon;
std::string m_icon;
u32 m_progress = 0;
u32 m_maxProgress = 1;
@@ -295,6 +250,7 @@ namespace hex {
};
class AchievementManager {
static bool s_initialized;
public:
AchievementManager() = delete;
@@ -309,11 +265,15 @@ namespace hex {
}
[[nodiscard]] bool isUnlockable() const {
return std::all_of(this->parents.begin(), this->parents.end(), [](auto &parent) { return parent->achievement->isUnlocked(); });
return std::ranges::all_of(this->parents, [](const auto &parent) {
return parent->achievement->isUnlocked();
});
}
[[nodiscard]] bool isVisible() const {
return std::all_of(this->visibilityParents.begin(), this->visibilityParents.end(), [](auto &parent) { return parent->achievement->isUnlocked(); });
return std::ranges::all_of(this->visibilityParents, [](const auto &parent) {
return parent->achievement->isUnlocked();
});
}
[[nodiscard]] bool isUnlocked() const {
@@ -360,7 +320,7 @@ namespace hex {
* @brief Returns all registered achievements
* @return All achievements
*/
static const std::unordered_map<std::string, std::unordered_map<std::string, std::unique_ptr<Achievement>>>& getAchievements();
static const std::unordered_map<UnlocalizedString, std::unordered_map<UnlocalizedString, std::unique_ptr<Achievement>>>& getAchievements();
/**
* @brief Returns all achievement start nodes
@@ -368,14 +328,14 @@ namespace hex {
* @param rebuild Whether to rebuild the list of start nodes
* @return All achievement start nodes
*/
static const std::unordered_map<std::string, std::vector<AchievementNode*>>& getAchievementStartNodes(bool rebuild = true);
static const std::unordered_map<UnlocalizedString, std::vector<AchievementNode*>>& getAchievementStartNodes(bool rebuild = true);
/**
* @brief Returns all achievement nodes
* @param rebuild Whether to rebuild the list of nodes
* @return All achievement nodes
*/
static const std::unordered_map<std::string, std::list<AchievementNode>>& getAchievementNodes(bool rebuild = true);
static const std::unordered_map<UnlocalizedString, std::list<AchievementNode>>& getAchievementNodes(bool rebuild = true);
/**
* @brief Loads the progress of all achievements from the achievements save file
@@ -404,4 +364,4 @@ namespace hex {
static Achievement& addAchievementImpl(std::unique_ptr<Achievement> &&newAchievement);
};
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
#pragma once
#include <hex.hpp>
#include <functional>
#include <hex/api/localization_manager.hpp>
EXPORT_MODULE namespace hex {
/* Background Service Registry. Allows adding new background services */
namespace ContentRegistry::BackgroundServices {
namespace impl {
using Callback = std::function<void()>;
void stopServices();
}
void registerService(const UnlocalizedString &unlocalizedString, const impl::Callback &callback);
}
}

View File

@@ -0,0 +1,104 @@
#pragma once
#include <hex.hpp>
#include <hex/api/localization_manager.hpp>
#include <string>
#include <functional>
#include <optional>
#include <vector>
EXPORT_MODULE namespace hex {
/* Command Palette Command Registry. Allows adding of new commands to the command palette */
namespace ContentRegistry::CommandPalette {
enum class Type : u32 {
SymbolCommand,
KeywordCommand
};
namespace impl {
using QueryResultCallback = std::function<void(std::string)>;
struct QueryResult {
std::string name;
QueryResultCallback callback;
};
using ContentDisplayCallback = std::function<void()>;
using DisplayCallback = std::function<std::string(std::string)>;
using ExecuteCallback = std::function<std::optional<std::string>(std::string)>;
using QueryCallback = std::function<std::vector<QueryResult>(std::string)>;
struct Entry {
Type type;
std::string command;
UnlocalizedString unlocalizedDescription;
DisplayCallback displayCallback;
ExecuteCallback executeCallback;
};
struct Handler {
Type type;
std::string command;
QueryCallback queryCallback;
DisplayCallback displayCallback;
};
struct ContentDisplay {
bool showSearchBox;
ContentDisplayCallback callback;
};
const std::vector<Entry>& getEntries();
const std::vector<Handler>& getHandlers();
std::optional<ContentDisplay>& getDisplayedContent();
}
/**
* @brief Adds a new command to the command palette
* @param type The type of the command
* @param command The command to add
* @param unlocalizedDescription The description of the command
* @param displayCallback The callback that will be called when the command is displayed in the command palette
* @param executeCallback The callback that will be called when the command is executed
*/
void add(
Type type,
const std::string &command,
const UnlocalizedString &unlocalizedDescription,
const impl::DisplayCallback &displayCallback,
const impl::ExecuteCallback &executeCallback = [](auto) { return std::nullopt; });
/**
* @brief Adds a new command handler to the command palette
* @param type The type of the command
* @param command The command to add
* @param queryCallback The callback that will be called when the command palette wants to load the name and callback items
* @param displayCallback The callback that will be called when the command is displayed in the command palette
*/
void addHandler(
Type type,
const std::string &command,
const impl::QueryCallback &queryCallback,
const impl::DisplayCallback &displayCallback);
/**
* @brief Specify UI content that will be displayed inside the command palette
* @param displayCallback Display callback that will be called to display the content
*/
void setDisplayedContent(const impl::ContentDisplayCallback &displayCallback);
/**
* @brief Opens the command palette window, displaying a user defined interface
* @param displayCallback Display callback that will be called to display the content
*/
void openWithContent(const impl::ContentDisplayCallback &displayCallback);
}
}

View File

@@ -0,0 +1,25 @@
#pragma once
#include <hex.hpp>
#include <nlohmann/json_fwd.hpp>
#include <map>
#include <string>
EXPORT_MODULE namespace hex {
/* Network Communication Interface Registry. Allows adding new communication interface endpoints */
namespace ContentRegistry::CommunicationInterface {
namespace impl {
using NetworkCallback = std::function<nlohmann::json(const nlohmann::json &)>;
const std::map<std::string, NetworkCallback>& getNetworkEndpoints();
}
void registerNetworkEndpoint(const std::string &endpoint, const impl::NetworkCallback &callback);
}
}

View File

@@ -0,0 +1,73 @@
#pragma once
#include <hex.hpp>
#include <hex/api/localization_manager.hpp>
#include <string>
#include <functional>
#include <vector>
EXPORT_MODULE namespace hex {
#if !defined(HEX_MODULE_EXPORT)
namespace prv { class Provider; }
#endif
/* Data Formatter Registry. Allows adding formatters that are used in the Copy-As menu for example */
namespace ContentRegistry::DataFormatter {
namespace impl {
using Callback = std::function<std::string(prv::Provider *provider, u64 address, size_t size, bool preview)>;
struct ExportMenuEntry {
UnlocalizedString unlocalizedName;
Callback callback;
};
struct FindOccurrence {
Region region;
std::endian endian = std::endian::native;
enum class DecodeType : u8 { ASCII, UTF8, Binary, UTF16, Unsigned, Signed, Float, Double } decodeType;
bool selected;
std::string string;
};
using FindExporterCallback = std::function<std::vector<u8>(const std::vector<FindOccurrence>&, std::function<std::string(FindOccurrence)>)>;
struct FindExporterEntry {
UnlocalizedString unlocalizedName;
std::string fileExtension;
FindExporterCallback callback;
};
/**
* @brief Retrieves a list of all registered data formatters used by the 'File -> Export' menu
*/
const std::vector<ExportMenuEntry>& getExportMenuEntries();
/**
* @brief Retrieves a list of all registered data formatters used in the Results section of the 'Find' view
*/
const std::vector<FindExporterEntry>& getFindExporterEntries();
}
/**
* @brief Adds a new data formatter
* @param unlocalizedName The unlocalized name of the formatter
* @param callback The function to call to format the data
*/
void addExportMenuEntry(const UnlocalizedString &unlocalizedName, const impl::Callback &callback);
/**
* @brief Adds a new data exporter for Find results
* @param unlocalizedName The unlocalized name of the formatter
* @param fileExtension The file extension to use for the exported file
* @param callback The function to call to format the data
*/
void addFindExportFormatter(const UnlocalizedString &unlocalizedName, const std::string &fileExtension, const impl::FindExporterCallback &callback);
}
}

View File

@@ -0,0 +1,81 @@
#pragma once
#include <hex.hpp>
#include <hex/api/task_manager.hpp>
#include <hex/api/localization_manager.hpp>
#include <nlohmann/json_fwd.hpp>
#include <atomic>
#include <functional>
#include <memory>
#include <vector>
EXPORT_MODULE namespace hex {
#if !defined(HEX_MODULE_EXPORT)
namespace prv { class Provider; }
#endif
/* Data Information Registry. Allows adding new analyzers to the data information view */
namespace ContentRegistry::DataInformation {
class InformationSection {
public:
InformationSection(const UnlocalizedString &unlocalizedName, const UnlocalizedString &unlocalizedDescription = "", bool hasSettings = false)
: m_unlocalizedName(unlocalizedName), m_unlocalizedDescription(unlocalizedDescription),
m_hasSettings(hasSettings) { }
virtual ~InformationSection() = default;
[[nodiscard]] const UnlocalizedString& getUnlocalizedName() const { return m_unlocalizedName; }
[[nodiscard]] const UnlocalizedString& getUnlocalizedDescription() const { return m_unlocalizedDescription; }
virtual void process(Task &task, prv::Provider *provider, Region region) = 0;
virtual void reset() = 0;
virtual void drawSettings() { }
virtual void drawContent() = 0;
[[nodiscard]] bool isValid() const { return m_valid; }
void markValid(bool valid = true) { m_valid = valid; }
[[nodiscard]] bool isEnabled() const { return m_enabled; }
void setEnabled(bool enabled) { m_enabled = enabled; }
[[nodiscard]] bool isAnalyzing() const { return m_analyzing; }
void setAnalyzing(bool analyzing) { m_analyzing = analyzing; }
virtual void load(const nlohmann::json &data);
[[nodiscard]] virtual nlohmann::json store();
[[nodiscard]] bool hasSettings() const { return m_hasSettings; }
private:
UnlocalizedString m_unlocalizedName, m_unlocalizedDescription;
bool m_hasSettings;
std::atomic<bool> m_analyzing = false;
std::atomic<bool> m_valid = false;
std::atomic<bool> m_enabled = true;
};
namespace impl {
using CreateCallback = std::function<std::unique_ptr<InformationSection>()>;
const std::vector<CreateCallback>& getInformationSectionConstructors();
void addInformationSectionCreator(const CreateCallback &callback);
}
template<typename T>
void addInformationSection(auto && ...args) {
impl::addInformationSectionCreator([args...] {
return std::make_unique<T>(std::forward<decltype(args)>(args)...);
});
}
}
}

View File

@@ -0,0 +1,80 @@
#pragma once
#include <hex.hpp>
#include <hex/api/localization_manager.hpp>
#include <functional>
#include <optional>
#include <string>
#include <vector>
EXPORT_MODULE namespace hex {
/* Data Inspector Registry. Allows adding of new types to the data inspector */
namespace ContentRegistry::DataInspector {
enum class NumberDisplayStyle : u8 {
Decimal,
Hexadecimal,
Octal
};
namespace impl {
using DisplayFunction = std::function<std::string()>;
using EditingFunction = std::function<std::vector<u8>(std::string, std::endian)>;
using GeneratorFunction = std::function<DisplayFunction(const std::vector<u8> &, std::endian, NumberDisplayStyle)>;
struct Entry {
UnlocalizedString unlocalizedName;
size_t requiredSize;
size_t maxSize;
GeneratorFunction generatorFunction;
std::optional<EditingFunction> editingFunction;
};
const std::vector<Entry>& getEntries();
}
/**
* @brief Adds a new entry to the data inspector
* @param unlocalizedName The unlocalized name of the entry
* @param requiredSize The minimum required number of bytes available for the entry to appear
* @param displayGeneratorFunction The function that will be called to generate the display function
* @param editingFunction The function that will be called to edit the data
*/
void add(
const UnlocalizedString &unlocalizedName,
size_t requiredSize,
impl::GeneratorFunction displayGeneratorFunction,
std::optional<impl::EditingFunction> editingFunction = std::nullopt
);
/**
* @brief Adds a new entry to the data inspector
* @param unlocalizedName The unlocalized name of the entry
* @param requiredSize The minimum required number of bytes available for the entry to appear
* @param maxSize The maximum number of bytes to read from the data
* @param displayGeneratorFunction The function that will be called to generate the display function
* @param editingFunction The function that will be called to edit the data
*/
void add(
const UnlocalizedString &unlocalizedName,
size_t requiredSize,
size_t maxSize,
impl::GeneratorFunction displayGeneratorFunction,
std::optional<impl::EditingFunction> editingFunction = std::nullopt
);
/**
* @brief Allows adding new menu items to data inspector row context menus. Call this function inside the
* draw function of the data inspector row definition.
* @param function Callback that will draw menu items
*/
void drawMenuItems(const std::function<void()> &function);
}
}

View File

@@ -0,0 +1,64 @@
#pragma once
#include <hex.hpp>
#include <hex/api/localization_manager.hpp>
#include <functional>
#include <memory>
#include <vector>
EXPORT_MODULE namespace hex {
#if !defined(HEX_MODULE_EXPORT)
namespace dp { class Node; }
#endif
/* Data Processor Node Registry. Allows adding new processor nodes to be used in the data processor */
namespace ContentRegistry::DataProcessor {
namespace impl {
using CreatorFunction = std::function<std::unique_ptr<dp::Node>()>;
struct Entry {
UnlocalizedString unlocalizedCategory;
UnlocalizedString unlocalizedName;
CreatorFunction creatorFunction;
};
void add(const Entry &entry);
const std::vector<Entry>& getEntries();
}
/**
* @brief Adds a new node to the data processor
* @tparam T The custom node class that extends dp::Node
* @tparam Args Arguments types
* @param unlocalizedCategory The unlocalized category name of the node
* @param unlocalizedName The unlocalized name of the node
* @param args Arguments passed to the constructor of the node
*/
template<std::derived_from<dp::Node> T, typename... Args>
void add(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedName, Args &&...args) {
add(impl::Entry {
unlocalizedCategory,
unlocalizedName,
[unlocalizedName, ...args = std::forward<Args>(args)]() mutable {
auto node = std::make_unique<T>(std::forward<Args>(args)...);
node->setUnlocalizedName(unlocalizedName);
return node;
}
});
}
/**
* @brief Adds a separator to the data processor right click menu
*/
void addSeparator();
}
}

View File

@@ -0,0 +1,68 @@
#pragma once
#include <hex.hpp>
#include <hex/api/localization_manager.hpp>
#include <wolv/container/interval_tree.hpp>
#include <vector>
#include <memory>
EXPORT_MODULE namespace hex {
#if !defined(HEX_MODULE_EXPORT)
namespace prv { class Provider; }
#endif
/* Diffing Registry. Allows adding new diffing algorithms */
namespace ContentRegistry::Diffing {
enum class DifferenceType : u8 {
Match = 0,
Insertion = 1,
Deletion = 2,
Mismatch = 3
};
using DiffTree = wolv::container::IntervalTree<DifferenceType>;
class Algorithm {
public:
explicit Algorithm(UnlocalizedString unlocalizedName, UnlocalizedString unlocalizedDescription)
: m_unlocalizedName(std::move(unlocalizedName)),
m_unlocalizedDescription(std::move(unlocalizedDescription)) { }
virtual ~Algorithm() = default;
virtual std::vector<DiffTree> analyze(prv::Provider *providerA, prv::Provider *providerB) const = 0;
virtual void drawSettings() { }
const UnlocalizedString& getUnlocalizedName() const { return m_unlocalizedName; }
const UnlocalizedString& getUnlocalizedDescription() const { return m_unlocalizedDescription; }
private:
UnlocalizedString m_unlocalizedName, m_unlocalizedDescription;
};
namespace impl {
const std::vector<std::unique_ptr<Algorithm>>& getAlgorithms();
void addAlgorithm(std::unique_ptr<Algorithm> &&hash);
}
/**
* @brief Adds a new hash
* @tparam T The hash type that extends hex::Hash
* @param args The arguments to pass to the constructor of the hash
*/
template<typename T, typename ... Args>
void addAlgorithm(Args && ... args) {
impl::addAlgorithm(std::make_unique<T>(std::forward<Args>(args)...));
}
}
}

View File

@@ -0,0 +1,64 @@
#pragma once
#include <hex.hpp>
#include <hex/api/localization_manager.hpp>
#include <string>
#include <map>
#include <memory>
#include <functional>
#include <optional>
#include <span>
EXPORT_MODULE namespace hex {
/* Disassembler Registry. Allows adding new disassembler architectures */
namespace ContentRegistry::Disassemblers {
struct Instruction {
u64 address;
u64 offset;
size_t size;
std::string bytes;
std::string mnemonic;
std::string operators;
};
class Architecture {
public:
explicit Architecture(std::string name) : m_name(std::move(name)) {}
virtual ~Architecture() = default;
virtual bool start() = 0;
virtual void end() = 0;
virtual std::optional<Instruction> disassemble(u64 imageBaseAddress, u64 instructionLoadAddress, u64 instructionDataAddress, std::span<const u8> code) = 0;
virtual void drawSettings() = 0;
[[nodiscard]] const std::string& getName() const { return m_name; }
private:
std::string m_name;
};
namespace impl {
using CreatorFunction = std::function<std::unique_ptr<Architecture>()>;
void addArchitectureCreator(CreatorFunction function);
const std::map<std::string, CreatorFunction>& getArchitectures();
}
template<std::derived_from<Architecture> T>
void add(auto && ...args) {
impl::addArchitectureCreator([...args = std::move(args)] {
return std::make_unique<T>(args...);
});
}
}
}

View File

@@ -0,0 +1,36 @@
#pragma once
#include <hex.hpp>
#include <hex/api/localization_manager.hpp>
#include <map>
#include <string>
EXPORT_MODULE namespace hex {
/* Experiments Registry. Allows adding new experiments */
namespace ContentRegistry::Experiments {
namespace impl {
struct Experiment {
UnlocalizedString unlocalizedName, unlocalizedDescription;
bool enabled;
};
const std::map<std::string, Experiment>& getExperiments();
}
void addExperiment(
const std::string &experimentName,
const UnlocalizedString &unlocalizedName,
const UnlocalizedString &unlocalizedDescription = ""
);
void enableExperiement(const std::string &experimentName, bool enabled);
[[nodiscard]] bool isExperimentEnabled(const std::string &experimentName);
}
}

View File

@@ -0,0 +1,37 @@
#pragma once
#include <hex.hpp>
#include <hex/helpers/fs.hpp>
#include <vector>
#include <string>
#include <functional>
EXPORT_MODULE namespace hex {
/* File Handler Registry. Allows adding handlers for opening files specific file types */
namespace ContentRegistry::FileTypeHandler {
namespace impl {
using Callback = std::function<bool(std::fs::path)>;
struct Entry {
std::vector<std::string> extensions;
Callback callback;
};
const std::vector<Entry>& getEntries();
}
/**
* @brief Adds a new file handler
* @param extensions The file extensions to handle
* @param callback The function to call to handle the file
*/
void add(const std::vector<std::string> &extensions, const impl::Callback &callback);
}
}

View File

@@ -0,0 +1,91 @@
#pragma once
#include <hex.hpp>
#include <hex/api/localization_manager.hpp>
#include <vector>
#include <string>
#include <memory>
#include <functional>
#include <nlohmann/json_fwd.hpp>
EXPORT_MODULE namespace hex {
#if !defined(HEX_MODULE_EXPORT)
namespace prv { class Provider; }
#endif
/* Hash Registry. Allows adding new hashes to the Hash view */
namespace ContentRegistry::Hashes {
class Hash {
public:
explicit Hash(UnlocalizedString unlocalizedName) : m_unlocalizedName(std::move(unlocalizedName)) {}
virtual ~Hash() = default;
class Function {
public:
using Callback = std::function<std::vector<u8>(const Region&, prv::Provider *)>;
Function(Hash *type, std::string name, Callback callback)
: m_type(type), m_name(std::move(name)), m_callback(std::move(callback)) {
}
[[nodiscard]] Hash *getType() { return m_type; }
[[nodiscard]] const Hash *getType() const { return m_type; }
[[nodiscard]] const std::string& getName() const { return m_name; }
std::vector<u8> get(const Region& region, prv::Provider *provider) const {
return m_callback(region, provider);
}
private:
Hash *m_type;
std::string m_name;
Callback m_callback;
};
virtual void draw() { }
[[nodiscard]] virtual Function create(std::string name) = 0;
[[nodiscard]] virtual nlohmann::json store() const = 0;
virtual void load(const nlohmann::json &json) = 0;
[[nodiscard]] const UnlocalizedString& getUnlocalizedName() const {
return m_unlocalizedName;
}
protected:
[[nodiscard]] Function create(const std::string &name, const Function::Callback &callback) {
return { this, name, callback };
}
private:
UnlocalizedString m_unlocalizedName;
};
namespace impl {
const std::vector<std::unique_ptr<Hash>>& getHashes();
void add(std::unique_ptr<Hash> &&hash);
}
/**
* @brief Adds a new hash
* @tparam T The hash type that extends hex::Hash
* @param args The arguments to pass to the constructor of the hash
*/
template<typename T, typename ... Args>
void add(Args && ... args) {
impl::add(std::make_unique<T>(std::forward<Args>(args)...));
}
}
}

View File

@@ -0,0 +1,91 @@
#pragma once
#include <hex.hpp>
#include <imgui.h>
#include <hex/api/localization_manager.hpp>
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include <span>
EXPORT_MODULE namespace hex {
/* Hex Editor Registry. Allows adding new functionality to the hex editor */
namespace ContentRegistry::HexEditor {
class DataVisualizer {
public:
DataVisualizer(UnlocalizedString unlocalizedName, u16 bytesPerCell, u16 maxCharsPerCell)
: m_unlocalizedName(std::move(unlocalizedName)),
m_bytesPerCell(bytesPerCell),
m_maxCharsPerCell(maxCharsPerCell) { }
virtual ~DataVisualizer() = default;
virtual void draw(u64 address, const u8 *data, size_t size, bool upperCase) = 0;
virtual bool drawEditing(u64 address, u8 *data, size_t size, bool upperCase, bool startedEditing) = 0;
[[nodiscard]] u16 getBytesPerCell() const { return m_bytesPerCell; }
[[nodiscard]] u16 getMaxCharsPerCell() const { return m_maxCharsPerCell; }
[[nodiscard]] const UnlocalizedString& getUnlocalizedName() const { return m_unlocalizedName; }
[[nodiscard]] static int DefaultTextInputFlags();
protected:
bool drawDefaultScalarEditingTextBox(u64 address, const char *format, ImGuiDataType dataType, u8 *data, ImGuiInputTextFlags flags) const;
bool drawDefaultTextEditingTextBox(u64 address, std::string &data, ImGuiInputTextFlags flags) const;
private:
UnlocalizedString m_unlocalizedName;
u16 m_bytesPerCell;
u16 m_maxCharsPerCell;
};
struct MiniMapVisualizer {
using Callback = std::function<void(u64, std::span<const u8>, std::vector<ImColor>&)>;
UnlocalizedString unlocalizedName;
Callback callback;
};
namespace impl {
void addDataVisualizer(std::shared_ptr<DataVisualizer> &&visualizer);
const std::vector<std::shared_ptr<DataVisualizer>>& getVisualizers();
const std::vector<std::shared_ptr<MiniMapVisualizer>>& getMiniMapVisualizers();
}
/**
* @brief Adds a new cell data visualizer
* @tparam T The data visualizer type that extends hex::DataVisualizer
* @param args The arguments to pass to the constructor of the data visualizer
*/
template<std::derived_from<DataVisualizer> T, typename... Args>
void addDataVisualizer(Args &&...args) {
return impl::addDataVisualizer(std::make_shared<T>(std::forward<Args>(args)...));
}
/**
* @brief Gets a data visualizer by its unlocalized name
* @param unlocalizedName Unlocalized name of the data visualizer
* @return The data visualizer, or nullptr if it doesn't exist
*/
std::shared_ptr<DataVisualizer> getVisualizerByName(const UnlocalizedString &unlocalizedName);
/**
* @brief Adds a new minimap visualizer
* @param unlocalizedName Unlocalized name of the minimap visualizer
* @param callback The callback that will be called to get the color of a line
*/
void addMiniMapVisualizer(UnlocalizedString unlocalizedName, MiniMapVisualizer::Callback callback);
}
}

Some files were not shown because too many files have changed in this diff Show More