Compare commits

...

6 Commits

Author SHA1 Message Date
WerWolv 1f6acc101f feat: Allow OTF fonts to be selected 2023-01-12 11:37:19 +01:00
WerWolv 0d91db68db patterns: Added bitmap visualizer 2023-01-12 11:18:36 +01:00
WerWolv 825e788646 git: Added more information to the readme requirements section 2023-01-12 08:50:16 +01:00
Thomas f3815673c0
git: Fix typo on 'Chocolatey' + add uppercase on 'Winget' (#870)
* Fix typo on 'Chocolatey'

* add uppercase on 'Winget'
2023-01-12 08:25:51 +01:00
Thomas b070092a64
git: Add architecture to build artifacts (#869)
* rename win64 artifact to Windows

* add architecture to all artifact names
2023-01-12 08:25:28 +01:00
WerWolv 25ede7ad18 fix: List all intel hex and motorola srec file extensions manually
Fixes #871
2023-01-12 08:20:15 +01:00
11 changed files with 91 additions and 39 deletions

View File

@ -81,6 +81,8 @@ jobs:
..
mingw32-make -j4 install
cpack
mv imhex-*.msi ../imhex-${{env.IMHEX_VERSION}}-Windows-x86_64.msi
echo "ImHex checks for the existence of this file to determine if it is running in portable mode. You should not delete this file" > $PWD/install/PORTABLE
#- name: 🗝️ Sign Windows Installer
@ -97,14 +99,14 @@ jobs:
- name: ⬆️ Upload Windows Installer
uses: actions/upload-artifact@v3
with:
name: Windows Installer
name: Windows Installer x86_64
path: |
build/*.msi
imhex-*.msi
- name: ⬆️ Upload Portable ZIP
uses: actions/upload-artifact@v3
with:
name: Windows Portable
name: Windows Portable x86_64
path: |
build/install/*
@ -119,7 +121,7 @@ jobs:
- name: ⬆️ Upload NoGPU Portable ZIP
uses: actions/upload-artifact@v3
with:
name: Windows Portable NoGPU
name: Windows Portable NoGPU x86_64
path: |
build/install/*
@ -219,14 +221,14 @@ jobs:
-DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.10" \
-DCPACK_PACKAGE_FILE_NAME="imhex-${{env.IMHEX_VERSION}}-macOS${{matrix.suffix}}" \
-DCPACK_PACKAGE_FILE_NAME="imhex-${{env.IMHEX_VERSION}}-macOS${{matrix.suffix}}-x86_64" \
..
make -j4 package
- name: ⬆️ Upload DMG
uses: actions/upload-artifact@v3
with:
name: macOS DMG${{matrix.suffix}}
name: macOS DMG${{matrix.suffix}} x86_64
path: build/*.dmg
# Ubuntu build
@ -303,7 +305,7 @@ jobs:
run: |
cp -r build/DEBIAN build/DebDir
dpkg-deb -Zgzip --build build/DebDir
mv build/DebDir.deb imhex-${{env.IMHEX_VERSION}}-Ubuntu-22.04.deb
mv build/DebDir.deb imhex-${{env.IMHEX_VERSION}}-Ubuntu-22.04-x86_64.deb
# AppImage cmake build
- name: 🛠️ Reconfigure build for AppImage
@ -338,19 +340,19 @@ jobs:
- name: ⬆️ Upload DEB
uses: actions/upload-artifact@v3
with:
name: Ubuntu 22.04 DEB
name: Ubuntu 22.04 DEB x86_64
path: '*.deb'
- name: ⬆️ Upload AppImage
uses: actions/upload-artifact@v3
with:
name: Linux AppImage
name: Linux AppImage x86_64
path: 'build-appimage/*.AppImage'
- name: ⬆️ Upload AppImage zsync
uses: actions/upload-artifact@v3
with:
name: Linux AppImage zsync
name: Linux AppImage zsync x86_64
path: 'build-appimage/*.AppImage.zsync'
# ArchLinux build
@ -429,22 +431,22 @@ jobs:
# the name is a small trick to make makepkg recognize it as the source
# else, it would try to download the file from the release
tar -cvf imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst -C installDir .
tar -cvf imhex-${{env.IMHEX_VERSION}}-ArchLinux-x86_64.pkg.tar.zst -C installDir .
chmod -R 777 .
sudo -u nobody makepkg
# Replace the old file
rm imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst
mv *.pkg.tar.zst imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst
rm imhex-${{env.IMHEX_VERSION}}-ArchLinux-x86_64.pkg.tar.zst
mv *.pkg.tar.zst imhex-${{env.IMHEX_VERSION}}-ArchLinux-x86_64.pkg.tar.zst
- name: ⬆️ Upload imhex-archlinux.pkg.tar.zst
uses: actions/upload-artifact@v3
with:
name: ArchLinux .pkg.tar.zst
name: ArchLinux .pkg.tar.zst x86_64
path: |
build/imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst
build/imhex-${{env.IMHEX_VERSION}}-ArchLinux-x86_64.pkg.tar.zst
# RPM distro builds
rpm-build:
@ -563,6 +565,6 @@ jobs:
- name: ⬆️ Upload RPM
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }} ${{ matrix.release_num }} RPM
name: ${{ matrix.name }} ${{ matrix.release_num }} RPM x86_64
path: |
imhex-${{env.IMHEX_VERSION}}-${{matrix.name}}-${{matrix.release_num}}-x86_64.rpm

View File

@ -60,8 +60,8 @@ jobs:
- name: 🟩 Rename artifacts when needed
run: |
mv "Windows Portable.zip" imhex-${{env.IMHEX_VERSION}}-Windows-Portable.zip
mv "Windows Portable NoGPU.zip" imhex-${{env.IMHEX_VERSION}}-Windows-Portable-NoGPU.zip
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
- name: ⬆️ Upload everything to release
uses: softprops/action-gh-release@v1
@ -72,7 +72,7 @@ jobs:
run: |
cp ImHex/dist/Arch/PKGBUILD .
hash=`md5sum imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst | cut -d ' ' -f 1`
hash=`md5sum imhex-${{env.IMHEX_VERSION}}-ArchLinux.pkg.tar.zst-x86_64 | cut -d ' ' -f 1`
sed -i 's/%version%/${{env.IMHEX_VERSION}}/g' PKGBUILD
sed -i "s/(SKIP)/($hash)/g" PKGBUILD
@ -153,7 +153,7 @@ jobs:
run: |
$tagname = $env:GITHUB_REF.Replace("refs/tags/", "")
$version = $tagname.Replace("v", "")
$url = "https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-win64.msi"
$url = "https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-Windows-x86_64.msi"
.\wingetcreate.exe update WerWolv.ImHex -u $url --version $version
if ($version -notmatch "-") {
.\wingetcreate.exe submit .\manifests\w\WerWolv\ImHex\${version}\ --token $env:WINGET_GITHUB_TOKEN

View File

@ -24,10 +24,10 @@ ImHex is also available on various package managers. The officially supported on
### Windows
- **Cocolatey**
- **Chocolatey**
- [imhex](https://community.chocolatey.org/packages/imhex) (Thanks to @Jarcho)
- `choco install imhex`
- **winget**
- **Winget**
- [WerWolv.ImHex](https://github.com/microsoft/winget-pkgs/tree/master/manifests/w/WerWolv/ImHex)
- `winget install WerWolv.ImHex`

View File

@ -125,10 +125,12 @@ For format patterns, libraries, magic and constant files, check out the [ImHex-P
To use ImHex, the following minimal system requirements need to be met:
- **OS**: Windows 7 or higher, macOS 10.15 (Catalina) or higher, "Modern" Linux (Ubuntu 22.04, Fedora Stable/Rawhide, and Arch Linux have official packages, other distributions can use the AppImage)
- **OS**: Windows 7 or higher, macOS 10.15 (Catalina) or higher, "Modern" Linux (Ubuntu 22.04, Fedora 36/37, RHEL/AlmaLinux 9, and Arch Linux have official packages, other and older distributions can use the AppImage)
- **CPU**: x86_64 (64 Bit)
- **GPU**: OpenGL 3.0 or higher (preferable a dedicated GPU and not Intel HD Graphics)
- **RAM**: 512MB, more may be required for more complicated analysis
- **GPU**: OpenGL 3.0 or higher
- Intel HD drivers are really buggy and often cause graphic artifacts
- 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
## Installing

View File

@ -135,5 +135,5 @@ AppDir:
- usr/share/doc/*/TODO.*
AppImage:
arch: x86_64
update-information: gh-releases-zsync|WerWolv|ImHex|latest|imhex-*.AppImage.zsync
file_name: imhex-{{VERSION}}.AppImage
update-information: gh-releases-zsync|WerWolv|ImHex|latest|imhex-*-x86_64.AppImage.zsync
file_name: imhex-{{VERSION}}-x86_64.AppImage

2
dist/Arch/PKGBUILD vendored
View File

@ -12,7 +12,7 @@ depends=(glfw mbedtls freetype2 libglvnd dbus xdg-desktop-portal curl fmt yara n
makedepends=(git)
provides=(imhex)
conflicts=(imhex)
source=("$url/releases/download/v$pkgver/imhex-$pkgver-ArchLinux.pkg.tar.zst")
source=("$url/releases/download/v$pkgver/imhex-$pkgver-ArchLinux-x86_64.pkg.tar.zst")
md5sums=(SKIP)
package() {

@ -1 +1 @@
Subproject commit 2e294dbbc0a020f84d8e4088ea4df1b0244e29bd
Subproject commit 4b2a1d9ebe493bc61449b6e0781f5efd97bc328a

View File

@ -222,9 +222,24 @@ namespace hex::plugin::builtin {
}
bool IntelHexProvider::handleFilePicker() {
auto picked = fs::openFileBrowser(fs::DialogMode::Open, { { "Intel Hex File", "*" } }, [this](const std::fs::path &path) {
this->m_sourceFilePath = path;
});
auto picked = fs::openFileBrowser(fs::DialogMode::Open, {
{ "Intel Hex File", "hex" },
{ "Intel Hex File", "h86" },
{ "Intel Hex File", "hxl" },
{ "Intel Hex File", "hxh" },
{ "Intel Hex File", "obl" },
{ "Intel Hex File", "obh" },
{ "Intel Hex File", "mcs" },
{ "Intel Hex File", "ihex" },
{ "Intel Hex File", "ihe" },
{ "Intel Hex File", "ihx" },
{ "Intel Hex File", "a43" },
{ "Intel Hex File", "a90" }
}, [this](const std::fs::path &path) {
this->m_sourceFilePath = path;
}
);
if (!picked)
return false;
if (!fs::isRegularFile(this->m_sourceFilePath))

View File

@ -198,9 +198,25 @@ namespace hex::plugin::builtin {
}
bool MotorolaSRECProvider::handleFilePicker() {
auto picked = fs::openFileBrowser(fs::DialogMode::Open, { { "Motorola SREC File", "*" } }, [this](const std::fs::path &path) {
this->m_sourceFilePath = path;
});
auto picked = fs::openFileBrowser(fs::DialogMode::Open, {
{ "Motorola SREC File", "s19" },
{ "Motorola SREC File", "s28" },
{ "Motorola SREC File", "s37" },
{ "Motorola SREC File", "s" },
{ "Motorola SREC File", "s1" },
{ "Motorola SREC File", "s2" },
{ "Motorola SREC File", "s3" },
{ "Motorola SREC File", "sx" },
{ "Motorola SREC File", "srec" },
{ "Motorola SREC File", "exo" },
{ "Motorola SREC File", "mot" },
{ "Motorola SREC File", "mxt" }
},
[this](const std::fs::path &path) {
this->m_sourceFilePath = path;
}
);
if (!picked)
return false;
if (!fs::isRegularFile(this->m_sourceFilePath))

View File

@ -400,7 +400,7 @@ namespace hex::plugin::builtin {
ImGui::SameLine();
if (ImGui::IconButton(ICON_VS_FOLDER_OPENED, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
return fs::openFileBrowser(fs::DialogMode::Open, { {"TTF Font", "ttf"} },
return fs::openFileBrowser(fs::DialogMode::Open, { { "TTF Font", "ttf" }, { "OTF Font", "otf" } },
[&](const std::fs::path &path) {
fontPath = hex::toUTF8String(path);
setting = fontPath;

View File

@ -111,7 +111,9 @@ namespace hex::plugin::builtin::ui {
}
}
void drawVisualizer(const std::string &visualizer, pl::ptrn::Pattern &pattern, pl::ptrn::Iteratable &iteratable) {
void drawVisualizer(const std::vector<pl::core::Token::Literal> &arguments, pl::ptrn::Pattern &pattern, pl::ptrn::Iteratable &iteratable) {
auto visualizer = pl::core::Token::literalToString(arguments.front(), true);
if (visualizer == "line_plot") {
if (ImPlot::BeginPlot("##plot", ImVec2(400, 250), ImPlotFlags_NoChild | ImPlotFlags_CanvasOnly)) {
@ -134,6 +136,21 @@ namespace hex::plugin::builtin::ui {
if (texture.isValid())
ImGui::Image(texture, texture.getSize());
} else if (visualizer == "bitmap") {
if (arguments.size() == 3) {
auto width = pl::core::Token::literalToUnsigned(arguments[1]);
auto height = pl::core::Token::literalToUnsigned(arguments[2]);
std::vector<u8> data;
data.resize(width * height * 4);
pattern.getEvaluator()->readData(pattern.getOffset(), data.data(), data.size(), pattern.getSection());
static ImGui::Texture texture;
texture = ImGui::Texture(data.data(), data.size(), width, height);
if (texture.isValid())
ImGui::Image(texture, texture.getSize());
}
}
}
@ -616,11 +633,11 @@ namespace hex::plugin::builtin::ui {
ImGui::TableNextColumn();
makeSelectable(pattern);
drawCommentTooltip(pattern);
if (const auto &visualizer = pattern.getAttributeValue("hex::visualize"); visualizer.has_value()) {
if (const auto &arguments = pattern.getAttributeArguments("hex::visualize"); !arguments.empty()) {
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) {
ImGui::BeginTooltip();
drawVisualizer(visualizer.value(), pattern, iteratable);
drawVisualizer(arguments, pattern, iteratable);
ImGui::EndTooltip();
}