├── README.md ├── release_version.txt ├── res ├── main.icns ├── main.ico ├── main.png ├── icons │ ├── main.ico │ ├── main.png │ └── main.icns ├── resource.rc ├── Info.plist.in ├── resource.rc.in ├── resource_icon.rc.in └── windows.manifest.xml ├── .github ├── FUNDING.yml └── workflows │ ├── cmake-multi-platform.yml │ └── builder.yml ├── CMakeLists.txt ├── src ├── gui │ ├── images │ │ └── about.png │ ├── icons │ │ ├── Add.16.16.png │ │ ├── All.16.16.png │ │ ├── Code.16.16.png │ │ ├── Copy.16.16.png │ │ ├── DIE.16.16.png │ │ ├── Data.16.16.png │ │ ├── Edit.16.16.png │ │ ├── Exit.16.16.png │ │ ├── File.16.16.png │ │ ├── Goto.16.16.png │ │ ├── Hash.16.16.png │ │ ├── Info.16.16.png │ │ ├── List.16.16.png │ │ ├── Mime.16.16.png │ │ ├── NFD.16.16.png │ │ ├── Next.16.16.png │ │ ├── Note.16.16.png │ │ ├── Open.16.16.png │ │ ├── Path.16.16.png │ │ ├── Save.16.16.png │ │ ├── Size.16.16.png │ │ ├── TLS.16.16.png │ │ ├── Tool.16.16.png │ │ ├── Yara.16.16.png │ │ ├── Action.16.16.png │ │ ├── Address.16.16.png │ │ ├── Binary.16.16.png │ │ ├── Debug.16.16.png │ │ ├── Disasm.16.16.png │ │ ├── DotNet.16.16.png │ │ ├── Entropy.16.16.png │ │ ├── Entry.16.16.png │ │ ├── Export.16.16.png │ │ ├── Extract.16.16.png │ │ ├── Follow.16.16.png │ │ ├── Forward.16.16.png │ │ ├── Header.16.16.png │ │ ├── Image.16.16.png │ │ ├── Import.16.16.png │ │ ├── Library.16.16.png │ │ ├── Offset.16.16.png │ │ ├── Option.16.16.png │ │ ├── Overlay.16.16.png │ │ ├── Patch.16.16.png │ │ ├── Refresh.16.16.png │ │ ├── Reloc.16.16.png │ │ ├── Remove.16.16.png │ │ ├── Resize.16.16.png │ │ ├── Script.16.16.png │ │ ├── Search.16.16.png │ │ ├── Section.16.16.png │ │ ├── Segment.16.16.png │ │ ├── Select.16.16.png │ │ ├── String.16.16.png │ │ ├── Structs.16.16.png │ │ ├── Symbol.16.16.png │ │ ├── Table.16.16.png │ │ ├── Value.16.16.png │ │ ├── Version.16.16.png │ │ ├── Backward.16.16.png │ │ ├── Bookmark.16.16.png │ │ ├── Convertor.16.16.png │ │ ├── Demangle.16.16.png │ │ ├── Download.16.16.png │ │ ├── Exception.16.16.png │ │ ├── Function.16.16.png │ │ ├── Inspector.16.16.png │ │ ├── Manifest.16.16.png │ │ ├── MemoryMap.16.16.png │ │ ├── Metadata.16.16.png │ │ ├── Reference.16.16.png │ │ ├── Resource.16.16.png │ │ ├── Shortcut.16.16.png │ │ ├── Signature.16.16.png │ │ ├── Certificate.16.16.png │ │ ├── Virustotal.16.16.png │ │ ├── BreakpointEnabled.16.16.png │ │ └── BreakpointDisabled.16.16.png │ ├── dialogoptions.ui │ ├── guimainwindow.ui │ ├── dialogabout.h │ ├── dialogoptions.h │ ├── dialogabout.ui │ ├── dialogoptions.cpp │ ├── main_gui.cpp │ ├── guimainwindow.h │ ├── rsrc.qrc │ ├── dialogabout.cpp │ ├── CMakeLists.txt │ └── guimainwindow.cpp ├── CMakeLists.txt └── global.h ├── LICENSE └── .gitmodules /README.md: -------------------------------------------------------------------------------- 1 | # XHexViewer 2 | -------------------------------------------------------------------------------- /release_version.txt: -------------------------------------------------------------------------------- 1 | 0.1.0 -------------------------------------------------------------------------------- /res/main.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/res/main.icns -------------------------------------------------------------------------------- /res/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/res/main.ico -------------------------------------------------------------------------------- /res/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/res/main.png -------------------------------------------------------------------------------- /res/icons/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/res/icons/main.ico -------------------------------------------------------------------------------- /res/icons/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/res/icons/main.png -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: horsicq 4 | -------------------------------------------------------------------------------- /res/icons/main.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/res/icons/main.icns -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(XHexViewer) 3 | add_subdirectory(src) 4 | -------------------------------------------------------------------------------- /src/gui/images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/images/about.png -------------------------------------------------------------------------------- /src/gui/icons/Add.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Add.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/All.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/All.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Code.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Code.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Copy.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Copy.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/DIE.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/DIE.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Data.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Data.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Edit.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Edit.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Exit.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Exit.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/File.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/File.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Goto.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Goto.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Hash.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Hash.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Info.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Info.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/List.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/List.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Mime.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Mime.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/NFD.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/NFD.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Next.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Next.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Note.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Note.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Open.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Open.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Path.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Path.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Save.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Save.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Size.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Size.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/TLS.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/TLS.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Tool.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Tool.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Yara.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Yara.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Action.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Action.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Address.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Address.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Binary.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Binary.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Debug.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Debug.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Disasm.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Disasm.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/DotNet.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/DotNet.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Entropy.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Entropy.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Entry.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Entry.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Export.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Export.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Extract.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Extract.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Follow.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Follow.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Forward.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Forward.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Header.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Header.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Image.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Image.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Import.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Import.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Library.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Library.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Offset.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Offset.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Option.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Option.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Overlay.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Overlay.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Patch.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Patch.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Refresh.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Refresh.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Reloc.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Reloc.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Remove.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Remove.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Resize.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Resize.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Script.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Script.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Search.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Search.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Section.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Section.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Segment.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Segment.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Select.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Select.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/String.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/String.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Structs.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Structs.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Symbol.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Symbol.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Table.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Table.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Value.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Value.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Version.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Version.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Backward.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Backward.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Bookmark.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Bookmark.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Convertor.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Convertor.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Demangle.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Demangle.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Download.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Download.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Exception.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Exception.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Function.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Function.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Inspector.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Inspector.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Manifest.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Manifest.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/MemoryMap.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/MemoryMap.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Metadata.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Metadata.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Reference.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Reference.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Resource.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Resource.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Shortcut.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Shortcut.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Signature.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Signature.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Certificate.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Certificate.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Virustotal.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/Virustotal.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/BreakpointEnabled.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/BreakpointEnabled.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/BreakpointDisabled.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XHexViewer/master/src/gui/icons/BreakpointDisabled.16.16.png -------------------------------------------------------------------------------- /res/resource.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | IDI_ICON1 ICON DISCARDABLE "main.ico" 4 | 5 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "windows.manifest.xml" 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 0,1,0,0 8 | PRODUCTVERSION 0,1,0,0 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_DLL 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "040904b0" 22 | BEGIN 23 | VALUE "CompanyName", "ntinfo\0" 24 | VALUE "FileDescription", "XHexViewer is a HEX viewer\0" 25 | VALUE "FileVersion", "0.1.0.0\0" 26 | VALUE "LegalCopyright", "horsicq@gmail.com\0" 27 | VALUE "OriginalFilename", "xhexviewer.exe\0" 28 | VALUE "ProductName", "XHexViewer\0" 29 | VALUE "ProductVersion", "0.1.0.0\0" 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0409, 1200 35 | END 36 | END 37 | /* End of Version info */ 38 | 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2025 hors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /res/Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | @X_PROJECTNAME@ 9 | CFBundleIconFile 10 | main.icns 11 | CFBundleIdentifier 12 | @MACOSX_BUNDLE_GUI_IDENTIFIER@ 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleLongVersionString 16 | @X_PROJECT_VERSION@ 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@. 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@ 25 | CSResourcesFileMapped 26 | 27 | NSHumanReadableCopyright 28 | @X_COMPANYNAME@ 29 | 30 | 31 | -------------------------------------------------------------------------------- /res/resource.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "windows.manifest.xml" 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 6 | PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 7 | FILEFLAGSMASK 0x3fL 8 | #ifdef _DEBUG 9 | FILEFLAGS VS_FF_DEBUG 10 | #else 11 | FILEFLAGS 0x0L 12 | #endif 13 | FILEOS VOS__WINDOWS32 14 | FILETYPE VFT_DLL 15 | FILESUBTYPE 0x0L 16 | BEGIN 17 | BLOCK "StringFileInfo" 18 | BEGIN 19 | BLOCK "040904b0" 20 | BEGIN 21 | VALUE "CompanyName", "@X_COMPANYNAME@\0" 22 | VALUE "FileDescription", "@X_DESCRIPTION@\0" 23 | VALUE "FileVersion", "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0\0" 24 | VALUE "LegalCopyright", "@X_MAINTAINER@\0" 25 | VALUE "OriginalFilename", "@X_ORIGINAL_FILENAME@.exe\0" 26 | VALUE "ProductName", "@X_PROJECTNAME@\0" 27 | VALUE "ProductVersion", "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0\0" 28 | END 29 | END 30 | BLOCK "VarFileInfo" 31 | BEGIN 32 | VALUE "Translation", 0x0409, 1200 33 | END 34 | END 35 | /* End of Version info */ 36 | 37 | -------------------------------------------------------------------------------- /res/resource_icon.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | IDI_ICON1 ICON DISCARDABLE "main.ico" 4 | 5 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "windows.manifest.xml" 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 8 | PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_DLL 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "040904b0" 22 | BEGIN 23 | VALUE "CompanyName", "@X_COMPANYNAME@\0" 24 | VALUE "FileDescription", "@X_DESCRIPTION@\0" 25 | VALUE "FileVersion", "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0\0" 26 | VALUE "LegalCopyright", "@X_MAINTAINER@\0" 27 | VALUE "OriginalFilename", "@X_ORIGINAL_FILENAME@.exe\0" 28 | VALUE "ProductName", "@X_PROJECTNAME@\0" 29 | VALUE "ProductVersion", "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.0\0" 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0409, 1200 35 | END 36 | END 37 | /* End of Version info */ 38 | 39 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | include(../dep/build_tools/cmake/deploy.cmake) 3 | 4 | find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) 5 | 6 | if(${QT_VERSION_MAJOR} EQUAL 5) 7 | find_package(Qt5 REQUIRED COMPONENTS Widgets Concurrent Network Script ScriptTools PrintSupport OpenGL Svg Sql LinguistTools) 8 | endif() 9 | 10 | if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) 11 | find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Concurrent Network PrintSupport OpenGL Svg Sql Qml LinguistTools) 12 | endif() 13 | 14 | file (STRINGS ${PROJECT_SOURCE_DIR}/release_version.txt X_PROJECT_VERSION) 15 | project(XHexViewer VERSION ${X_PROJECT_VERSION} LANGUAGES CXX) 16 | 17 | set(X_COMPANYNAME "ntinfo") 18 | set(X_PROJECTNAME "XHexViewer") 19 | set(X_MAINTAINER "horsicq@gmail.com") 20 | set(X_DESCRIPTION "XHexViewer is a HEX viewer") 21 | set(X_HOMEPAGE "http://ntinfo.biz") 22 | set(X_ORIGINAL_FILENAME "xhexviewer") 23 | 24 | if(${QT_VERSION} VERSION_LESS 6.1.0) 25 | set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.xhexviewer) 26 | endif() 27 | 28 | deploy_init() 29 | 30 | add_subdirectory(../dep/XCppfilt XCppfilt) 31 | add_subdirectory(../dep/XCapstone XCapstone) 32 | add_subdirectory(../dep/XArchive XArchive) 33 | add_subdirectory(../dep/XYara XYara) 34 | add_subdirectory(gui xhexviewer) 35 | -------------------------------------------------------------------------------- /src/gui/dialogoptions.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogOptions 4 | 5 | 6 | Qt::ApplicationModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 434 13 | 424 14 | 15 | 16 | 17 | Options 18 | 19 | 20 | true 21 | 22 | 23 | 24 | 25 | 26 | 27 | 0 28 | 0 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | XOptionsWidget 38 | QWidget 39 |
xoptionswidget.h
40 | 1 41 |
42 |
43 | 44 | 45 |
46 | -------------------------------------------------------------------------------- /src/gui/guimainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | GuiMainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 835 10 | 583 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 0 20 | 21 | 22 | 0 23 | 24 | 25 | 0 26 | 27 | 28 | 0 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 0 39 | 0 40 | 835 41 | 22 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/global.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #ifndef _GLOBAL_H 22 | #define _GLOBAL_H 23 | 24 | #include 25 | 26 | #define X_APPLICATIONDISPLAYNAME "XHexViewer" 27 | #define X_APPLICATIONNAME "xhexviewer" 28 | #define X_APPLICATIONVERSION "0.1.0" 29 | #define X_ORGANIZATIONNAME "NTInfo" 30 | #define X_ORGANIZATIONDOMAIN "ntinfo.biz" 31 | #define X_OPTIONSFILE "xhexviewer.ini" 32 | #define X_SHORTCUTSFILE "shortcuts.ini" 33 | 34 | #endif // _GLOBAL_H 35 | -------------------------------------------------------------------------------- /res/windows.manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/gui/dialogabout.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #ifndef DIALOGABOUT_H 22 | #define DIALOGABOUT_H 23 | 24 | #include 25 | #include 26 | 27 | #include "../global.h" 28 | #include "capstone/capstone.h" 29 | #include "xoptions.h" 30 | 31 | namespace Ui { 32 | class DialogAbout; 33 | } 34 | 35 | class DialogAbout : public QDialog { 36 | Q_OBJECT 37 | 38 | public: 39 | explicit DialogAbout(QWidget *pParent = nullptr); 40 | ~DialogAbout(); 41 | 42 | private slots: 43 | void on_pushButtonOK_clicked(); 44 | 45 | private: 46 | Ui::DialogAbout *ui; 47 | }; 48 | 49 | #endif // DIALOGABOUT_H 50 | -------------------------------------------------------------------------------- /src/gui/dialogoptions.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #ifndef DIALOGOPTIONS_H 22 | #define DIALOGOPTIONS_H 23 | 24 | #include "../global.h" 25 | #include "searchsignaturesoptionswidget.h" 26 | #include "xbinary.h" 27 | #include "xhexviewoptionswidget.h" 28 | #include "xoptions.h" 29 | #include "xshortcutsdialog.h" 30 | 31 | namespace Ui { 32 | class DialogOptions; 33 | } 34 | 35 | class DialogOptions : public XShortcutsDialog { 36 | Q_OBJECT 37 | 38 | public: 39 | explicit DialogOptions(QWidget *pParent, XOptions *pOptions); 40 | ~DialogOptions(); 41 | 42 | virtual void adjustView(); 43 | 44 | protected: 45 | virtual void registerShortcuts(bool bState); 46 | 47 | private: 48 | Ui::DialogOptions *ui; 49 | XHexViewOptionsWidget *g_pXHexViewOptionsWidget; 50 | }; 51 | 52 | #endif // DIALOGOPTIONS_H 53 | -------------------------------------------------------------------------------- /src/gui/dialogabout.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogAbout 4 | 5 | 6 | Qt::ApplicationModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 782 13 | 468 14 | 15 | 16 | 17 | About 18 | 19 | 20 | true 21 | 22 | 23 | 24 | 25 | 26 | 27 | 0 28 | 0 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Qt::Horizontal 39 | 40 | 41 | 42 | 40 43 | 20 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | OK 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | XAboutWidget 62 | QWidget 63 |
xaboutwidget.h
64 | 1 65 |
66 |
67 | 68 | 69 |
70 | -------------------------------------------------------------------------------- /src/gui/dialogoptions.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #include "dialogoptions.h" 22 | 23 | #include "ui_dialogoptions.h" 24 | 25 | DialogOptions::DialogOptions(QWidget *pParent, XOptions *pOptions) : XShortcutsDialog(pParent), ui(new Ui::DialogOptions) 26 | { 27 | ui->setupUi(this); 28 | 29 | g_pXHexViewOptionsWidget = new XHexViewOptionsWidget(this); 30 | 31 | ui->widgetOptions->setOptions(pOptions, X_APPLICATIONDISPLAYNAME); 32 | 33 | ui->widgetOptions->addPage(g_pXHexViewOptionsWidget, tr("Hex")); 34 | g_pXHexViewOptionsWidget->setOptions(pOptions); 35 | 36 | ui->widgetOptions->setCurrentPage(1); 37 | } 38 | 39 | DialogOptions::~DialogOptions() 40 | { 41 | delete ui; 42 | } 43 | 44 | void DialogOptions::adjustView() 45 | { 46 | } 47 | 48 | void DialogOptions::registerShortcuts(bool bState) 49 | { 50 | Q_UNUSED(bState) 51 | } 52 | -------------------------------------------------------------------------------- /src/gui/main_gui.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #include 22 | #include 23 | 24 | #include "guimainwindow.h" 25 | 26 | int main(int argc, char *argv[]) 27 | { 28 | XOptions::adjustApplicationInitAttributes(); 29 | #ifdef Q_OS_MAC 30 | #ifndef QT_DEBUG 31 | QCoreApplication::setLibraryPaths(QStringList(QString(argv[0]).remove("MacOS/XHexViewer") + "PlugIns")); 32 | #endif 33 | #endif 34 | QCoreApplication::setOrganizationName(X_ORGANIZATIONNAME); 35 | QCoreApplication::setOrganizationDomain(X_ORGANIZATIONDOMAIN); 36 | QCoreApplication::setApplicationName(X_APPLICATIONNAME); 37 | QCoreApplication::setApplicationVersion(X_APPLICATIONVERSION); 38 | 39 | if ((argc == 2) && ((QString(argv[1]) == "--version") || (QString(argv[1]) == "-v"))) { 40 | QString sInfo = QString("%1 v%2").arg(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION); 41 | printf("%s\n", sInfo.toUtf8().data()); 42 | 43 | return 0; 44 | } 45 | 46 | QApplication a(argc, argv); 47 | // TODO set main image 48 | 49 | XOptions xOptions; 50 | 51 | xOptions.setName(X_OPTIONSFILE); 52 | 53 | xOptions.addID(XOptions::ID_VIEW_LANG, "System"); 54 | xOptions.addID(XOptions::ID_VIEW_QSS); 55 | xOptions.addID(XOptions::ID_VIEW_STYLE, "Fusion"); 56 | 57 | xOptions.load(); 58 | 59 | XOptions::adjustApplicationView(X_APPLICATIONNAME, &xOptions); 60 | 61 | GuiMainWindow w; 62 | w.show(); 63 | 64 | return a.exec(); 65 | } 66 | -------------------------------------------------------------------------------- /src/gui/guimainwindow.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #ifndef GUIMAINWINDOW_H 22 | #define GUIMAINWINDOW_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include "../global.h" 30 | #include "xhexviewwidget.h" 31 | #include "dialogabout.h" 32 | #include "dialogoptions.h" 33 | #include "dialogshortcuts.h" 34 | #include "xinfomenu.h" 35 | 36 | namespace Ui { 37 | class GuiMainWindow; 38 | } 39 | 40 | class GuiMainWindow : public QMainWindow { 41 | Q_OBJECT 42 | 43 | public: 44 | explicit GuiMainWindow(QWidget *pParent = nullptr); 45 | ~GuiMainWindow(); 46 | 47 | private slots: 48 | void createMenus(); 49 | void actionOpenSlot(); 50 | void actionCloseSlot(); 51 | void actionExitSlot(); 52 | void actionDemangleSlot(); 53 | void actionShortcutsSlot(); 54 | void actionOptionsSlot(); 55 | void actionAboutSlot(); 56 | void adjustWindow(); 57 | void processFile(const QString &sFileName); 58 | void errorMessageSlot(const QString &sText); 59 | void closeCurrentFile(); 60 | 61 | protected: 62 | void dragEnterEvent(QDragEnterEvent *pEvent) override; 63 | void dragMoveEvent(QDragMoveEvent *pEvent) override; 64 | void dropEvent(QDropEvent *pEvent) override; 65 | 66 | private: 67 | Ui::GuiMainWindow *ui; 68 | XInfoMenu *g_pInfoMenu; 69 | XOptions g_xOptions; 70 | XShortcuts g_xShortcuts; 71 | 72 | QFile *g_pFile; 73 | XInfoDB *g_pXInfo; 74 | }; 75 | 76 | #endif // GUIMAINWINDOW_H 77 | -------------------------------------------------------------------------------- /.github/workflows/cmake-multi-platform.yml: -------------------------------------------------------------------------------- 1 | # This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. 2 | # See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml 3 | name: CMake on multiple platforms 4 | 5 | on: 6 | push: 7 | branches: [ "master" ] 8 | pull_request: 9 | branches: [ "master" ] 10 | 11 | jobs: 12 | build: 13 | runs-on: ${{ matrix.os }} 14 | 15 | strategy: 16 | # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. 17 | fail-fast: false 18 | 19 | # Set up a matrix to run the following 3 configurations: 20 | # 1. 21 | # 2. 22 | # 3. 23 | # 24 | # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. 25 | matrix: 26 | os: [ubuntu-latest, windows-latest] 27 | build_type: [Release] 28 | c_compiler: [gcc, clang, cl] 29 | include: 30 | - os: windows-latest 31 | c_compiler: cl 32 | cpp_compiler: cl 33 | - os: ubuntu-latest 34 | c_compiler: gcc 35 | cpp_compiler: g++ 36 | - os: ubuntu-latest 37 | c_compiler: clang 38 | cpp_compiler: clang++ 39 | exclude: 40 | - os: windows-latest 41 | c_compiler: gcc 42 | - os: windows-latest 43 | c_compiler: clang 44 | - os: ubuntu-latest 45 | c_compiler: cl 46 | 47 | steps: 48 | - uses: actions/checkout@v4 49 | with: 50 | submodules: 'recursive' 51 | path: 'code' 52 | 53 | - name: Set reusable strings 54 | # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. 55 | id: strings 56 | shell: bash 57 | run: | 58 | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" 59 | 60 | - name: Configure CMake 61 | # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. 62 | # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type 63 | run: > 64 | cmake -B ${{ steps.strings.outputs.build-output-dir }} 65 | -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} 66 | -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} 67 | -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} 68 | -S ${{ github.workspace }} 69 | 70 | - name: Build 71 | # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). 72 | run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} 73 | 74 | - name: Test 75 | working-directory: ${{ steps.strings.outputs.build-output-dir }} 76 | # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). 77 | # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail 78 | run: ctest --build-config ${{ matrix.build_type }} 79 | -------------------------------------------------------------------------------- /src/gui/rsrc.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/Add.16.16.png 4 | icons/Address.16.16.png 5 | icons/Backward.16.16.png 6 | icons/Binary.16.16.png 7 | icons/BreakpointDisabled.16.16.png 8 | icons/BreakpointEnabled.16.16.png 9 | icons/Certificate.16.16.png 10 | icons/Copy.16.16.png 11 | icons/Debug.16.16.png 12 | icons/Demangle.16.16.png 13 | icons/Disasm.16.16.png 14 | icons/DotNet.16.16.png 15 | icons/Download.16.16.png 16 | icons/Edit.16.16.png 17 | icons/Entropy.16.16.png 18 | icons/Entry.16.16.png 19 | icons/Exception.16.16.png 20 | icons/Exit.16.16.png 21 | icons/Extract.16.16.png 22 | icons/File.16.16.png 23 | icons/Forward.16.16.png 24 | icons/Goto.16.16.png 25 | icons/Hash.16.16.png 26 | icons/Header.16.16.png 27 | icons/Image.16.16.png 28 | icons/Info.16.16.png 29 | icons/Library.16.16.png 30 | icons/List.16.16.png 31 | icons/MemoryMap.16.16.png 32 | icons/Metadata.16.16.png 33 | icons/Mime.16.16.png 34 | icons/Offset.16.16.png 35 | icons/Open.16.16.png 36 | icons/Option.16.16.png 37 | icons/Overlay.16.16.png 38 | icons/Refresh.16.16.png 39 | icons/Resource.16.16.png 40 | icons/Save.16.16.png 41 | icons/Search.16.16.png 42 | icons/Section.16.16.png 43 | icons/Segment.16.16.png 44 | icons/Select.16.16.png 45 | icons/Shortcut.16.16.png 46 | icons/Signature.16.16.png 47 | icons/Size.16.16.png 48 | icons/String.16.16.png 49 | icons/Structs.16.16.png 50 | icons/Symbol.16.16.png 51 | icons/TLS.16.16.png 52 | icons/Table.16.16.png 53 | icons/Tool.16.16.png 54 | icons/Value.16.16.png 55 | icons/Virustotal.16.16.png 56 | icons/Yara.16.16.png 57 | icons/Export.16.16.png 58 | icons/Import.16.16.png 59 | icons/Data.16.16.png 60 | icons/NFD.16.16.png 61 | icons/DIE.16.16.png 62 | icons/Version.16.16.png 63 | icons/Manifest.16.16.png 64 | icons/Action.16.16.png 65 | icons/Follow.16.16.png 66 | icons/Reloc.16.16.png 67 | icons/Next.16.16.png 68 | icons/All.16.16.png 69 | icons/Path.16.16.png 70 | icons/Note.16.16.png 71 | icons/Function.16.16.png 72 | icons/Script.16.16.png 73 | icons/Patch.16.16.png 74 | icons/Remove.16.16.png 75 | icons/Resize.16.16.png 76 | icons/Code.16.16.png 77 | icons/Reference.16.16.png 78 | icons/Bookmark.16.16.png 79 | icons/Convertor.16.16.png 80 | icons/Inspector.16.16.png 81 | images/about.png 82 | 83 | 84 | -------------------------------------------------------------------------------- /.github/workflows/builder.yml: -------------------------------------------------------------------------------- 1 | name: builder 2 | on: 3 | workflow_dispatch: 4 | release: 5 | types: [created] 6 | schedule: 7 | - cron: '0 0 * * MON' 8 | 9 | env: 10 | SRC_PATH: ${{ github.workspace }}/src 11 | 12 | jobs: 13 | build-ubuntu: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | with: 18 | submodules: recursive 19 | path: ${{ env.SRC_PATH }} 20 | 21 | - name: Install Qt (Ubuntu) 22 | run: | 23 | sudo apt-get update 24 | sudo apt-get install cmake qtbase5-dev qtscript5-dev qttools5-dev qttools5-dev-tools libqt5svg5-dev qtchooser qt5-qmake build-essential -y 25 | 26 | - name: Build 27 | working-directory: ${{ env.SRC_PATH }} 28 | run: | 29 | mkdir tmp_build 30 | cd tmp_build 31 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="/usr/lib/x86_64-linux-gnu/cmake/Qt5" .. 32 | make 33 | cpack -G DEB 34 | 35 | - name: Upload Release as Download 36 | uses: softprops/action-gh-release@v2 37 | env: 38 | RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} 39 | with: 40 | tag_name: Beta 41 | draft: false 42 | prerelease: true 43 | files: | 44 | ${{ env.SRC_PATH }}/tmp_build/packages/*.deb 45 | 46 | build-windows-32: 47 | runs-on: windows-2022 48 | steps: 49 | - uses: actions/checkout@v4 50 | with: 51 | submodules: 'recursive' 52 | path: ${{ env.SRC_PATH }} 53 | 54 | - name: Setup MSVC 55 | uses: ilammy/msvc-dev-cmd@v1 56 | with: 57 | arch: x86 58 | 59 | - name: Install Qt 60 | uses: jurplel/install-qt-action@v4 61 | with: 62 | version: '5.15.2' 63 | host: 'windows' 64 | target: 'desktop' 65 | arch: 'win32_msvc2019' 66 | dir: ${{ github.workspace }} 67 | modules: qtscript 68 | 69 | - name: Build 70 | shell: cmd 71 | working-directory: ${{ env.SRC_PATH }} 72 | run: | 73 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86 74 | mkdir tmp_build 75 | cd tmp_build 76 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="${{ github.workspace }}\Qt\5.15.2\msvc2019" -G "NMake Makefiles" .. 77 | nmake 78 | cpack -G ZIP 79 | - name: Upload Release as Download 80 | uses: softprops/action-gh-release@v2 81 | env: 82 | RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} 83 | with: 84 | tag_name: Beta 85 | draft: false 86 | prerelease: true 87 | files: | 88 | ${{ env.SRC_PATH }}/tmp_build/packages/*.zip 89 | 90 | build-windows-64: 91 | runs-on: windows-2022 92 | steps: 93 | - uses: actions/checkout@v4 94 | with: 95 | submodules: 'recursive' 96 | path: ${{ env.SRC_PATH }} 97 | 98 | - name: Setup MSVC 99 | uses: ilammy/msvc-dev-cmd@v1 100 | with: 101 | arch: x64 102 | 103 | - name: Install Qt 104 | uses: jurplel/install-qt-action@v4 105 | with: 106 | version: '5.15.2' 107 | host: 'windows' 108 | target: 'desktop' 109 | arch: 'win64_msvc2019_64' 110 | dir: ${{ github.workspace }} 111 | modules: qtscript 112 | 113 | - name: Build 114 | shell: cmd 115 | working-directory: ${{ env.SRC_PATH }} 116 | run: | 117 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 118 | mkdir tmp_build 119 | cd tmp_build 120 | cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_PREFIX_PATH="${{ github.workspace }}\Qt\5.15.2\msvc2019_64" -G "NMake Makefiles" .. 121 | nmake 122 | cpack -G ZIP 123 | - name: Upload Release as Download 124 | uses: softprops/action-gh-release@v2 125 | env: 126 | RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} 127 | with: 128 | tag_name: Beta 129 | draft: false 130 | prerelease: true 131 | files: | 132 | ${{ env.SRC_PATH }}/tmp_build/packages/*.zip 133 | -------------------------------------------------------------------------------- /src/gui/dialogabout.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #include "dialogabout.h" 22 | 23 | #include "ui_dialogabout.h" 24 | 25 | DialogAbout::DialogAbout(QWidget *pParent) : QDialog(pParent), ui(new Ui::DialogAbout) 26 | { 27 | ui->setupUi(this); 28 | 29 | XAboutWidget::DATA _data = {}; 30 | 31 | _data.sInfo += 32 | QString("

%1

").arg(XOptions::getTitle(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION, false)); 33 | _data.sInfo += QString("

Copyright (C) 2024-2025 Hors

"); 34 | _data.sInfo += QString( 35 | "

%1: horsicq@gmail.com

") 37 | .arg(tr("Bugreports")); 38 | _data.sInfo += QString( 39 | "

%1: http://ntinfo.biz

") 41 | .arg(tr("Website")); 42 | _data.sInfo += 43 | QString( 44 | "

%1(Paypal): ntinfo.re@gmail.com

") 46 | .arg(tr("Donate")); 47 | _data.sInfo += 48 | QString( 49 | "

%1(BTC): 3DqddVBX9PKqMvNPXZ3gPHBNNRtD9CnmJo

") 51 | .arg(tr("Donate")); 52 | _data.sInfo += 53 | QString( 54 | "

%1: https://github.com/horsicq/XHexViewer

") 56 | .arg(tr("Source code")); 57 | 58 | _data.sLibraries += 59 | QString( 60 | "

QT Library %1 http://qt-project.org

") 62 | .arg(QT_VERSION_STR); 63 | _data.sLibraries += QString( 64 | "

Capstone %1.%2.%3 http://www.capstone-engine.org

") 66 | .arg(QString::number(CS_VERSION_MAJOR), QString::number(CS_VERSION_MINOR), QString::number(CS_VERSION_EXTRA)); 67 | 68 | _data.sLogoPath = ":/images/about.png"; 69 | _data.sUpdatesLink = "https://github.com/horsicq/XHexViewer/releases"; 70 | _data.sThanksLink = "https://github.com/horsicq/XHexViewer/blob/master/THANKS.md"; 71 | 72 | ui->widgetAbout->setData(_data); 73 | } 74 | 75 | DialogAbout::~DialogAbout() 76 | { 77 | delete ui; 78 | } 79 | 80 | void DialogAbout::on_pushButtonOK_clicked() 81 | { 82 | this->close(); 83 | } 84 | -------------------------------------------------------------------------------- /src/gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | include(../../dep/build_tools/cmake/deploy.cmake) 4 | include(GNUInstallDirs) 5 | 6 | project(xhexviewer VERSION ${X_PROJECT_VERSION} LANGUAGES CXX) 7 | 8 | set(CMAKE_AUTOUIC ON) 9 | set(CMAKE_AUTOMOC ON) 10 | set(CMAKE_AUTORCC ON) 11 | 12 | set(CMAKE_CXX_STANDARD 11) 13 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 14 | 15 | if(WIN32) 16 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") 17 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO") 18 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO") 19 | endif() 20 | 21 | add_definitions(-DUSE_DEX) 22 | add_definitions(-DUSE_PDF) 23 | add_definitions(-DUSE_ARCHIVE) 24 | add_definitions(-DUSE_YARA) 25 | 26 | include(${CMAKE_CURRENT_LIST_DIR}/../../dep//XHexView/xhexview.cmake) 27 | include(${CMAKE_CURRENT_LIST_DIR}/../../dep/XAboutWidget/xaboutwidget.cmake) 28 | 29 | set(TS_FILES 30 | ../../res/translation/xhexviewer_ar.ts 31 | ../../res/translation/xhexviewer_bn.ts 32 | ../../res/translation/xhexviewer_de.ts 33 | ) 34 | 35 | set(PROJECT_SOURCES 36 | ${XHEXVIEW_SOURCES} 37 | ${XABOUTWIDGET_SOURCES} 38 | dialogabout.cpp 39 | dialogabout.h 40 | dialogabout.ui 41 | dialogoptions.cpp 42 | dialogoptions.h 43 | dialogoptions.ui 44 | main_gui.cpp 45 | guimainwindow.cpp 46 | guimainwindow.h 47 | guimainwindow.ui 48 | rsrc.qrc 49 | ) 50 | 51 | #qt_create_translation(QM_FILES ${PROJECT_SOURCES} ${TS_FILES}) 52 | #qt_add_translation(QM_FILES ${TS_FILES}) 53 | 54 | if(WIN32) 55 | add_executable(xhexviewer WIN32 56 | ${PROJECT_SOURCES} 57 | ../../res/resource.rc 58 | ) 59 | else() 60 | add_executable(xhexviewer 61 | ${PROJECT_SOURCES} 62 | ) 63 | endif() 64 | 65 | set_target_properties(xhexviewer PROPERTIES 66 | ${BUNDLE_ID_OPTION} 67 | MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} 68 | MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} 69 | MACOSX_BUNDLE TRUE 70 | WIN32_EXECUTABLE TRUE 71 | ) 72 | 73 | target_link_libraries(xhexviewer PRIVATE bzip2) 74 | target_link_libraries(xhexviewer PRIVATE lzma) 75 | target_link_libraries(xhexviewer PRIVATE zlib) 76 | target_link_libraries(xhexviewer PRIVATE ppmd) 77 | target_link_libraries(xhexviewer PRIVATE capstone) 78 | target_link_libraries(xhexviewer PRIVATE cppfilt) 79 | target_link_libraries(xhexviewer PRIVATE yara) 80 | 81 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) 82 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::Concurrent) 83 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::Network) 84 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::PrintSupport) 85 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::OpenGL) 86 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::Svg) 87 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::Sql) 88 | 89 | if(${QT_VERSION_MAJOR} EQUAL 5) 90 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::Script) 91 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::ScriptTools) 92 | endif() 93 | 94 | if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) 95 | target_link_libraries(xhexviewer PRIVATE Qt${QT_VERSION_MAJOR}::Qml) 96 | endif() 97 | 98 | if(WIN32) 99 | target_link_libraries(xhexviewer PRIVATE Wintrust) 100 | target_link_libraries(xhexviewer PRIVATE Crypt32) 101 | endif() 102 | 103 | if(WIN32) 104 | install (TARGETS xhexviewer DESTINATION "./") 105 | install (DIRECTORY ../../dep/Detect-It-Easy/db DESTINATION "./" OPTIONAL) 106 | install (DIRECTORY ../../dep/Detect-It-Easy/db_custom DESTINATION "./" OPTIONAL) 107 | install (DIRECTORY ../../dep/XInfoDB/info DESTINATION "./" OPTIONAL) 108 | install (DIRECTORY ../../dep/XStyles/qss DESTINATION "./" OPTIONAL) 109 | install (DIRECTORY ../../dep/XYara/yara_rules DESTINATION "./" OPTIONAL) 110 | install (FILES ../../dep/signatures/crypto.db DESTINATION "./signatures" OPTIONAL) 111 | deploy_qt() 112 | deploy_msvc() 113 | elseif(APPLE) 114 | install(TARGETS xhexviewer 115 | BUNDLE DESTINATION . 116 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 117 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 118 | ) 119 | else() 120 | install (TARGETS xhexviewer DESTINATION ${CMAKE_INSTALL_BINDIR}) 121 | install (DIRECTORY ../../dep/Detect-It-Easy/db DESTINATION ${CMAKE_INSTALL_LIBDIR}/xhexviewer OPTIONAL) 122 | install (DIRECTORY ../../dep/Detect-It-Easy/db_custom DESTINATION ${CMAKE_INSTALL_LIBDIR}/xhexviewer OPTIONAL) 123 | install (DIRECTORY ../../dep/XInfoDB/info DESTINATION ${CMAKE_INSTALL_LIBDIR}/xhexviewer OPTIONAL) 124 | install (DIRECTORY ../../dep/XStyles/qss DESTINATION ${CMAKE_INSTALL_LIBDIR}/xhexviewer OPTIONAL) 125 | install (DIRECTORY ../../dep/XYara/yara_rules DESTINATION ${CMAKE_INSTALL_LIBDIR}/xhexviewer OPTIONAL) 126 | install (FILES ../../dep/signatures/crypto.db DESTINATION ${CMAKE_INSTALL_LIBDIR}/xhexviewer/signatures OPTIONAL) 127 | endif() 128 | 129 | # if(${QT_VERSION_MAJOR} EQUAL 6) 130 | # qt_finalize_executable(xhexviewer) 131 | # endif() 132 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dep/Detect-It-Easy"] 2 | path = dep/Detect-It-Easy 3 | url = https://github.com/horsicq/Detect-It-Easy 4 | [submodule "dep/archive_widget"] 5 | path = dep/archive_widget 6 | url = https://github.com/horsicq/archive_widget 7 | [submodule "dep/build_tools"] 8 | path = dep/build_tools 9 | url = https://github.com/horsicq/build_tools 10 | [submodule "dep/Controls"] 11 | path = dep/Controls 12 | url = https://github.com/horsicq/Controls 13 | [submodule "dep/die_script"] 14 | path = dep/die_script 15 | url = https://github.com/horsicq/die_script 16 | [submodule "dep/die_widget"] 17 | path = dep/die_widget 18 | url = https://github.com/horsicq/die_widget 19 | [submodule "dep/FormatDialogs"] 20 | path = dep/FormatDialogs 21 | url = https://github.com/horsicq/FormatDialogs 22 | [submodule "dep/Formats"] 23 | path = dep/Formats 24 | url = https://github.com/horsicq/Formats 25 | [submodule "dep/FormatWidgets"] 26 | path = dep/FormatWidgets 27 | url = https://github.com/horsicq/FormatWidgets 28 | [submodule "dep/hex_templates"] 29 | path = dep/hex_templates 30 | url = https://github.com/horsicq/hex_templates 31 | [submodule "dep/nfd_widget"] 32 | path = dep/nfd_widget 33 | url = https://github.com/horsicq/nfd_widget 34 | [submodule "dep/signatures"] 35 | path = dep/signatures 36 | url = https://github.com/horsicq/signatures 37 | [submodule "dep/SpecAbstract"] 38 | path = dep/SpecAbstract 39 | url = https://github.com/horsicq/SpecAbstract 40 | [submodule "dep/StaticScan"] 41 | path = dep/StaticScan 42 | url = https://github.com/horsicq/StaticScan 43 | [submodule "dep/XAboutWidget"] 44 | path = dep/XAboutWidget 45 | url = https://github.com/horsicq/XAboutWidget 46 | [submodule "dep/XArchive"] 47 | path = dep/XArchive 48 | url = https://github.com/horsicq/XArchive 49 | [submodule "dep/XCapstone"] 50 | path = dep/XCapstone 51 | url = https://github.com/horsicq/XCapstone 52 | [submodule "dep/XCppfilt"] 53 | path = dep/XCppfilt 54 | url = https://github.com/horsicq/XCppfilt 55 | [submodule "dep/XDecompiler"] 56 | path = dep/XDecompiler 57 | url = https://github.com/horsicq/XDecompiler 58 | [submodule "dep/XDemangle"] 59 | path = dep/XDemangle 60 | url = https://github.com/horsicq/XDemangle 61 | [submodule "dep/XDemangleWidget"] 62 | path = dep/XDemangleWidget 63 | url = https://github.com/horsicq/XDemangleWidget 64 | [submodule "dep/XDEX"] 65 | path = dep/XDEX 66 | url = https://github.com/horsicq/XDEX 67 | [submodule "dep/XDisasmView"] 68 | path = dep/XDisasmView 69 | url = https://github.com/horsicq/XDisasmView 70 | [submodule "dep/XDynStructs"] 71 | path = dep/XDynStructs 72 | url = https://github.com/horsicq/XDynStructs 73 | [submodule "dep/XDynStructsEngine"] 74 | path = dep/XDynStructsEngine 75 | url = https://github.com/horsicq/XDynStructsEngine 76 | [submodule "dep/XDynStructsWidget"] 77 | path = dep/XDynStructsWidget 78 | url = https://github.com/horsicq/XDynStructsWidget 79 | [submodule "dep/XEntropyWidget"] 80 | path = dep/XEntropyWidget 81 | url = https://github.com/horsicq/XEntropyWidget 82 | [submodule "dep/XExtractor"] 83 | path = dep/XExtractor 84 | url = https://github.com/horsicq/XExtractor 85 | [submodule "dep/XExtractorWidget"] 86 | path = dep/XExtractorWidget 87 | url = https://github.com/horsicq/XExtractorWidget 88 | [submodule "dep/XFileInfo"] 89 | path = dep/XFileInfo 90 | url = https://github.com/horsicq/XFileInfo 91 | [submodule "dep/XGithub"] 92 | path = dep/XGithub 93 | url = https://github.com/horsicq/XGithub 94 | [submodule "dep/XHashWidget"] 95 | path = dep/XHashWidget 96 | url = https://github.com/horsicq/XHashWidget 97 | [submodule "dep/XHexEdit"] 98 | path = dep/XHexEdit 99 | url = https://github.com/horsicq/XHexEdit 100 | [submodule "dep/XHexView"] 101 | path = dep/XHexView 102 | url = https://github.com/horsicq/XHexView 103 | [submodule "dep/XInfoDB"] 104 | path = dep/XInfoDB 105 | url = https://github.com/horsicq/XInfoDB 106 | [submodule "dep/XLLVMDemangler"] 107 | path = dep/XLLVMDemangler 108 | url = https://github.com/horsicq/XLLVMDemangler 109 | [submodule "dep/XLog"] 110 | path = dep/XLog 111 | url = https://github.com/horsicq/XLog 112 | [submodule "dep/XMemoryMapWidget"] 113 | path = dep/XMemoryMapWidget 114 | url = https://github.com/horsicq/XMemoryMapWidget 115 | [submodule "dep/XOnlineTools"] 116 | path = dep/XOnlineTools 117 | url = https://github.com/horsicq/XOnlineTools 118 | [submodule "dep/XOptions"] 119 | path = dep/XOptions 120 | url = https://github.com/horsicq/XOptions 121 | [submodule "dep/XPDF"] 122 | path = dep/XPDF 123 | url = https://github.com/horsicq/XPDF 124 | [submodule "dep/XQwt"] 125 | path = dep/XQwt 126 | url = https://github.com/horsicq/XQwt 127 | [submodule "dep/XShortcuts"] 128 | path = dep/XShortcuts 129 | url = https://github.com/horsicq/XShortcuts 130 | [submodule "dep/XStyles"] 131 | path = dep/XStyles 132 | url = https://github.com/horsicq/XStyles 133 | [submodule "dep/XSymbolsWidget"] 134 | path = dep/XSymbolsWidget 135 | url = https://github.com/horsicq/XSymbolsWidget 136 | [submodule "dep/XTranslation"] 137 | path = dep/XTranslation 138 | url = https://github.com/horsicq/XTranslation 139 | [submodule "dep/XUpdate"] 140 | path = dep/XUpdate 141 | url = https://github.com/horsicq/XUpdate 142 | [submodule "dep/XVisualizationWidget"] 143 | path = dep/XVisualizationWidget 144 | url = https://github.com/horsicq/XVisualizationWidget 145 | [submodule "dep/XYara"] 146 | path = dep/XYara 147 | url = https://github.com/horsicq/XYara 148 | [submodule "dep/yara_widget"] 149 | path = dep/yara_widget 150 | url = https://github.com/horsicq/yara_widget 151 | [submodule "dep/XDataConvertorWidget"] 152 | path = dep/XDataConvertorWidget 153 | url = https://github.com/horsicq/XDataConvertorWidget 154 | [submodule "dep/XScanEngine"] 155 | path = dep/XScanEngine 156 | url = https://github.com/horsicq/XScanEngine 157 | [submodule "dep/XDisasmCore"] 158 | path = dep/XDisasmCore 159 | url = https://github.com/horsicq/XDisasmCore.git 160 | [submodule "dep/XRegionsWidget"] 161 | path = dep/XRegionsWidget 162 | url = https://github.com/horsicq/XRegionsWidget.git 163 | [submodule "dep/XStaticUnpacker"] 164 | path = dep/XStaticUnpacker 165 | url = https://github.com/horsicq/XStaticUnpacker 166 | -------------------------------------------------------------------------------- /src/gui/guimainwindow.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #include "guimainwindow.h" 22 | 23 | #include "ui_guimainwindow.h" 24 | 25 | GuiMainWindow::GuiMainWindow(QWidget *pParent) : QMainWindow(pParent), ui(new Ui::GuiMainWindow) 26 | { 27 | ui->setupUi(this); 28 | 29 | // ui->mdiArea->setDocumentMode(false); 30 | ui->mdiArea->setViewMode(QMdiArea::TabbedView); 31 | 32 | g_pFile = nullptr; 33 | g_pXInfo = nullptr; 34 | 35 | setWindowTitle(XOptions::getTitle(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION)); 36 | 37 | setAcceptDrops(true); 38 | 39 | g_xOptions.setName(X_OPTIONSFILE); 40 | 41 | g_xOptions.addID(XOptions::ID_VIEW_STYLE, "Fusion"); 42 | g_xOptions.addID(XOptions::ID_VIEW_QSS, ""); 43 | g_xOptions.addID(XOptions::ID_VIEW_LANG, "System"); 44 | g_xOptions.addID(XOptions::ID_VIEW_FONT_CONTROLS, XOptions::getDefaultFont().toString()); 45 | g_xOptions.addID(XOptions::ID_VIEW_FONT_TABLEVIEWS, XOptions::getMonoFont().toString()); 46 | g_xOptions.addID(XOptions::ID_VIEW_FONT_TREEVIEWS, XOptions::getDefaultFont().toString()); 47 | g_xOptions.addID(XOptions::ID_VIEW_FONT_TEXTEDITS, XOptions::getMonoFont().toString()); 48 | g_xOptions.addID(XOptions::ID_VIEW_STAYONTOP, false); 49 | g_xOptions.addID(XOptions::ID_VIEW_SHOWLOGO, false); 50 | g_xOptions.addID(XOptions::ID_FILE_SAVELASTDIRECTORY, true); 51 | g_xOptions.addID(XOptions::ID_FILE_SAVEBACKUP, true); 52 | g_xOptions.addID(XOptions::ID_FILE_SAVERECENTFILES, true); 53 | 54 | #ifdef Q_OS_WIN 55 | g_xOptions.addID(XOptions::ID_FILE_CONTEXT, "*"); 56 | #endif 57 | 58 | XHexViewOptionsWidget::setDefaultValues(&g_xOptions); 59 | 60 | g_xOptions.load(); 61 | 62 | g_xShortcuts.setName(X_SHORTCUTSFILE); 63 | g_xShortcuts.setNative(g_xOptions.isNative(), g_xOptions.getApplicationDataPath()); 64 | 65 | g_xShortcuts.addGroup(XShortcuts::GROUPID_STRINGS); 66 | // g_xShortcuts.addGroup(XShortcuts::GROUPID_SIGNATURE); 67 | g_xShortcuts.addGroup(XShortcuts::GROUPID_HEX); 68 | // g_xShortcuts.addGroup(XShortcuts::GROUPID_DISASM); 69 | // g_xShortcuts.addGroup(XShortcuts::GROUPID_FIND); 70 | 71 | g_xShortcuts.load(); 72 | 73 | g_pInfoMenu = new XInfoMenu(&g_xShortcuts, &g_xOptions); 74 | 75 | // ui->widgetViewer->setGlobal(&g_xShortcuts, &g_xOptions); 76 | 77 | connect(&g_xOptions, SIGNAL(openFile(QString)), this, SLOT(processFile(QString))); 78 | connect(&g_xOptions, SIGNAL(errorMessage(QString)), this, SLOT(errorMessageSlot(QString))); 79 | 80 | createMenus(); 81 | 82 | adjustWindow(); 83 | 84 | // ui->widgetViewer->setReadonlyVisible(true); 85 | 86 | if (QCoreApplication::arguments().count() > 1) { 87 | QString sFileName = QCoreApplication::arguments().at(1); 88 | 89 | processFile(sFileName); 90 | } 91 | } 92 | 93 | GuiMainWindow::~GuiMainWindow() 94 | { 95 | closeCurrentFile(); 96 | g_xOptions.save(); 97 | g_xShortcuts.save(); 98 | 99 | delete ui; 100 | } 101 | 102 | void GuiMainWindow::createMenus() 103 | { 104 | QMenu *pMenuFile = new QMenu(tr("File"), ui->menubar); 105 | QMenu *pMenuTools = new QMenu(tr("Tools"), ui->menubar); 106 | QMenu *pMenuHelp = new QMenu(tr("Help"), ui->menubar); 107 | 108 | ui->menubar->addAction(pMenuFile->menuAction()); 109 | ui->menubar->addAction(pMenuTools->menuAction()); 110 | ui->menubar->addAction(pMenuHelp->menuAction()); 111 | 112 | QAction *pActionOpen = new QAction(tr("Open"), this); 113 | QAction *pActionClose = new QAction(tr("Close"), this); 114 | QAction *pActionExit = new QAction(tr("Exit"), this); 115 | QAction *pActionOptions = new QAction(tr("Options"), this); 116 | QAction *pActionAbout = new QAction(tr("About"), this); 117 | QAction *pActionShortcuts = new QAction(tr("Shortcuts"), this); 118 | QAction *pActionDemangle = new QAction(tr("Demangle"), this); 119 | 120 | pMenuFile->addAction(pActionOpen); 121 | pMenuFile->addMenu(g_xOptions.createRecentFilesMenu(this)); 122 | pMenuFile->addMenu(g_pInfoMenu->createMenu(this)); 123 | pMenuFile->addAction(pActionClose); 124 | pMenuFile->addAction(pActionExit); 125 | pMenuTools->addAction(pActionDemangle); 126 | pMenuTools->addAction(pActionShortcuts); 127 | pMenuTools->addAction(pActionOptions); 128 | pMenuHelp->addAction(pActionAbout); 129 | 130 | connect(pActionOpen, SIGNAL(triggered()), this, SLOT(actionOpenSlot())); 131 | connect(pActionClose, SIGNAL(triggered()), this, SLOT(actionCloseSlot())); 132 | connect(pActionExit, SIGNAL(triggered()), this, SLOT(actionExitSlot())); 133 | connect(pActionOptions, SIGNAL(triggered()), this, SLOT(actionOptionsSlot())); 134 | connect(pActionAbout, SIGNAL(triggered()), this, SLOT(actionAboutSlot())); 135 | connect(pActionShortcuts, SIGNAL(triggered()), this, SLOT(actionShortcutsSlot())); 136 | connect(pActionDemangle, SIGNAL(triggered()), this, SLOT(actionDemangleSlot())); 137 | } 138 | 139 | void GuiMainWindow::actionOpenSlot() 140 | { 141 | QString sDirectory = g_xOptions.getLastDirectory(); 142 | 143 | QString sFileName = QFileDialog::getOpenFileName(this, tr("Open file") + QString("..."), sDirectory, tr("All files") + QString(" (*)")); 144 | 145 | if (!sFileName.isEmpty()) { 146 | processFile(sFileName); 147 | } 148 | } 149 | 150 | void GuiMainWindow::actionCloseSlot() 151 | { 152 | closeCurrentFile(); 153 | } 154 | 155 | void GuiMainWindow::actionExitSlot() 156 | { 157 | this->close(); 158 | } 159 | 160 | void GuiMainWindow::actionOptionsSlot() 161 | { 162 | DialogOptions dialogOptions(this, &g_xOptions); 163 | dialogOptions.setGlobal(&g_xShortcuts, &g_xOptions); 164 | dialogOptions.exec(); 165 | 166 | // ui->widgetViewer->adjustView(); 167 | adjustWindow(); 168 | } 169 | 170 | void GuiMainWindow::actionAboutSlot() 171 | { 172 | DialogAbout dialogAbout(this); 173 | dialogAbout.exec(); 174 | } 175 | 176 | void GuiMainWindow::adjustWindow() 177 | { 178 | // ui->widgetViewer->adjustView(); 179 | 180 | g_xOptions.adjustWindow(this); 181 | 182 | // if (g_xOptions.isShowLogo()) { 183 | // ui->labelLogo->show(); 184 | // } else { 185 | // ui->labelLogo->hide(); 186 | // } 187 | } 188 | 189 | void GuiMainWindow::processFile(const QString &sFileName) 190 | { 191 | if ((sFileName != "") && (QFileInfo(sFileName).isFile())) { 192 | g_xOptions.setLastFileName(sFileName); 193 | 194 | closeCurrentFile(); 195 | 196 | QFile *pFile = new QFile; 197 | XInfoDB *pXInfo = new XInfoDB; 198 | 199 | pFile->setFileName(sFileName); 200 | 201 | if (!pFile->open(QIODevice::ReadWrite)) { 202 | if (!pFile->open(QIODevice::ReadOnly)) { 203 | closeCurrentFile(); 204 | } 205 | } 206 | 207 | if (pFile) { 208 | XBinary xbinary(pFile); 209 | if (xbinary.isValid()) { 210 | pXInfo->setData(pFile, xbinary.getFileType()); 211 | g_pInfoMenu->setData(pXInfo); 212 | g_pInfoMenu->tryToLoad(); 213 | 214 | XHexViewWidget::OPTIONS options = {}; 215 | 216 | XHexViewWidget *pHexViewWidget = new XHexViewWidget; 217 | pHexViewWidget->setGlobal(&g_xShortcuts, &g_xOptions); 218 | pHexViewWidget->setData(pFile, options); 219 | pHexViewWidget->setXInfoDB(pXInfo); 220 | pHexViewWidget->reload(); 221 | 222 | ui->mdiArea->addSubWindow(pHexViewWidget); 223 | pHexViewWidget->show(); 224 | 225 | // ui->widgetViewer->setData(g_pFile, options); 226 | // ui->widgetViewer->setXInfoDB(g_pXInfo); 227 | 228 | // ui->widgetViewer->reload(); 229 | 230 | adjustWindow(); 231 | 232 | setWindowTitle(sFileName); 233 | // ui->stackedWidget->setCurrentIndex(1); 234 | } else { 235 | QMessageBox::critical(this, tr("Error"), tr("It is not a valid file")); 236 | } 237 | } else { 238 | QMessageBox::critical(this, tr("Error"), tr("Cannot open file")); 239 | } 240 | } else { 241 | QMessageBox::critical(this, tr("Error"), tr("Cannot open file")); 242 | } 243 | } 244 | 245 | void GuiMainWindow::errorMessageSlot(const QString &sText) 246 | { 247 | QMessageBox::critical(this, tr("Error"), sText); 248 | } 249 | 250 | void GuiMainWindow::closeCurrentFile() 251 | { 252 | if (g_pXInfo) { 253 | g_pInfoMenu->tryToSave(); 254 | delete g_pXInfo; 255 | g_pXInfo = nullptr; 256 | g_pInfoMenu->reset(); 257 | } 258 | 259 | if (g_pFile) { 260 | g_pFile->close(); 261 | delete g_pFile; 262 | g_pFile = nullptr; 263 | } 264 | 265 | // ui->stackedWidget->setCurrentIndex(0); 266 | // ui->widgetViewer->cleanup(); 267 | 268 | setWindowTitle(XOptions::getTitle(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION)); 269 | } 270 | 271 | void GuiMainWindow::dragEnterEvent(QDragEnterEvent *pEvent) 272 | { 273 | pEvent->acceptProposedAction(); 274 | } 275 | 276 | void GuiMainWindow::dragMoveEvent(QDragMoveEvent *pEvent) 277 | { 278 | pEvent->acceptProposedAction(); 279 | } 280 | 281 | void GuiMainWindow::dropEvent(QDropEvent *pEvent) 282 | { 283 | const QMimeData *mimeData = pEvent->mimeData(); 284 | 285 | if (mimeData->hasUrls()) { 286 | QList urlList = mimeData->urls(); 287 | 288 | if (urlList.count()) { 289 | QString sFileName = urlList.at(0).toLocalFile(); 290 | 291 | sFileName = XBinary::convertFileName(sFileName); 292 | 293 | processFile(sFileName); 294 | } 295 | } 296 | } 297 | 298 | void GuiMainWindow::actionShortcutsSlot() 299 | { 300 | DialogShortcuts dialogShortcuts(this); 301 | 302 | dialogShortcuts.setData(&g_xShortcuts); 303 | 304 | dialogShortcuts.exec(); 305 | 306 | adjustWindow(); 307 | } 308 | 309 | void GuiMainWindow::actionDemangleSlot() 310 | { 311 | // DialogDemangle dialogDemangle(this); 312 | 313 | // dialogDemangle.exec(); 314 | } 315 | --------------------------------------------------------------------------------