mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee2838bada | ||
|
|
4d17265e90 | ||
|
|
6a6b860622 | ||
|
|
e78c452daf |
7
.github/workflows/analysis.yml
vendored
7
.github/workflows/analysis.yml
vendored
@@ -25,13 +25,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
languages: 'cpp'
|
languages: 'cpp'
|
||||||
|
|
||||||
- name: 📜 Restore ccache
|
- name: 📜 Setup ccache
|
||||||
uses: actions/cache@v3
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cache/ccache
|
|
||||||
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
||||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
||||||
|
max-size: 50M
|
||||||
|
|
||||||
- name: 📜 Restore CMakeCache
|
- name: 📜 Restore CMakeCache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
|||||||
70
.github/workflows/build.yml
vendored
70
.github/workflows/build.yml
vendored
@@ -28,21 +28,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: 📜 Prepare Cache
|
- name: 📜 Setup ccache
|
||||||
id: prep-ccache
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p "${CCACHE_DIR}"
|
|
||||||
echo "::set-output name=dir::$CCACHE_DIR"
|
|
||||||
|
|
||||||
- name: 📜 Restore ccache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
id: cache-ccache
|
id: cache-ccache
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
${{ steps.prep-ccache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
||||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
||||||
|
max-size: 50M
|
||||||
|
|
||||||
- name: 📜 Restore CMakeCache
|
- name: 📜 Restore CMakeCache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@@ -64,37 +56,23 @@ jobs:
|
|||||||
glfw:p
|
glfw:p
|
||||||
file:p
|
file:p
|
||||||
mbedtls:p
|
mbedtls:p
|
||||||
python:p
|
|
||||||
freetype:p
|
freetype:p
|
||||||
dlfcn:p
|
dlfcn:p
|
||||||
|
|
||||||
- name: ⬇️ Install dependencies
|
|
||||||
run: |
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://win.rustup.rs > rustup-init.exe
|
|
||||||
./rustup-init.exe -y --default-host=x86_64-pc-windows-gnu --default-toolchain=none
|
|
||||||
rm rustup-init.exe
|
|
||||||
$USERPROFILE/.cargo/bin/rustup.exe target add x86_64-pc-windows-gnu
|
|
||||||
$USERPROFILE/.cargo/bin/rustup.exe default nightly
|
|
||||||
|
|
||||||
# Windows cmake build
|
# Windows cmake build
|
||||||
- name: 🛠️ Build
|
- name: 🛠️ Build
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
# Get path to mingw python library
|
|
||||||
PYTHON_LIB_NAME=$(pkg-config --libs-only-l python3 | sed 's/^-l//' | sed 's/ //')
|
|
||||||
PYTHON_LIB_PATH=$(cygpath -m $(which lib${PYTHON_LIB_NAME}.dll))
|
|
||||||
|
|
||||||
cmake -G "MinGW Makefiles" \
|
cmake -G "MinGW Makefiles" \
|
||||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||||
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
||||||
-DCREATE_PACKAGE=ON \
|
-DCREATE_PACKAGE=ON \
|
||||||
-DPython_LIBRARY="$PYTHON_LIB_PATH" \
|
|
||||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
||||||
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
||||||
-DRUST_PATH="$USERPROFILE/.cargo/bin/" \
|
|
||||||
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
||||||
..
|
..
|
||||||
mingw32-make -j4 install
|
mingw32-make -j4 install
|
||||||
@@ -166,13 +144,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "IMHEX_VERSION=`cat VERSION`" >> $GITHUB_ENV
|
echo "IMHEX_VERSION=`cat VERSION`" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: 📜 Restore ccache
|
- name: 📜 Setup ccache
|
||||||
uses: actions/cache@v3
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/Library/Caches/ccache
|
|
||||||
key: ${{ runner.os }}-${{ matrix.suffix }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
key: ${{ runner.os }}-${{ matrix.suffix }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
||||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
restore-keys: ${{ runner.os }}-${{ matrix.suffix }}-${{ secrets.CACHE_VERSION }}-build
|
||||||
|
max-size: 50M
|
||||||
|
|
||||||
|
|
||||||
- name: 📜 Restore CMakeCache
|
- name: 📜 Restore CMakeCache
|
||||||
@@ -260,13 +237,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: 📜 Restore ccache
|
- name: 📜 Setup ccache
|
||||||
uses: actions/cache@v3
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cache/ccache
|
|
||||||
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
||||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
||||||
|
max-size: 50M
|
||||||
|
|
||||||
- name: 📜 Restore other caches
|
- name: 📜 Restore other caches
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@@ -290,14 +266,7 @@ jobs:
|
|||||||
sudo apt install -y python3-pip python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse
|
sudo apt install -y python3-pip python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse
|
||||||
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
|
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
|
||||||
sudo chmod +x /usr/local/bin/appimagetool
|
sudo chmod +x /usr/local/bin/appimagetool
|
||||||
sudo pip3 install appimage-builder==1.0.0
|
sudo pip3 install appimage-builder
|
||||||
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
|
|
||||||
sh rustup-init.sh -y --default-toolchain none
|
|
||||||
rm rustup-init.sh
|
|
||||||
$HOME/.cargo/bin/rustup install nightly
|
|
||||||
$HOME/.cargo/bin/rustup target add x86_64-unknown-linux-gnu
|
|
||||||
$HOME/.cargo/bin/rustup default nightly
|
|
||||||
|
|
||||||
# Ubuntu cmake build
|
# Ubuntu cmake build
|
||||||
- name: 🛠️ Build
|
- name: 🛠️ Build
|
||||||
@@ -311,7 +280,6 @@ jobs:
|
|||||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
||||||
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
||||||
-DRUST_PATH="$HOME/.cargo/bin/" \
|
|
||||||
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
||||||
..
|
..
|
||||||
make -j 4 install DESTDIR=DebDir
|
make -j 4 install DESTDIR=DebDir
|
||||||
@@ -347,7 +315,6 @@ jobs:
|
|||||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
||||||
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
||||||
-DRUST_PATH="$HOME/.cargo/bin/" \
|
|
||||||
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
||||||
-DIMHEX_PLUGINS_IN_SHARE=ON \
|
-DIMHEX_PLUGINS_IN_SHARE=ON \
|
||||||
-DIMHEX_USE_BUNDLED_CA=ON \
|
-DIMHEX_USE_BUNDLED_CA=ON \
|
||||||
@@ -412,13 +379,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
dist/get_deps_archlinux.sh --noconfirm
|
dist/get_deps_archlinux.sh --noconfirm
|
||||||
|
|
||||||
- name: 📜 Restore ccache
|
- name: 📜 Setup ccache
|
||||||
uses: actions/cache@v3
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cache/ccache
|
|
||||||
key: archlinux-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
key: archlinux-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
||||||
restore-keys: archlinux-${{ secrets.CACHE_VERSION }}-build
|
restore-keys: archlinux-${{ secrets.CACHE_VERSION }}-build
|
||||||
|
max-size: 50M
|
||||||
|
|
||||||
- name: 📜 Restore CMakeCache
|
- name: 📜 Restore CMakeCache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@@ -514,7 +480,6 @@ jobs:
|
|||||||
libcurl-devel \
|
libcurl-devel \
|
||||||
llvm-devel \
|
llvm-devel \
|
||||||
mbedtls-devel \
|
mbedtls-devel \
|
||||||
python3-devel \
|
|
||||||
rpm-build \
|
rpm-build \
|
||||||
yara-devel
|
yara-devel
|
||||||
|
|
||||||
@@ -527,13 +492,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
dist/get_deps_fedora.sh
|
dist/get_deps_fedora.sh
|
||||||
|
|
||||||
- name: 📜 Restore ccache
|
- name: 📜 Setup ccache
|
||||||
uses: actions/cache@v3
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cache/ccache
|
|
||||||
key: fedora-${{ matrix.release }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
key: fedora-${{ matrix.release }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
||||||
restore-keys: fedora-${{ matrix.release }}-${{ secrets.CACHE_VERSION }}-build
|
restore-keys: fedora-${{ matrix.release }}-${{ secrets.CACHE_VERSION }}-build
|
||||||
|
max-size: 50M
|
||||||
|
|
||||||
- name: 📜 Set version variable
|
- name: 📜 Set version variable
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
7
.github/workflows/tests.yml
vendored
7
.github/workflows/tests.yml
vendored
@@ -22,13 +22,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: 📜 Restore ccache
|
- name: 📜 Setup ccache
|
||||||
uses: actions/cache@v3
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cache/ccache
|
|
||||||
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
||||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
|
||||||
|
max-size: 50M
|
||||||
|
|
||||||
|
|
||||||
- name: 📜 Restore CMakeCache
|
- name: 📜 Restore CMakeCache
|
||||||
|
|||||||
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
Submodule lib/external/pattern_language updated: 3d192fb629...acf127c4a3
@@ -523,9 +523,6 @@ namespace hex::plugin::builtin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::optional<color_t> ViewHexEditor::applySelectionColor(u64 byteAddress, std::optional<color_t> color) {
|
std::optional<color_t> ViewHexEditor::applySelectionColor(u64 byteAddress, std::optional<color_t> color) {
|
||||||
if (!color.has_value())
|
|
||||||
return std::nullopt;
|
|
||||||
|
|
||||||
if (this->isSelectionValid()) {
|
if (this->isSelectionValid()) {
|
||||||
auto selection = this->getSelection();
|
auto selection = this->getSelection();
|
||||||
|
|
||||||
@@ -873,12 +870,14 @@ namespace hex::plugin::builtin {
|
|||||||
if (y == u64(clipper.DisplayStart))
|
if (y == u64(clipper.DisplayStart))
|
||||||
cellSize.y -= (ImGui::GetStyle().CellPadding.y + 1);
|
cellSize.y -= (ImGui::GetStyle().CellPadding.y + 1);
|
||||||
|
|
||||||
|
backgroundColor = applySelectionColor(byteAddress, backgroundColor);
|
||||||
|
|
||||||
// Draw highlights and selection
|
// Draw highlights and selection
|
||||||
if (backgroundColor.has_value()) {
|
if (backgroundColor.has_value()) {
|
||||||
auto drawList = ImGui::GetWindowDrawList();
|
auto drawList = ImGui::GetWindowDrawList();
|
||||||
|
|
||||||
// Draw background color
|
// Draw background color
|
||||||
drawList->AddRectFilled(cellStartPos, cellStartPos + cellSize, applySelectionColor(byteAddress, backgroundColor).value());
|
drawList->AddRectFilled(cellStartPos, cellStartPos + cellSize, backgroundColor.value());
|
||||||
|
|
||||||
// Draw frame around mouse selection
|
// Draw frame around mouse selection
|
||||||
this->drawSelectionFrame(x, y, byteAddress, bytesPerCell, cellStartPos, cellSize);
|
this->drawSelectionFrame(x, y, byteAddress, bytesPerCell, cellStartPos, cellSize);
|
||||||
@@ -935,12 +934,14 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
auto [foregroundColor, backgroundColor] = cellColors[x / bytesPerCell];
|
auto [foregroundColor, backgroundColor] = cellColors[x / bytesPerCell];
|
||||||
|
|
||||||
|
backgroundColor = applySelectionColor(byteAddress, backgroundColor);
|
||||||
|
|
||||||
// Draw highlights and selection
|
// Draw highlights and selection
|
||||||
if (backgroundColor.has_value()) {
|
if (backgroundColor.has_value()) {
|
||||||
auto drawList = ImGui::GetWindowDrawList();
|
auto drawList = ImGui::GetWindowDrawList();
|
||||||
|
|
||||||
// Draw background color
|
// Draw background color
|
||||||
drawList->AddRectFilled(cellStartPos, cellStartPos + cellSize, applySelectionColor(byteAddress, backgroundColor).value());
|
drawList->AddRectFilled(cellStartPos, cellStartPos + cellSize, backgroundColor.value());
|
||||||
|
|
||||||
this->drawSelectionFrame(x, y, byteAddress, 1, cellStartPos, cellSize);
|
this->drawSelectionFrame(x, y, byteAddress, 1, cellStartPos, cellSize);
|
||||||
}
|
}
|
||||||
@@ -993,12 +994,14 @@ namespace hex::plugin::builtin {
|
|||||||
if (x < validBytes && isCurrRegionValid(address)) {
|
if (x < validBytes && isCurrRegionValid(address)) {
|
||||||
auto [foregroundColor, backgroundColor] = cellColors[x / bytesPerCell];
|
auto [foregroundColor, backgroundColor] = cellColors[x / bytesPerCell];
|
||||||
|
|
||||||
|
backgroundColor = applySelectionColor(address, backgroundColor);
|
||||||
|
|
||||||
// Draw highlights and selection
|
// Draw highlights and selection
|
||||||
if (backgroundColor.has_value()) {
|
if (backgroundColor.has_value()) {
|
||||||
auto drawList = ImGui::GetWindowDrawList();
|
auto drawList = ImGui::GetWindowDrawList();
|
||||||
|
|
||||||
// Draw background color
|
// Draw background color
|
||||||
drawList->AddRectFilled(cellStartPos, cellStartPos + cellSize, applySelectionColor(address, backgroundColor).value());
|
drawList->AddRectFilled(cellStartPos, cellStartPos + cellSize, backgroundColor.value());
|
||||||
|
|
||||||
this->drawSelectionFrame(x, y, address, 1, cellStartPos, cellSize);
|
this->drawSelectionFrame(x, y, address, 1, cellStartPos, cellSize);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user