Compare commits

...

38 Commits

Author SHA1 Message Date
WerWolv
73fdc3c6ea build: Bumped version to 1.37.3 2025-02-25 14:54:08 +01:00
WerWolv
cae0f772d5 fix: ID collision when having duplicate fonts installed
Fixes #2141
2025-02-25 12:07:51 +01:00
WerWolv
51547dc941 fix: Crash on exit due to frame rate limiter thread not being shut down
Fixes #2140
2025-02-25 12:07:45 +01:00
WerWolv
1508efac7a build: Bumped version to 1.37.2 2025-02-24 20:39:33 +01:00
WerWolv
16dc239e0f fix: Crashes when switching disassembler architecture while disassembling 2025-02-24 20:03:49 +01:00
WerWolv
899f00ed2f fix: Way too low sleep target fps 2025-02-24 20:03:43 +01:00
WerWolv
9ebfffd346 fix: Debug assertion 2025-02-24 20:03:37 +01:00
WerWolv
76b2c09450 build: Remove wrong hexpluglib bundling from rpms 2025-02-24 20:03:31 +01:00
WerWolv
69246de145 impr: Don't wake up frame rate limiter thread more often than necessary 2025-02-24 20:03:19 +01:00
WerWolv
aee4b4fdf6 build: Disable fortify source in debug builds 2025-02-24 20:03:10 +01:00
WerWolv
a6a78cef00 build: Make sure plugin libraries don't end up in lib folder 2025-02-20 11:43:13 +01:00
WerWolv
30b25a39a7 fix: Crash when closing provider that's open in the diff view 2025-02-20 10:40:52 +01:00
Jonathan Wright
1f0b5e1ee1 build: Fix using system lunasvg (#2131)
Fix capitalization for cmake find_package and lunasvg.h path
2025-02-20 10:40:45 +01:00
WerWolv
d6658c3471 fix: Broken Plugin API link 2025-02-20 10:40:37 +01:00
WerWolv
398eecaa1d fix: Potential division by zero on Windows 7
#2130
2025-02-20 10:40:27 +01:00
WerWolv
b6616c1a0f patterns: Updated pattern language
Fixes #2126
2025-02-18 23:20:24 +01:00
WerWolv
5d3315f51c fix: Occasional crash when switching fonts 2025-02-18 23:20:03 +01:00
WerWolv
ec7298f0c0 impr: Make CLI not hang for a second after each command on Linux 2025-02-18 23:19:57 +01:00
WerWolv
92c2018f71 fix: Prevent stack overread when calling dbus-send 2025-02-18 23:19:48 +01:00
WerWolv
956952021d impr: Make title bar icon always draw at the correct size 2025-02-18 23:19:41 +01:00
WerWolv
f112123d39 build: Bumped version to 1.37.1 2025-02-18 10:47:51 +01:00
WerWolv
1a1ef9e7e0 fix: Pattern Editor losing focus during auto evaluation
Fixes #2122
2025-02-18 10:27:10 +01:00
WerWolv
39543fbda8 build: Updated dependencies 2025-02-18 10:26:54 +01:00
WerWolv
835863523b build: Get rid of unused Toolchain file warning 2025-02-17 13:19:41 +01:00
WerWolv
e6c8c69fda fix: Remove unused event unsubscribes in disassembler 2025-02-17 13:07:22 +01:00
WerWolv
e2d30eeba2 fix: Crash when setting invalid font 2025-02-17 13:07:15 +01:00
WerWolv
1da82d1403 impr: Added missing ellipsis on Edit options 2025-02-17 11:21:43 +01:00
WerWolv
73b9df24cf fix: Closing one view breaking all other views 2025-02-17 10:17:23 +01:00
WerWolv
f93e1194d6 fix: Crash when loading process memory provider from project 2025-02-17 10:17:13 +01:00
WerWolv
677cff244d fix: Make sure fps counter values are initialized to zero 2025-02-16 23:46:20 +01:00
WerWolv
8d88e328fa fix: Don't execute EventDPIChanged multiple times 2025-02-16 22:53:35 +01:00
WerWolv
acb5ef561d fix: Wrong native scaling on Wayland 2025-02-16 21:55:38 +01:00
WerWolv
444b5219e2 fix: Crash when custom disassembler returns no bytes 2025-02-16 21:11:19 +01:00
WerWolv
a4c7e0db90 patterns: Updated pattern language 2025-02-16 21:06:14 +01:00
WerWolv
f4e1824b7b fix: Pattern editor being shifted to the left on evaluate 2025-02-16 20:53:29 +01:00
WerWolv
fcb5e18102 fix: Pattern console log logic 2025-02-16 20:53:20 +01:00
WerWolv
70d4e21c4b fix: Don't parse version string on every call 2025-02-16 20:53:12 +01:00
WerWolv
2e2d5d31bc build: Updated libwolv 2025-02-16 20:52:57 +01:00
38 changed files with 255 additions and 173 deletions

1
.gitignore vendored
View File

@@ -7,6 +7,7 @@ build*/
local/
venv/
.cache/
install/
*.mgc
*.kdev4

View File

@@ -1 +1 @@
1.37.0
1.37.3

View File

@@ -381,6 +381,10 @@ endfunction()
macro(configureCMake)
message(STATUS "Configuring ImHex v${IMHEX_VERSION}")
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)
# Configure use of recommended build tools
@@ -662,12 +666,15 @@ macro(setupCompilerFlags target)
addCCXXFlag("-Wno-unknown-pragmas" ${target})
# Enable hardening flags
addCommonFlag("-U_FORTIFY_SOURCE" ${target})
addCommonFlag("-D_FORTIFY_SOURCE=3" ${target})
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})
if (NOT EMSCRIPTEN)
addCommonFlag("-fstack-protector-strong" ${target})
endif()
endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
@@ -796,8 +803,8 @@ 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_LLVM)
@@ -921,11 +928,17 @@ function(generateSDKDirectory)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/sdk/ DESTINATION "${SDK_PATH}")
install(TARGETS libimhex ARCHIVE DESTINATION "${SDK_PATH}/lib")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/ui DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
install(TARGETS ui 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 DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
install(TARGETS fonts ARCHIVE DESTINATION "${SDK_PATH}/lib")
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)

1
dist/rpm/imhex.spec vendored
View File

@@ -128,6 +128,5 @@ cp -a lib/third_party/xdgpp/LICENSE %{buildroot
%{_datadir}/mime/packages/%{name}.xml
%{_libdir}/libimhex.so*
%{_libdir}/%{name}/
%{_libdir}/*.hexpluglib
/usr/lib/debug/%{_libdir}/*.debug
%{_metainfodir}/net.werwolv.%{name}.metainfo.xml

View File

@@ -872,7 +872,8 @@ namespace hex {
SemanticVersion getImHexVersion() {
#if defined IMHEX_VERSION
return SemanticVersion(IMHEX_VERSION);
static auto version = SemanticVersion(IMHEX_VERSION);
return version;
#else
return {};
#endif

View File

@@ -327,6 +327,7 @@ namespace hex {
}
ImGui::SetNextWindowPos(position, ImGuiCond_Always, pivot);
ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID);
if (ImGui::Begin("##TutorialMessage", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing)) {
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindowRead());

View File

@@ -871,8 +871,10 @@ void TextEditor::SetFocus() {
SetSelection(mInteractiveStart, mInteractiveEnd, mSelectionMode);
ResetCursorBlinkTime();
EnsureCursorVisible();
ImGui::SetKeyboardFocusHere(-1);
mUpdateFocus = false;
if (!this->mReadOnly) {
ImGui::SetKeyboardFocusHere(-1);
mUpdateFocus = false;
}
}
void TextEditor::RenderText(const char *aTitle, const ImVec2 &lineNumbersStartPos, const ImVec2 &textEditorSize) {

View File

@@ -53,6 +53,9 @@ namespace hex {
void drawImGui();
void drawWithShader();
void unlockFrameRate();
void forceNewFrame();
GLFWwindow *m_window = nullptr;
std::string m_windowTitle, m_windowTitleFull;
@@ -64,17 +67,22 @@ namespace hex {
std::list<std::string> m_popupsToOpen;
std::set<int> m_pressedKeys;
std::atomic<bool> m_unlockFrameRate = true;
ImGuiExt::ImHexCustomData m_imguiCustomData;
u32 m_searchBarPosition = 0;
bool m_emergencyPopupOpen = false;
std::jthread m_frameRateThread;
std::chrono::duration<double, std::nano> m_remainingUnlockedTime;
std::mutex m_sleepMutex;
std::atomic<bool> m_sleepFlag;
std::condition_variable m_sleepCondVar;
std::mutex m_sleepMutex;
std::mutex m_wakeupMutex;
std::atomic<bool> m_wakeupFlag;
std::condition_variable m_wakeupCondVar;
gl::Shader m_postProcessingShader;
};

View File

@@ -492,7 +492,9 @@ namespace hex::init {
meanScale = 1.0F;
#endif
meanScale /= hex::ImHexApi::System::getBackingScaleFactor();
#if !defined(OS_LINUX)
meanScale /= hex::ImHexApi::System::getBackingScaleFactor();
#endif
ImHexApi::System::impl::setGlobalScale(meanScale);
ImHexApi::System::impl::setNativeScale(meanScale);

View File

@@ -42,12 +42,18 @@ namespace hex::messaging {
static auto listenerThread = std::jthread([](const std::stop_token &stopToken){
std::vector<u8> buffer(0xFFFF);
while (!stopToken.stop_requested()) {
while (true) {
int result = ::read(fifo, buffer.data(), buffer.size());
if (result > 0) {
EventNativeMessageReceived::post(std::vector<u8>{ buffer.begin(), buffer.begin() + result });
} else {
std::this_thread::sleep_for(std::chrono::seconds(1));
}
if (stopToken.stop_requested())
break;
if (result <= 0) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}
});

View File

@@ -161,7 +161,7 @@ namespace hex {
FILE *pipe = popen("dbus-send --session --print-reply --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme' 2>&1", "r");
if (pipe == nullptr) return;
while (fgets(buffer.data(), buffer.size(), pipe) != nullptr)
while (fgets(buffer.data(), buffer.size() - 1, pipe) != nullptr)
result += buffer.data();
auto exitCode = WEXITSTATUS(pclose(pipe));

View File

@@ -70,6 +70,9 @@ namespace hex {
const auto newScale = LOWORD(wParam) / 96.0F;
const auto oldScale = ImHexApi::System::getNativeScale();
if (u32(oldScale * 10) == u32(newScale * 10))
break;
EventDPIChanged::post(oldScale, newScale);
ImHexApi::System::impl::setNativeScale(newScale);
@@ -201,17 +204,20 @@ namespace hex {
i64 sleepTicks = 0;
i64 sleepMilliSeconds = 0;
if (delta >= 0) {
sleepTicks = delta / period;
} else {
sleepTicks = -1 + delta / period;
if (period > 0) {
if (delta >= 0) {
sleepTicks = delta / period;
} else {
sleepTicks = -1 + delta / period;
}
sleepMilliSeconds = delta - (period * sleepTicks);
const double sleepTime = std::round(1000.0 * double(sleepMilliSeconds) / double(performanceFrequency.QuadPart));
if (sleepTime >= 0.0) {
Sleep(DWORD(sleepTime));
}
}
sleepMilliSeconds = delta - (period * sleepTicks);
const double sleepTime = std::round(1000.0 * double(sleepMilliSeconds) / double(performanceFrequency.QuadPart));
if (sleepTime >= 0.0) {
Sleep(DWORD(sleepTime));
}
timeEndPeriod(granularity);
return WVR_REDRAW;
@@ -611,7 +617,7 @@ namespace hex {
glfwSetFramebufferSizeCallback(m_window, [](GLFWwindow* window, int width, int height) {
auto *win = static_cast<Window *>(glfwGetWindowUserPointer(window));
win->m_unlockFrameRate = true;
win->unlockFrameRate();
glViewport(0, 0, width, height);
ImHexApi::System::impl::setMainWindowSize(width, height);

View File

@@ -100,6 +100,9 @@ namespace hex {
}
Window::~Window() {
m_frameRateThread.request_stop();
m_frameRateThread.join();
EventProviderDeleted::unsubscribe(this);
RequestCloseImHex::unsubscribe(this);
RequestUpdateWindowTitle::unsubscribe(this);
@@ -311,7 +314,7 @@ namespace hex {
// Unlock frame rate if any mouse button is being held down to allow drag scrolling to be smooth
if (ImGui::IsAnyMouseDown())
m_unlockFrameRate = true;
this->unlockFrameRate();
// Unlock frame rate if any modifier key is held down since they don't generate key repeat events
if (
@@ -320,12 +323,12 @@ namespace hex {
ImGui::IsKeyPressed(ImGuiKey_LeftSuper) || ImGui::IsKeyPressed(ImGuiKey_RightSuper) ||
ImGui::IsKeyPressed(ImGuiKey_LeftAlt) || ImGui::IsKeyPressed(ImGuiKey_RightAlt)
) {
m_unlockFrameRate = true;
this->unlockFrameRate();
}
// Unlock frame rate if there's more than one viewport since these don't call the glfw callbacks registered here
if (ImGui::GetPlatformIO().Viewports.size() > 1)
m_unlockFrameRate = true;
this->unlockFrameRate();
}
// Hide the window as soon as the render loop exits to make the window
@@ -334,6 +337,9 @@ namespace hex {
}
void Window::frameBegin() {
// Run all deferred calls
TaskManager::runDeferredCalls();
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
@@ -343,7 +349,7 @@ namespace hex {
auto &currentFont = ImGui::GetIO().Fonts;
for (const auto &[name, font] : fontDefinitions) {
// If the texture for this atlas has been built already, don't do it again
if (font == nullptr || font->ContainerAtlas->TexID != 0)
if (font == nullptr || font->ContainerAtlas == nullptr || font->ContainerAtlas->TexID != 0)
continue;
currentFont = font->ContainerAtlas;
@@ -353,7 +359,7 @@ namespace hex {
}
{
const auto &font = ImHexApi::Fonts::getFont("hex.fonts.font.default");
auto font = ImHexApi::Fonts::getFont("hex.fonts.font.default");
if (font == nullptr) {
const auto &io = ImGui::GetIO();
@@ -362,13 +368,15 @@ namespace hex {
ImFontConfig cfg;
cfg.OversampleH = cfg.OversampleV = 1, cfg.PixelSnapH = true;
cfg.SizePixels = ImHexApi::Fonts::DefaultFontSize;
io.Fonts->AddFontDefault(&cfg);
font = io.Fonts->AddFontDefault(&cfg);
ImGui_ImplOpenGL3_CreateFontsTexture();
io.Fonts->ClearInputData();
io.Fonts->ClearTexData();
} else {
currentFont = font->ContainerAtlas;
}
ImGui::SetCurrentFont(font);
}
}
@@ -682,9 +690,6 @@ namespace hex {
return banner->shouldClose();
});
}
// Run all deferred calls
TaskManager::runDeferredCalls();
}
void Window::frame() {
@@ -927,6 +932,23 @@ namespace hex {
#endif
}
void Window::unlockFrameRate() {
{
std::scoped_lock lock(m_wakeupMutex);
m_remainingUnlockedTime = std::chrono::seconds(2);
}
this->forceNewFrame();
}
void Window::forceNewFrame() {
std::scoped_lock lock(m_wakeupMutex);
m_wakeupFlag = true;
m_wakeupCondVar.notify_all();
}
void Window::initGLFW() {
auto initialWindowProperties = ImHexApi::System::getInitialWindowProperties();
glfwSetErrorCallback([](int error, const char *desc) {
@@ -1027,7 +1049,7 @@ namespace hex {
if (win == nullptr)
return;
win->m_unlockFrameRate = true;
win->unlockFrameRate();
};
static const auto isMainWindow = [](GLFWwindow *window) {
@@ -1163,7 +1185,7 @@ namespace hex {
Duration passedTime = {};
std::chrono::steady_clock::time_point startTime = {}, endTime = {};
Duration requestedFrameTime = {}, remainingUnlockedTime = {};
Duration requestedFrameTime = {};
float targetFps = 0;
const auto nativeFps = []() -> float {
@@ -1182,32 +1204,36 @@ namespace hex {
targetFps = ImHexApi::System::getTargetFPS();
if (m_unlockFrameRate.exchange(false)) {
remainingUnlockedTime = std::chrono::seconds(2);
}
// If the target frame rate is below 15, use the current monitor's refresh rate
if (targetFps < 15) {
targetFps = nativeFps;
}
passedTime += iterationTime;
if (remainingUnlockedTime > std::chrono::nanoseconds(0)) {
remainingUnlockedTime -= iterationTime;
} else {
targetFps = 5;
}
requestedFrameTime = (Duration(1.0E9) / targetFps) / 1.3;
if (passedTime >= requestedFrameTime) {
{
std::scoped_lock lock(m_sleepMutex);
m_sleepFlag = true;
m_sleepCondVar.notify_all();
passedTime = {};
if (m_remainingUnlockedTime > std::chrono::nanoseconds(0)) {
m_remainingUnlockedTime -= iterationTime;
} else {
targetFps = 5;
}
requestedFrameTime = (Duration(1.0E9) / targetFps) / 1.3;
if (passedTime >= requestedFrameTime) {
m_sleepFlag = true;
m_sleepCondVar.notify_all();
passedTime = {};
}
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
{
std::unique_lock lock(m_wakeupMutex);
m_wakeupCondVar.wait_for(lock, requestedFrameTime, [&] {
return m_wakeupFlag || stopToken.stop_requested();
});
}
endTime = std::chrono::steady_clock::now();
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -781,8 +781,8 @@
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "Benutzerdefinierte Enkodierung laden...",
"hex.builtin.view.hex_editor.menu.file.save": "Speichern",
"hex.builtin.view.hex_editor.menu.file.save_as": "Speichern unter...",
"hex.builtin.view.hex_editor.menu.file.search": "Suchen",
"hex.builtin.view.hex_editor.menu.edit.select": "Auswählen",
"hex.builtin.view.hex_editor.menu.file.search": "Suchen...",
"hex.builtin.view.hex_editor.menu.edit.select": "Auswählen...",
"hex.builtin.view.hex_editor.name": "Hex Editor",
"hex.builtin.view.hex_editor.search.find": "Suchen",
"hex.builtin.view.hex_editor.search.hex": "Hex",
@@ -1000,7 +1000,7 @@
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
"hex.builtin.welcome.learn.pattern.title": "Pattern Language Dokumentation",
"hex.builtin.welcome.learn.plugins.desc": "Erweitere ImHex mit neuen Funktionen mit Plugins",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
"hex.builtin.welcome.quick_settings.simplified": "Simple Ansicht",
"hex.builtin.welcome.start.create_file": "Neue Datei erstellen",

View File

@@ -850,7 +850,7 @@
"hex.builtin.view.hex_editor.menu.file.save": "Save",
"hex.builtin.view.hex_editor.menu.file.save_as": "Save As...",
"hex.builtin.view.hex_editor.menu.file.search": "Search...",
"hex.builtin.view.hex_editor.menu.edit.select": "Select",
"hex.builtin.view.hex_editor.menu.edit.select": "Select...",
"hex.builtin.view.hex_editor.name": "Hex editor",
"hex.builtin.view.hex_editor.search.find": "Find",
"hex.builtin.view.hex_editor.search.hex": "Hex",
@@ -1143,7 +1143,7 @@
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
"hex.builtin.welcome.learn.imhex.title": "ImHex Documentation",
"hex.builtin.welcome.learn.plugins.desc": "Extend ImHex with additional features using plugins",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
"hex.builtin.popup.create_workspace.title": "Create new Workspace",
"hex.builtin.popup.create_workspace.desc": "Enter a name for the new Workspace",

View File

@@ -777,8 +777,8 @@
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "Cargar codificación personalizada...",
"hex.builtin.view.hex_editor.menu.file.save": "Guardar",
"hex.builtin.view.hex_editor.menu.file.save_as": "Guardar como...",
"hex.builtin.view.hex_editor.menu.file.search": "Buscar",
"hex.builtin.view.hex_editor.menu.edit.select": "Seleccionar",
"hex.builtin.view.hex_editor.menu.file.search": "Buscar...",
"hex.builtin.view.hex_editor.menu.edit.select": "Seleccionar...",
"hex.builtin.view.hex_editor.name": "Editor hexadecimal",
"hex.builtin.view.hex_editor.search.find": "Buscar",
"hex.builtin.view.hex_editor.search.hex": "Hexadecimal",
@@ -994,7 +994,7 @@
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
"hex.builtin.welcome.learn.pattern.title": "Documentación de Pattern Language",
"hex.builtin.welcome.learn.plugins.desc": "Extienda ImHex con características adicionales mediante plugins",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "API de Plugins",
"hex.builtin.welcome.quick_settings.simplified": "",
"hex.builtin.welcome.start.create_file": "Crear Nuevo Archivo",

View File

@@ -778,8 +778,8 @@
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "Saját kódolás betöltése...",
"hex.builtin.view.hex_editor.menu.file.save": "Mentés",
"hex.builtin.view.hex_editor.menu.file.save_as": "Mentés másként...",
"hex.builtin.view.hex_editor.menu.file.search": "Keresés",
"hex.builtin.view.hex_editor.menu.edit.select": "Kijelölés",
"hex.builtin.view.hex_editor.menu.file.search": "Keresés...",
"hex.builtin.view.hex_editor.menu.edit.select": "Kijelölés...",
"hex.builtin.view.hex_editor.name": "Hex szerkesztő",
"hex.builtin.view.hex_editor.search.find": "Kereső",
"hex.builtin.view.hex_editor.search.hex": "Hex",
@@ -1015,7 +1015,7 @@
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
"hex.builtin.welcome.learn.imhex.title": "ImHex dokumentáció",
"hex.builtin.welcome.learn.plugins.desc": "ImHex funkcióinak bővítése bővítményekkel",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "Bővítmény API",
"hex.builtin.popup.create_workspace.title": "Új munkaterület létrehozása",
"hex.builtin.popup.create_workspace.desc": "Adjon nevet az új munkaterületnek",

View File

@@ -995,7 +995,7 @@
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
"hex.builtin.welcome.learn.pattern.title": "Documentazione dei Pattern",
"hex.builtin.welcome.learn.plugins.desc": "Espandi l'utilizzo di ImHex con i Plugin",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
"hex.builtin.welcome.quick_settings.simplified": "",
"hex.builtin.welcome.start.create_file": "Crea un nuovo File",

View File

@@ -995,7 +995,7 @@
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
"hex.builtin.welcome.learn.pattern.title": "ImHexオリジナル言語について",
"hex.builtin.welcome.learn.plugins.desc": "ImHexの機能を拡張する",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "プラグインAPI",
"hex.builtin.welcome.quick_settings.simplified": "",
"hex.builtin.welcome.start.create_file": "新規ファイルを作成",

View File

@@ -777,8 +777,8 @@
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "사용자 정의 인코딩 불러오기...",
"hex.builtin.view.hex_editor.menu.file.save": "저장",
"hex.builtin.view.hex_editor.menu.file.save_as": "다른 이름으로 저장...",
"hex.builtin.view.hex_editor.menu.file.search": "검색",
"hex.builtin.view.hex_editor.menu.edit.select": "선택",
"hex.builtin.view.hex_editor.menu.file.search": "검색...",
"hex.builtin.view.hex_editor.menu.edit.select": "선택...",
"hex.builtin.view.hex_editor.name": "헥스 편집기",
"hex.builtin.view.hex_editor.search.find": "찾기",
"hex.builtin.view.hex_editor.search.hex": "헥스",
@@ -995,7 +995,7 @@
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
"hex.builtin.welcome.learn.pattern.title": "패턴 언어 문서",
"hex.builtin.welcome.learn.plugins.desc": "플러그인을 사용하여 추가 기능으로 ImHex를 확장하세요",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "플러그인 API",
"hex.builtin.welcome.quick_settings.simplified": "단순화",
"hex.builtin.welcome.start.create_file": "새 파일 만들기",

View File

@@ -995,7 +995,7 @@
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
"hex.builtin.welcome.learn.pattern.title": "Documentação da linguagem padrão",
"hex.builtin.welcome.learn.plugins.desc": "Estenda o ImHex com recursos adicionais usando plugins",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
"hex.builtin.welcome.quick_settings.simplified": "",
"hex.builtin.welcome.start.create_file": "Criar Novo Arquivo",

View File

@@ -1111,7 +1111,7 @@
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
"hex.builtin.welcome.learn.imhex.title": "Документация ImHex",
"hex.builtin.welcome.learn.plugins.desc": "Расширьте возможности ImHex с помощью плагинов",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "API плагинов",
"hex.builtin.popup.create_workspace.title": "Создать новое пространство",
"hex.builtin.popup.create_workspace.desc": "Введите имя нового пространства",

View File

@@ -849,7 +849,7 @@
"hex.builtin.view.hex_editor.menu.edit.paste_all": "粘贴全部",
"hex.builtin.view.hex_editor.menu.edit.remove": "删除……",
"hex.builtin.view.hex_editor.menu.edit.resize": "修改大小……",
"hex.builtin.view.hex_editor.menu.edit.select": "选择",
"hex.builtin.view.hex_editor.menu.edit.select": "选择……",
"hex.builtin.view.hex_editor.menu.edit.select_all": "全选",
"hex.builtin.view.hex_editor.menu.edit.set_base": "设置基地址",
"hex.builtin.view.hex_editor.menu.edit.set_page_size": "设置页面大小",
@@ -1058,7 +1058,7 @@
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
"hex.builtin.welcome.learn.pattern.title": "模式文档",
"hex.builtin.welcome.learn.plugins.desc": "通过插件扩展 ImHex 获得更多功能",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "插件 API",
"hex.builtin.welcome.nightly_build": "你正在运行ImHex的夜间构建。\n\n请在GitHub问题跟踪器上报告您遇到的任何错误",
"hex.builtin.welcome.quick_settings.simplified": "简化",

View File

@@ -777,8 +777,8 @@
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "載入自訂編碼...",
"hex.builtin.view.hex_editor.menu.file.save": "儲存",
"hex.builtin.view.hex_editor.menu.file.save_as": "另存為...",
"hex.builtin.view.hex_editor.menu.file.search": "搜尋",
"hex.builtin.view.hex_editor.menu.edit.select": "選取",
"hex.builtin.view.hex_editor.menu.file.search": "搜尋...",
"hex.builtin.view.hex_editor.menu.edit.select": "選取...",
"hex.builtin.view.hex_editor.name": "十六進位編輯器",
"hex.builtin.view.hex_editor.search.find": "尋找",
"hex.builtin.view.hex_editor.search.hex": "十六進位",
@@ -995,7 +995,7 @@
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
"hex.builtin.welcome.learn.pattern.title": "模式語言說明文件",
"hex.builtin.welcome.learn.plugins.desc": " 使用外掛程式來拓展 ImHex 的功能",
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
"hex.builtin.welcome.learn.plugins.title": "外掛程式 API",
"hex.builtin.welcome.quick_settings.simplified": "",
"hex.builtin.welcome.start.create_file": "建立新檔案",

View File

@@ -33,6 +33,9 @@
namespace hex::plugin::builtin {
bool ProcessMemoryProvider::open() {
if (m_selectedProcess == nullptr)
return false;
#if defined(OS_WINDOWS)
m_processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, m_selectedProcess->id);
if (m_processHandle == nullptr)

View File

@@ -52,9 +52,10 @@ namespace hex::plugin::builtin {
return false;
EventProviderClosing::subscribe(this, [this](const prv::Provider *provider, bool*) {
if (m_provider == provider)
if (m_provider == provider) {
ImHexApi::Provider::remove(this, false);
m_provider = nullptr;
m_provider = nullptr;
}
});
return true;

View File

@@ -248,7 +248,7 @@ namespace hex::plugin::builtin {
}, nullptr);
ImPlot::SetupAxisTicks(ImAxis_Y1, 0, largestFrameTime * 1.25F, 3);
static std::vector<double> values(100);
static std::vector<double> values(100, 0.0);
values.push_back(ImHexApi::System::getLastFrameTime());
if (values.size() > 100)

View File

@@ -1089,10 +1089,6 @@ namespace hex::plugin::builtin {
ImGui::PopFont();
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetStyle().FramePadding.y + 1_scaled);
if (m_patternEvaluating && m_runningEvaluators == 0) {
m_patternEvaluating = false;
m_textEditor.JumpToLine();
}
}
void ViewPatternEditor::drawEnvVars(ImVec2 size, std::list<EnvVar> &envVars) {
@@ -1953,7 +1949,8 @@ namespace hex::plugin::builtin {
runtime.setLogCallback([this, provider](auto level, auto message) {
std::scoped_lock lock(m_logMutex);
for (auto line : wolv::util::splitString(message, "\n")) {
auto lines = wolv::util::splitString(message, "\n");
for (auto &line : lines) {
if (!wolv::util::trim(line).empty()) {
switch (level) {
using enum pl::core::LogConsole::Level;

View File

@@ -412,7 +412,7 @@ namespace hex::plugin::builtin {
if (ImHexApi::System::isBorderlessWindowModeEnabled()) {
#if defined(OS_WINDOWS)
ImGui::SetCursorPosX(5_scaled);
ImGui::Image(*s_logoTexture, s_logoTexture->getSize() * u32(1_scaled));
ImGui::Image(*s_logoTexture, s_logoTexture->getSize() * 0.1_scaled);
ImGui::SetCursorPosX(5_scaled);
ImGui::InvisibleButton("##logo", ImVec2(menuBarHeight, menuBarHeight));
if (ImGui::IsItemHovered() && ImGui::IsAnyMouseDown())

View File

@@ -122,6 +122,7 @@ namespace hex::plugin::diffing {
column.provider = -1;
column.hexEditor.setSelectionUnchecked(std::nullopt, std::nullopt);
column.diffTree.clear();
column.differences.clear();
}
}
@@ -354,32 +355,34 @@ namespace hex::plugin::diffing {
// Draw changes
ImGui::TableNextColumn();
ImGui::Indent();
switch (typeA) {
case DifferenceType::Insertion:
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
providers[a.provider]->read(regionA.start, data.data(), data.size());
drawByteString(data);
break;
case DifferenceType::Mismatch:
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
providers[a.provider]->read(regionA.start, data.data(), data.size());
drawByteString(data);
if (a.provider != -1 && b.provider != -1) {
switch (typeA) {
case DifferenceType::Insertion:
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
providers[a.provider]->read(regionA.start, data.data(), data.size());
drawByteString(data);
break;
case DifferenceType::Mismatch:
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
providers[a.provider]->read(regionA.start, data.data(), data.size());
drawByteString(data);
ImGui::SameLine(0, 0);
ImGuiExt::TextFormatted(" {} ", ICON_VS_ARROW_RIGHT);
ImGui::SameLine(0, 0);
ImGui::SameLine(0, 0);
ImGuiExt::TextFormatted(" {} ", ICON_VS_ARROW_RIGHT);
ImGui::SameLine(0, 0);
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
providers[b.provider]->read(regionB.start, data.data(), data.size());
drawByteString(data);
break;
case DifferenceType::Deletion:
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
providers[b.provider]->read(regionB.start, data.data(), data.size());
drawByteString(data);
break;
default:
break;
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
providers[b.provider]->read(regionB.start, data.data(), data.size());
drawByteString(data);
break;
case DifferenceType::Deletion:
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
providers[b.provider]->read(regionB.start, data.data(), data.size());
drawByteString(data);
break;
default:
break;
}
}
ImGui::Unindent();

View File

@@ -46,7 +46,8 @@ namespace hex::plugin::disasm {
for (u8 byte : instruction.bytes)
disassembly.bytes += hex::format("{0:02X} ", byte);
disassembly.bytes.pop_back();
if (!disassembly.bytes.empty())
disassembly.bytes.pop_back();
return disassembly;
}

View File

@@ -34,8 +34,6 @@ namespace hex::plugin::disasm {
}
ViewDisassembler::~ViewDisassembler() {
EventDataChanged::unsubscribe(this);
EventRegionSelected::unsubscribe(this);
EventProviderDeleted::unsubscribe(this);
}
@@ -54,6 +52,10 @@ namespace hex::plugin::disasm {
// Create a capstone disassembler instance
if (currArchitecture->start()) {
ON_SCOPE_EXIT {
currArchitecture->end();
};
std::vector<u8> buffer(1_MiB, 0x00);
const u64 codeOffset = region.getStartAddress() - m_imageBaseAddress;
@@ -95,8 +97,6 @@ namespace hex::plugin::disasm {
if (hadError) break;
hadError = true;
}
currArchitecture->end();
}
});
}
@@ -138,59 +138,64 @@ namespace hex::plugin::disasm {
auto &region = m_regionToDisassemble.get(provider);
auto &range = m_range.get(provider);
// Draw region selection picker
ui::regionSelectionPicker(&region, provider, &range, true, true);
ImGuiExt::Header("hex.disassembler.view.disassembler.position"_lang);
// Draw base address input
ImGui::BeginDisabled(m_disassemblerTask.isRunning());
{
auto &address = m_imageLoadAddress.get(provider);
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_load_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
ImGui::SameLine();
ImGuiExt::HelpHover("hex.disassembler.view.disassembler.image_load_address.hint"_lang, ICON_VS_INFO);
}
// Draw region selection picker
ui::regionSelectionPicker(&region, provider, &range, true, true);
// Draw code region start address input
ImGui::BeginDisabled(m_range == ui::RegionType::EntireData);
{
auto &address = m_imageBaseAddress.get(provider);
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_base_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
ImGui::SameLine();
ImGuiExt::HelpHover("hex.disassembler.view.disassembler.image_base_address.hint"_lang, ICON_VS_INFO);
ImGuiExt::Header("hex.disassembler.view.disassembler.position"_lang);
// Draw base address input
{
auto &address = m_imageLoadAddress.get(provider);
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_load_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
ImGui::SameLine();
ImGuiExt::HelpHover("hex.disassembler.view.disassembler.image_load_address.hint"_lang, ICON_VS_INFO);
}
// Draw code region start address input
ImGui::BeginDisabled(m_range == ui::RegionType::EntireData);
{
auto &address = m_imageBaseAddress.get(provider);
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_base_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
ImGui::SameLine();
ImGuiExt::HelpHover("hex.disassembler.view.disassembler.image_base_address.hint"_lang, ICON_VS_INFO);
}
ImGui::EndDisabled();
// Draw settings
{
ImGuiExt::Header("hex.ui.common.settings"_lang);
// Draw architecture selector
const auto &architectures = ContentRegistry::Disassembler::impl::getArchitectures();
if (architectures.empty()) {
ImGuiExt::TextSpinner("hex.disassembler.view.disassembler.arch"_lang);
} else {
const auto &currArchitecture = m_currArchitecture.get(provider);
if (currArchitecture == nullptr) {
m_currArchitecture = architectures.begin()->second();
}
if (ImGui::BeginCombo("hex.disassembler.view.disassembler.arch"_lang, currArchitecture->getName().c_str())) {
for (const auto &[name, creator] : architectures) {
if (ImGui::Selectable(name.c_str(), name == currArchitecture->getName())) {
m_currArchitecture = creator();
}
}
ImGui::EndCombo();
}
// Draw sub-settings for each architecture
if (ImGuiExt::BeginBox()) {
currArchitecture->drawSettings();
}
ImGuiExt::EndBox();
}
}
}
ImGui::EndDisabled();
// Draw settings
{
ImGuiExt::Header("hex.ui.common.settings"_lang);
// Draw architecture selector
const auto &architectures = ContentRegistry::Disassembler::impl::getArchitectures();
if (architectures.empty()) {
ImGuiExt::TextSpinner("hex.disassembler.view.disassembler.arch"_lang);
} else {
const auto &currArchitecture = m_currArchitecture.get(provider);
if (currArchitecture == nullptr) {
m_currArchitecture = architectures.begin()->second();
}
if (ImGui::BeginCombo("hex.disassembler.view.disassembler.arch"_lang, currArchitecture->getName().c_str())) {
for (const auto &[name, creator] : architectures) {
if (ImGui::Selectable(name.c_str(), name == currArchitecture->getName())) {
m_currArchitecture = creator();
}
}
ImGui::EndCombo();
}
// Draw sub-settings for each architecture
if (ImGuiExt::BeginBox()) {
currArchitecture->drawSettings();
}
ImGuiExt::EndBox();
}
}
// Draw disassemble button
ImGui::BeginDisabled(m_disassemblerTask.isRunning() || region.getStartAddress() < m_imageBaseAddress);

View File

@@ -37,13 +37,18 @@ namespace hex::fonts {
});
}
u32 index = 0;
for (const auto &[path, fontName] : hex::getFonts()) {
ImGui::PushID(index);
if (ImGui::Selectable(limitStringLength(fontName, 50).c_str(), m_path == path)) {
m_path = path;
m_pixelPerfectFont = false;
changed = true;
}
ImGui::SetItemTooltip("%s", fontName.c_str());
ImGui::PopID();
index += 1;
}
ImGui::EndCombo();

View File

@@ -65,7 +65,9 @@ namespace hex::fonts {
return;
}
loadFont(widget, name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());
TaskManager::doLater([&name, &font, &widget] {
loadFont(widget, name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());
});
});
loadFont(widget.getWidget(), name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());