Various small fixes

This commit is contained in:
WerWolv 2020-11-27 09:09:59 +01:00
parent ed572ececf
commit fde9dc7961
4 changed files with 7 additions and 9 deletions

View File

@ -4,6 +4,7 @@ project(HexEditor)
set(CMAKE_CXX_STANDARD 20)
find_package(PkgConfig REQUIRED)
pkg_search_module(CRYPTO REQUIRED crypto)
pkg_search_module(GLFW REQUIRED glfw3)
pkg_search_module(GLM REQUIRED glm)
pkg_search_module(CRYPTO REQUIRED libcrypto)
@ -14,7 +15,6 @@ find_package(LLVM REQUIRED CONFIG)
llvm_map_components_to_libnames(demangler)
include_directories(include ${GLFW_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} libs/ImGui/include libs/glad/include)
add_definitions(${LLVM_DEFINITIONS})
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -DIMGUI_IMPL_OPENGL_LOADER_GLAD")
@ -65,12 +65,10 @@ add_executable(ImHex
resource.rc
)
llvm_map_components_to_libnames(LLVM_LIBRARIES Demangle)
if (WIN32)
target_link_libraries(ImHex libglfw3.a libgcc.a libstdc++.a libmagic.a libgnurx.a libtre.a libintl.a libiconv.a shlwapi.lib libcrypto.a libwinpthread.a libcapstone.a ${LLVM_LIBRARIES})
target_link_libraries(ImHex libglfw3.a libgcc.a libstdc++.a libmagic.a libgnurx.a libtre.a libintl.a libiconv.a shlwapi.lib libcrypto.a libwinpthread.a libcapstone.a libLLVMDemangle.a)
endif (WIN32)
if (UNIX)
target_link_libraries(ImHex libglfw.so libmagic.so libcrypto.so libdl.so libcapstone.so ${LLVM_LIBRARIES})
target_link_libraries(ImHex libglfw.so libmagic.so libcrypto.so libdl.so libcapstone.so libLLVMDemangle.so)
endif (UNIX)

View File

@ -251,7 +251,7 @@ namespace hex::lang {
delete nonArrayVarDeclNode;
}
return { new PatternDataArray(offset, arrayOffset, varDeclNode->getVariableName(), entries, 0x00FFFFFF), arrayOffset };
return { new PatternDataArray(offset, arrayOffset, varDeclNode->getVariableName(), entries, arrayColor.value()), arrayOffset };
}
std::pair<PatternData*, size_t> Evaluator::createStringPattern(ASTNodeVariableDecl *varDeclNode, u64 offset) {

View File

@ -59,7 +59,7 @@ namespace hex {
switch (this->m_currHashFunction) {
case 0: // CRC16
{
int polynomial = 0, init = 0;
static int polynomial = 0, init = 0;
ImGui::InputInt("Initial Value", &init, 0, 0, ImGuiInputTextFlags_CharsHexadecimal);
if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true;
@ -83,7 +83,7 @@ namespace hex {
break;
case 1: // CRC32
{
int polynomial = 0, init = 0;
static int polynomial = 0, init = 0;
ImGui::InputInt("Initial Value", &init, 0, 0, ImGuiInputTextFlags_CharsHexadecimal);
if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true;

View File

@ -13,7 +13,6 @@ namespace hex {
this->m_mangledBuffer = new char[0xF'FFFF];
std::memset(this->m_mangledBuffer, 0x00, 0xF'FFFF);
this->m_demangledName = "< ??? >";
this->m_regexInput = new char[0xF'FFFF];
this->m_regexPattern = new char[0xF'FFFF];
@ -28,6 +27,7 @@ namespace hex {
delete[] this->m_regexInput;
delete[] this->m_regexPattern;
delete[] this->m_replacePattern;
}
void ViewTools::drawDemangler() {