summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO22
-rw-r--r--0001-Fix-crash-on-pattern-load-319.patch (renamed from 0001-Fix-raised-exception-when-a-pattern-directory-does-n.patch)27
-rw-r--r--0002-patterns-Limit-number-of-characters-displayed-in-a-s.patch54
-rw-r--r--0003-Fix-infinite-loop-on-signal-handling.patch (renamed from 0002-Fix-infinite-loop-on-signal-handling.patch)4
-rw-r--r--PKGBUILD27
5 files changed, 101 insertions, 33 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e0d228dc648c..27d1b5d31405 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = imhex
pkgdesc = A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM
pkgver = 1.10.1
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/WerWolv/ImHex
arch = x86_64
license = GPL2
@@ -26,25 +26,29 @@ pkgbase = imhex
source = nativefiledialog::git+https://github.com/btzy/nativefiledialog-extended.git
source = git+https://git.sr.ht/~danyspin97/xdgpp
source = imhex.desktop
- source = 0001-Fix-raised-exception-when-a-pattern-directory-does-n.patch
- source = 0002-Fix-infinite-loop-on-signal-handling.patch
+ source = 0001-Fix-crash-on-pattern-load-319.patch
+ source = 0002-patterns-Limit-number-of-characters-displayed-in-a-s.patch
+ source = 0003-Fix-infinite-loop-on-signal-handling.patch
cksums = SKIP
cksums = SKIP
cksums = SKIP
cksums = 4178124713
- cksums = 229967015
- cksums = 1954423175
+ cksums = 3591955572
+ cksums = 35583119
+ cksums = 1275958398
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
sha256sums = 72525512a241589cecd6141f32ad36cbe1b5b6f2629dd8ead0e37812321bdde6
- sha256sums = 5db9f458a36777333d7b3302249c90f82338f4d4f6dd0366e9b005c15034c388
- sha256sums = 5438cc0ee91933584d678dd3fea5ad0cbe15f4bd7ac1cebb572a28b7479d86df
+ sha256sums = cbe6a0f3623503be2c57905a2ed405ae3001ff5d8a8a708492f488f89672726c
+ sha256sums = ba9794ebef4cec1085fe597f6b6e997e85ca9d839b084722729c7471d1117383
+ sha256sums = 43a3ad9a9bc05382dde3da52d6f065f0c770457e47629eb0363eb6968fa317c4
b2sums = SKIP
b2sums = SKIP
b2sums = SKIP
b2sums = 7b2d029de385fdc2536f57a4364add9752b9a5dc31df501e07bff1fd69fdd1de2afa19a5ac5a4c87fbf21c5d87cc96d3fe30d58825c050f5a7d25f6d85d08efc
- b2sums = c2a86c31a33cfe40a379dd43fcb9c4c8105a23cd26721183d1207021b93a1d9aeb8abdeb873dc40dacd31896da844b84d0a8884c7819581a1c13d489d8c96f44
- b2sums = 81b3d264ef7443fa63e2e40cd4883c1f137cc7fc4423d66210d06fb4fcfe30d09de3ccf60db75d1e74e7c5039c4fc47e501b38a4b8169f054ccab1587eca07c6
+ b2sums = 761635626e86b05bb03584219ef38e12abec1d2ef9dc78453ae0304fcbedbaa7c8f4859e5db8b89e08104bc94bcdd10d22de318628725cb8a0bde099f9a8ea25
+ b2sums = b83335ebf63db82605aac11b26fe87a09db8bd6b80d780bda168c10df6669c31554b6919c53b46db664a3f6f0748d220d007042fb7b2c20743581c6b64217c90
+ b2sums = 8ffcb4fe81d5290a53d95498ae64c18f158fc4312140d6ae23bd802ee5346de477c4c9fa2adc0db039dd1c2733d8268294dcee82c81066aac8d4e3018a6607dd
pkgname = imhex
diff --git a/0001-Fix-raised-exception-when-a-pattern-directory-does-n.patch b/0001-Fix-crash-on-pattern-load-319.patch
index 84b27dc23bc7..0abbcb49f6ef 100644
--- a/0001-Fix-raised-exception-when-a-pattern-directory-does-n.patch
+++ b/0001-Fix-crash-on-pattern-load-319.patch
@@ -1,27 +1,32 @@
-From 64ce115ff948387f318f8af4fda40b9add36a254 Mon Sep 17 00:00:00 2001
-From: KokaKiwi <kokakiwi+git@kokakiwi.net>
-Date: Tue, 9 Nov 2021 16:10:34 +0100
-Subject: [PATCH 1/2] Fix raised exception when a pattern directory does not
- exists.
+From 655a1d4f170fff1689ac3dcdbda6c79ff1c85409 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Anton=20=C3=84lgmyr?= <anton@algmyr.se>
+Date: Sat, 9 Oct 2021 17:08:45 +0200
+Subject: [PATCH 1/3] Fix crash on pattern load (#319)
-Signed-off-by: KokaKiwi <kokakiwi+git@kokakiwi.net>
---
- source/views/view_pattern_editor.cpp | 2 ++
- 1 file changed, 2 insertions(+)
+ source/views/view_pattern_editor.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/source/views/view_pattern_editor.cpp b/source/views/view_pattern_editor.cpp
-index 2608679..475b337 100644
+index 2608679..734b94f 100644
--- a/source/views/view_pattern_editor.cpp
+++ b/source/views/view_pattern_editor.cpp
@@ -191,6 +191,8 @@ namespace hex {
this->m_possiblePatternFiles.clear();
for (auto &imhexPath : hex::getPath(ImHexPath::Patterns)) {
-+ if (!fs::exists(imhexPath))
-+ continue;
++ if (!fs::exists(imhexPath)) continue;
++
for (auto &entry: fs::recursive_directory_iterator(imhexPath)) {
if (entry.is_regular_file() && entry.path().extension() == ".hexpat") {
this->m_possiblePatternFiles.push_back(entry.path());
+@@ -417,4 +419,4 @@ namespace hex {
+
+ }
+
+-}
+\ No newline at end of file
++}
--
2.33.1
diff --git a/0002-patterns-Limit-number-of-characters-displayed-in-a-s.patch b/0002-patterns-Limit-number-of-characters-displayed-in-a-s.patch
new file mode 100644
index 000000000000..bf04ee774123
--- /dev/null
+++ b/0002-patterns-Limit-number-of-characters-displayed-in-a-s.patch
@@ -0,0 +1,54 @@
+From 6a1d0988d3c3bc9f135915542c37f953c0c262eb Mon Sep 17 00:00:00 2001
+From: WerWolv <werwolv98@gmail.com>
+Date: Mon, 11 Oct 2021 20:59:14 +0200
+Subject: [PATCH 2/3] patterns: Limit number of characters displayed in a
+ string pattern
+
+---
+ .../hex/pattern_language/pattern_data.hpp | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp b/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp
+index fdcc8b0..24cac33 100644
+--- a/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp
++++ b/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp
+@@ -598,10 +598,12 @@ namespace hex::pl {
+ }
+
+ void createEntry(prv::Provider* &provider) override {
+- std::string buffer(this->getSize(), 0x00);
+- provider->read(this->getOffset(), buffer.data(), this->getSize());
++ auto size = std::min<size_t>(this->getSize(), 0x7F);
++ std::string buffer(size, 0x00);
+
+- this->createDefaultEntry(hex::format("\"{0}\"", makeDisplayable(buffer.data(), this->getSize()).c_str()), buffer);
++ provider->read(this->getOffset(), buffer.data(), size);
++
++ this->createDefaultEntry(hex::format("\"{0}\" {1}", makeDisplayable(buffer.data(), this->getSize()), size > this->getSize() ? "(truncated)" : ""), buffer);
+ }
+
+ [[nodiscard]] std::string getFormattedName() const override {
+@@ -621,15 +623,17 @@ namespace hex::pl {
+ }
+
+ void createEntry(prv::Provider* &provider) override {
+- std::u16string buffer(this->getSize(), 0x00);
+- provider->read(this->getOffset(), buffer.data(), this->getSize());
++ auto size = std::min<size_t>(this->getSize(), 0x100);
++
++ std::u16string buffer(size, 0x00);
++ provider->read(this->getOffset(), buffer.data(), size);
+
+ for (auto &c : buffer)
+ c = hex::changeEndianess(c, 2, this->getEndian());
+
+ auto utf8String = std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>{}.to_bytes(buffer);
+
+- this->createDefaultEntry(hex::format("\"{0}\"", utf8String), utf8String);
++ this->createDefaultEntry(hex::format("\"{0}\" {1}", utf8String, size > this->getSize() ? "(truncated)" : ""), utf8String);
+ }
+
+ [[nodiscard]] std::string getFormattedName() const override {
+--
+2.33.1
+
diff --git a/0002-Fix-infinite-loop-on-signal-handling.patch b/0003-Fix-infinite-loop-on-signal-handling.patch
index 75d015147089..9623fbf845e0 100644
--- a/0002-Fix-infinite-loop-on-signal-handling.patch
+++ b/0003-Fix-infinite-loop-on-signal-handling.patch
@@ -1,7 +1,7 @@
-From e65265174ecfeba8077e60f5280fde62197fe9ba Mon Sep 17 00:00:00 2001
+From 7d0a277dfd1be4b5ebcd7228acd122934e296f51 Mon Sep 17 00:00:00 2001
From: KokaKiwi <kokakiwi+git@kokakiwi.net>
Date: Tue, 9 Nov 2021 16:11:52 +0100
-Subject: [PATCH 2/2] Fix infinite loop on signal handling.
+Subject: [PATCH 3/3] Fix infinite loop on signal handling.
Signed-off-by: KokaKiwi <kokakiwi+git@kokakiwi.net>
---
diff --git a/PKGBUILD b/PKGBUILD
index d9454e0afc6f..1e03c11e93d4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
_pkgname=ImHex
pkgname=${_pkgname,,}
pkgver=1.10.1
-pkgrel=2
+pkgrel=3
pkgdesc='A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM'
url='https://github.com/WerWolv/ImHex'
license=('GPL2')
@@ -17,26 +17,30 @@ source=("$pkgname::git+https://github.com/WerWolv/ImHex.git#tag=v$pkgver"
"nativefiledialog::git+https://github.com/btzy/nativefiledialog-extended.git"
"git+https://git.sr.ht/~danyspin97/xdgpp"
imhex.desktop
- 0001-Fix-raised-exception-when-a-pattern-directory-does-n.patch
- 0002-Fix-infinite-loop-on-signal-handling.patch)
+ 0001-Fix-crash-on-pattern-load-319.patch
+ 0002-patterns-Limit-number-of-characters-displayed-in-a-s.patch
+ 0003-Fix-infinite-loop-on-signal-handling.patch)
cksums=('SKIP'
'SKIP'
'SKIP'
'4178124713'
- '229967015'
- '1954423175')
+ '3591955572'
+ '35583119'
+ '1275958398')
sha256sums=('SKIP'
'SKIP'
'SKIP'
'72525512a241589cecd6141f32ad36cbe1b5b6f2629dd8ead0e37812321bdde6'
- '5db9f458a36777333d7b3302249c90f82338f4d4f6dd0366e9b005c15034c388'
- '5438cc0ee91933584d678dd3fea5ad0cbe15f4bd7ac1cebb572a28b7479d86df')
+ 'cbe6a0f3623503be2c57905a2ed405ae3001ff5d8a8a708492f488f89672726c'
+ 'ba9794ebef4cec1085fe597f6b6e997e85ca9d839b084722729c7471d1117383'
+ '43a3ad9a9bc05382dde3da52d6f065f0c770457e47629eb0363eb6968fa317c4')
b2sums=('SKIP'
'SKIP'
'SKIP'
'7b2d029de385fdc2536f57a4364add9752b9a5dc31df501e07bff1fd69fdd1de2afa19a5ac5a4c87fbf21c5d87cc96d3fe30d58825c050f5a7d25f6d85d08efc'
- 'c2a86c31a33cfe40a379dd43fcb9c4c8105a23cd26721183d1207021b93a1d9aeb8abdeb873dc40dacd31896da844b84d0a8884c7819581a1c13d489d8c96f44'
- '81b3d264ef7443fa63e2e40cd4883c1f137cc7fc4423d66210d06fb4fcfe30d09de3ccf60db75d1e74e7c5039c4fc47e501b38a4b8169f054ccab1587eca07c6')
+ '761635626e86b05bb03584219ef38e12abec1d2ef9dc78453ae0304fcbedbaa7c8f4859e5db8b89e08104bc94bcdd10d22de318628725cb8a0bde099f9a8ea25'
+ 'b83335ebf63db82605aac11b26fe87a09db8bd6b80d780bda168c10df6669c31554b6919c53b46db664a3f6f0748d220d007042fb7b2c20743581c6b64217c90'
+ '8ffcb4fe81d5290a53d95498ae64c18f158fc4312140d6ae23bd802ee5346de477c4c9fa2adc0db039dd1c2733d8268294dcee82c81066aac8d4e3018a6607dd')
prepare() {
cd "$pkgname"
@@ -51,8 +55,9 @@ prepare() {
git submodule update
git apply \
- "$srcdir/0001-Fix-raised-exception-when-a-pattern-directory-does-n.patch" \
- "$srcdir/0002-Fix-infinite-loop-on-signal-handling.patch"
+ "$srcdir/0001-Fix-crash-on-pattern-load-319.patch" \
+ "$srcdir/0002-patterns-Limit-number-of-characters-displayed-in-a-s.patch" \
+ "$srcdir/0003-Fix-infinite-loop-on-signal-handling.patch"
}
build() {