├── README.md ├── release_version.txt ├── res ├── readme.txt ├── main.ico ├── main.png ├── main.icns ├── resource.rc ├── resource_icon.rc ├── Info.plist ├── Info.plist.in ├── license.txt ├── resource.rc.in ├── resource_icon.rc.in └── windows.manifest.xml ├── .github ├── FUNDING.yml └── workflows │ └── builder.yml ├── src ├── gui │ ├── images │ │ └── about.png │ ├── icons │ │ ├── Add.16.16.png │ │ ├── All.16.16.png │ │ ├── DIE.16.16.png │ │ ├── NFD.16.16.png │ │ ├── TLS.16.16.png │ │ ├── Code.16.16.png │ │ ├── Copy.16.16.png │ │ ├── Data.16.16.png │ │ ├── Debug.16.16.png │ │ ├── Edit.16.16.png │ │ ├── Entry.16.16.png │ │ ├── Exit.16.16.png │ │ ├── File.16.16.png │ │ ├── Goto.16.16.png │ │ ├── Hash.16.16.png │ │ ├── Image.16.16.png │ │ ├── Info.16.16.png │ │ ├── List.16.16.png │ │ ├── Mime.16.16.png │ │ ├── Next.16.16.png │ │ ├── Note.16.16.png │ │ ├── Open.16.16.png │ │ ├── Patch.16.16.png │ │ ├── Path.16.16.png │ │ ├── Reloc.16.16.png │ │ ├── Save.16.16.png │ │ ├── Size.16.16.png │ │ ├── Table.16.16.png │ │ ├── Tool.16.16.png │ │ ├── Value.16.16.png │ │ ├── Yara.16.16.png │ │ ├── Action.16.16.png │ │ ├── Address.16.16.png │ │ ├── Backward.16.16.png │ │ ├── Binary.16.16.png │ │ ├── Bookmark.16.16.png │ │ ├── Demangle.16.16.png │ │ ├── Disasm.16.16.png │ │ ├── DotNet.16.16.png │ │ ├── Download.16.16.png │ │ ├── Entropy.16.16.png │ │ ├── Export.16.16.png │ │ ├── Extract.16.16.png │ │ ├── Follow.16.16.png │ │ ├── Forward.16.16.png │ │ ├── Function.16.16.png │ │ ├── Header.16.16.png │ │ ├── Import.16.16.png │ │ ├── Library.16.16.png │ │ ├── Manifest.16.16.png │ │ ├── Metadata.16.16.png │ │ ├── Offset.16.16.png │ │ ├── Option.16.16.png │ │ ├── Overlay.16.16.png │ │ ├── Refresh.16.16.png │ │ ├── Remove.16.16.png │ │ ├── Resize.16.16.png │ │ ├── Resource.16.16.png │ │ ├── Script.16.16.png │ │ ├── Search.16.16.png │ │ ├── Section.16.16.png │ │ ├── Segment.16.16.png │ │ ├── Select.16.16.png │ │ ├── Shortcut.16.16.png │ │ ├── String.16.16.png │ │ ├── Structs.16.16.png │ │ ├── Symbol.16.16.png │ │ ├── Version.16.16.png │ │ ├── Convertor.16.16.png │ │ ├── Exception.16.16.png │ │ ├── Inspector.16.16.png │ │ ├── MemoryMap.16.16.png │ │ ├── Reference.16.16.png │ │ ├── Signature.16.16.png │ │ ├── Virustotal.16.16.png │ │ ├── Certificate.16.16.png │ │ ├── BreakpointDisabled.16.16.png │ │ └── BreakpointEnabled.16.16.png │ ├── rsrc.qrc │ ├── dialogoptions.ui │ ├── dialogabout.h │ ├── guimainwindow.h │ ├── dialogoptions.h │ ├── main_gui.cpp │ ├── guimainwindow.ui │ ├── dialogoptions.cpp │ ├── CMakeLists.txt │ ├── dialogabout.cpp │ ├── dialogabout.ui │ └── guimainwindow.cpp ├── CMakeLists.txt └── global.h ├── CMakeLists.txt ├── LICENSE └── .gitmodules /README.md: -------------------------------------------------------------------------------- 1 | XBinaryViewer 2 | -------------------------------------------------------------------------------- /release_version.txt: -------------------------------------------------------------------------------- 1 | 0.1.0 -------------------------------------------------------------------------------- /res/readme.txt: -------------------------------------------------------------------------------- 1 | XBinaryViewer 2 | -------------------------------------------------------------------------------- /res/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/res/main.ico -------------------------------------------------------------------------------- /res/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/res/main.png -------------------------------------------------------------------------------- /res/main.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/res/main.icns -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: horsicq 4 | -------------------------------------------------------------------------------- /src/gui/images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/images/about.png -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(XBinaryViewer) 3 | add_subdirectory(src) 4 | -------------------------------------------------------------------------------- /src/gui/icons/Add.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Add.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/All.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/All.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/DIE.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/DIE.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/NFD.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/NFD.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/TLS.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/TLS.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Code.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Code.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Copy.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Copy.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Data.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Data.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Debug.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Debug.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Edit.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Edit.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Entry.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Entry.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Exit.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Exit.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/File.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/File.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Goto.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Goto.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Hash.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Hash.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Image.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Image.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Info.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Info.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/List.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/List.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Mime.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Mime.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Next.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Next.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Note.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Note.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Open.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Open.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Patch.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Patch.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Path.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Path.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Reloc.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Reloc.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Save.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Save.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Size.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Size.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Table.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Table.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Tool.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Tool.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Value.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Value.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Yara.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Yara.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Action.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Action.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Address.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Address.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Backward.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Backward.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Binary.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Binary.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Bookmark.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Bookmark.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Demangle.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Demangle.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Disasm.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Disasm.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/DotNet.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/DotNet.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Download.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Download.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Entropy.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Entropy.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Export.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Export.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Extract.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Extract.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Follow.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Follow.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Forward.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Forward.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Function.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Function.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Header.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Header.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Import.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Import.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Library.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Library.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Manifest.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Manifest.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Metadata.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Metadata.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Offset.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Offset.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Option.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Option.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Overlay.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Overlay.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Refresh.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Refresh.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Remove.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Remove.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Resize.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Resize.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Resource.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Resource.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Script.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Script.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Search.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Search.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Section.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Section.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Segment.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Segment.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Select.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Select.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Shortcut.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Shortcut.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/String.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/String.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Structs.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Structs.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Symbol.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Symbol.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Version.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Version.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Convertor.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Convertor.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Exception.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Exception.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Inspector.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Inspector.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/MemoryMap.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/MemoryMap.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Reference.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Reference.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Signature.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Signature.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Virustotal.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Virustotal.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/Certificate.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/Certificate.16.16.png -------------------------------------------------------------------------------- /src/gui/rsrc.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/about.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/gui/icons/BreakpointDisabled.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/BreakpointDisabled.16.16.png -------------------------------------------------------------------------------- /src/gui/icons/BreakpointEnabled.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XBinaryViewer/master/src/gui/icons/BreakpointEnabled.16.16.png -------------------------------------------------------------------------------- /res/resource.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "windows.manifest.xml" 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION 0,1,0,0 6 | PRODUCTVERSION 0,1,0,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", "ntinfo\0" 22 | VALUE "FileDescription", "XBinaryViewer is a binary viewer\0" 23 | VALUE "FileVersion", "0.1.0.0\0" 24 | VALUE "LegalCopyright", "horsicq@gmail.com\0" 25 | VALUE "OriginalFilename", "xbinaryviewer.exe\0" 26 | VALUE "ProductName", "XBinaryViewer\0" 27 | VALUE "ProductVersion", "0.1.0.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: -------------------------------------------------------------------------------- 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", "XBinaryViewer is a binary viewer\0" 25 | VALUE "FileVersion", "0.1.0.0\0" 26 | VALUE "LegalCopyright", "horsicq@gmail.com\0" 27 | VALUE "OriginalFilename", "xbinaryviewer.exe\0" 28 | VALUE "ProductName", "XBinaryViewer\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 | -------------------------------------------------------------------------------- /res/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | XBinaryViewer 9 | CFBundleGetInfoString 10 | 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.example.xxx 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | 0.1.0 19 | CFBundleName 20 | 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 0.1 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 0.1.0 29 | CSResourcesFileMapped 30 | 31 | NSHumanReadableCopyright 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /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/license.txt: -------------------------------------------------------------------------------- 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/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/gui/dialogoptions.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogOptions 4 | 5 | 6 | Qt::ApplicationModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 568 13 | 585 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/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) 4 | 5 | if(${QT_VERSION_MAJOR} EQUAL 5) 6 | if(${QT_VERSION} VERSION_GREATER_EQUAL 5.6.0) 7 | find_package(Qt5 REQUIRED COMPONENTS Widgets Concurrent Network Script ScriptTools PrintSupport OpenGL Svg Sql LinguistTools) 8 | else() 9 | find_package(Qt5 REQUIRED COMPONENTS Widgets Concurrent Network Script ScriptTools PrintSupport OpenGL Svg Sql) 10 | endif() 11 | endif() 12 | 13 | if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) 14 | find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Concurrent Network PrintSupport OpenGL Svg Sql Qml LinguistTools) 15 | endif() 16 | 17 | file (STRINGS ${CMAKE_CURRENT_LIST_DIR}/../release_version.txt X_PROJECT_VERSION) 18 | project(XBinaryViewer VERSION ${X_PROJECT_VERSION} LANGUAGES CXX) 19 | 20 | set(X_COMPANYNAME "ntinfo") 21 | set(X_PROJECTNAME "XBinaryViewer") 22 | set(X_MAINTAINER "horsicq@gmail.com") 23 | set(X_DESCRIPTION "XBinaryViewer is a binary viewer") 24 | set(X_HOMEPAGE "http://ntinfo.biz") 25 | set(X_ORIGINAL_FILENAME "xbinaryviewer") 26 | 27 | set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.xbinaryviewer) 28 | 29 | include(../dep/build_tools/cmake/deploy_init.cmake) 30 | 31 | message(STATUS X_PROJECT_ARCH: ${X_PROJECT_ARCH}) 32 | 33 | add_subdirectory(../dep/XCppfilt XCppfilt) 34 | add_subdirectory(../dep/XCapstone XCapstone) 35 | add_subdirectory(../dep/XArchive XArchive) 36 | add_subdirectory(../dep/XYara XYara) 37 | add_subdirectory(../dep/Formats/xsimd XSIMD) 38 | add_subdirectory(gui gui_xbinaryviewer) 39 | -------------------------------------------------------------------------------- /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 "XBinaryViewer" 27 | #define X_APPLICATIONNAME "xbinaryviewer" 28 | #define X_APPLICATIONVERSION "0.01" 29 | #define X_ORGANIZATIONNAME "NTInfo" 30 | #define X_ORGANIZATIONDOMAIN "ntinfo.biz" 31 | #define X_OPTIONSFILE "xbinaryviewer.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 | 26 | #include "../global.h" 27 | #include "xoptions.h" 28 | #include "xshortcutsdialog.h" 29 | 30 | namespace Ui { 31 | class DialogAbout; 32 | } 33 | 34 | class DialogAbout : public XShortcutsDialog { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit DialogAbout(QWidget *pParent = nullptr); 39 | ~DialogAbout(); 40 | 41 | virtual void adjustView(); 42 | 43 | private slots: 44 | void on_pushButtonOK_clicked(); 45 | 46 | protected: 47 | virtual void registerShortcuts(bool bState) 48 | { 49 | Q_UNUSED(bState) 50 | } 51 | 52 | private: 53 | Ui::DialogAbout *ui; 54 | }; 55 | 56 | #endif // DIALOGABOUT_H 57 | -------------------------------------------------------------------------------- /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 "xmainwidget.h" 31 | #include "dialogabout.h" 32 | #include "dialogoptions.h" 33 | #include "dialogshortcuts.h" 34 | #include "xinfomenu.h" 35 | #include "xyara.h" // TODO remove 36 | 37 | namespace Ui { 38 | class GuiMainWindow; 39 | } 40 | 41 | class GuiMainWindow : public QMainWindow { 42 | Q_OBJECT 43 | 44 | public: 45 | explicit GuiMainWindow(QWidget *pParent = nullptr); 46 | ~GuiMainWindow(); 47 | 48 | private slots: 49 | void createMenus(); 50 | void actionOpenSlot(); 51 | void actionCloseSlot(); 52 | void actionExitSlot(); 53 | void actionDemangleSlot(); 54 | void actionShortcutsSlot(); 55 | void actionOptionsSlot(); 56 | void actionAboutSlot(); 57 | void adjustView(); 58 | void processFile(const QString &sFileName); 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 | -------------------------------------------------------------------------------- /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 25 | #include 26 | #include 27 | #include 28 | 29 | #include "../global.h" 30 | #include "searchsignaturesoptionswidget.h" 31 | #include "dieoptionswidget.h" 32 | #include "xbinary.h" 33 | #include "xdisasmviewoptionswidget.h" 34 | #include "xhexviewoptionswidget.h" 35 | #include "xinfodboptionswidget.h" 36 | #include "xonlinetoolsoptionswidget.h" 37 | #include "xoptions.h" 38 | #include "xshortcutsdialog.h" 39 | 40 | namespace Ui { 41 | class DialogOptions; 42 | } 43 | 44 | class DialogOptions : public XShortcutsDialog { 45 | Q_OBJECT 46 | 47 | public: 48 | explicit DialogOptions(QWidget *pParent, XOptions *pOptions, XOptions::GROUPID groupId); 49 | ~DialogOptions(); 50 | 51 | virtual void adjustView(); 52 | virtual void setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions); 53 | 54 | protected: 55 | virtual void registerShortcuts(bool bState) 56 | { 57 | Q_UNUSED(bState) 58 | } 59 | 60 | private: 61 | Ui::DialogOptions *ui; 62 | DIEOptionsWidget *g_pDIEOptionsWidget; 63 | SearchSignaturesOptionsWidget *g_pSearchSignaturesOptionsWidget; 64 | XHexViewOptionsWidget *g_pXHexViewOptionsWidget; 65 | XDisasmViewOptionsWidget *g_pXDisasmViewOptionsWidget; 66 | XOnlineToolsOptionsWidget *g_pXOnlineToolsOptionsWidget; 67 | XInfoDBOptionsWidget *g_pXInfoDBOptionsWidget; 68 | }; 69 | 70 | #endif // DIALOGOPTIONS_H 71 | -------------------------------------------------------------------------------- /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 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) 29 | #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 30 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 31 | #endif 32 | #endif 33 | #ifdef Q_OS_MAC 34 | #ifndef QT_DEBUG 35 | QCoreApplication::setLibraryPaths(QStringList(QString(argv[0]).remove("MacOS/XBinaryViewer") + "PlugIns")); 36 | #endif 37 | #endif 38 | QCoreApplication::setOrganizationName(X_ORGANIZATIONNAME); 39 | QCoreApplication::setOrganizationDomain(X_ORGANIZATIONDOMAIN); 40 | QCoreApplication::setApplicationName(X_APPLICATIONNAME); 41 | QCoreApplication::setApplicationVersion(X_APPLICATIONVERSION); 42 | 43 | if ((argc == 2) && ((QString(argv[1]) == "--version") || (QString(argv[1]) == "-v"))) { 44 | QString sInfo = QString("%1 v%2").arg(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION); 45 | printf("%s\n", sInfo.toUtf8().data()); 46 | 47 | return 0; 48 | } 49 | 50 | #ifndef QT_DEBUG 51 | qputenv("QT_LOGGING_RULES", "qt.*=false"); 52 | #endif 53 | 54 | QApplication a(argc, argv); 55 | // TODO set main image 56 | 57 | XOptions xOptions; 58 | 59 | xOptions.setName(X_OPTIONSFILE); 60 | 61 | xOptions.addID(XOptions::ID_VIEW_LANG, "System"); 62 | xOptions.addID(XOptions::ID_VIEW_QSS); 63 | xOptions.addID(XOptions::ID_VIEW_STYLE, "Fusion"); 64 | 65 | xOptions.load(); 66 | 67 | XOptions::adjustApplicationView(X_APPLICATIONNAME, &xOptions); 68 | 69 | GuiMainWindow w; 70 | w.show(); 71 | 72 | return a.exec(); 73 | } 74 | -------------------------------------------------------------------------------- /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 | 41 | 42 | 43 | 44 | 45 | 46 | :/pics/logo.png 47 | 48 | 49 | Qt::AlignmentFlag::AlignCenter 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 0 59 | 60 | 61 | 0 62 | 63 | 64 | 0 65 | 66 | 67 | 0 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 0 82 | 0 83 | 835 84 | 22 85 | 86 | 87 | 88 | 89 | 90 | 91 | XMainWidget 92 | QWidget 93 |
xmainwidget.h
94 | 1 95 |
96 |
97 | 98 | 99 |
100 | -------------------------------------------------------------------------------- /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, XOptions::GROUPID groupId) : XShortcutsDialog(pParent), ui(new Ui::DialogOptions) 26 | { 27 | ui->setupUi(this); 28 | 29 | g_pDIEOptionsWidget = new DIEOptionsWidget(this); 30 | g_pSearchSignaturesOptionsWidget = new SearchSignaturesOptionsWidget(this); 31 | g_pXHexViewOptionsWidget = new XHexViewOptionsWidget(this); 32 | g_pXDisasmViewOptionsWidget = new XDisasmViewOptionsWidget(this); 33 | g_pXOnlineToolsOptionsWidget = new XOnlineToolsOptionsWidget(this); 34 | g_pXInfoDBOptionsWidget = new XInfoDBOptionsWidget(this); 35 | 36 | ui->widgetOptions->setOptions(pOptions, X_APPLICATIONDISPLAYNAME); 37 | 38 | ui->widgetOptions->addPage(g_pDIEOptionsWidget, tr("Scan")); 39 | g_pDIEOptionsWidget->setOptions(pOptions); 40 | 41 | ui->widgetOptions->addPage(g_pSearchSignaturesOptionsWidget, tr("Signatures")); 42 | g_pSearchSignaturesOptionsWidget->setOptions(pOptions); 43 | 44 | ui->widgetOptions->addPage(g_pXHexViewOptionsWidget, tr("Hex")); 45 | g_pXHexViewOptionsWidget->setOptions(pOptions); 46 | 47 | ui->widgetOptions->addPage(g_pXDisasmViewOptionsWidget, tr("Disasm")); 48 | g_pXDisasmViewOptionsWidget->setOptions(pOptions); 49 | 50 | ui->widgetOptions->addPage(g_pXOnlineToolsOptionsWidget, tr("Online tools")); 51 | g_pXOnlineToolsOptionsWidget->setOptions(pOptions); 52 | 53 | ui->widgetOptions->addPage(g_pXInfoDBOptionsWidget, tr("Info")); 54 | g_pXInfoDBOptionsWidget->setOptions(pOptions); 55 | 56 | ui->widgetOptions->setCurrentPage(groupId); 57 | } 58 | 59 | DialogOptions::~DialogOptions() 60 | { 61 | delete ui; 62 | } 63 | 64 | void DialogOptions::adjustView() 65 | { 66 | ui->widgetOptions->adjustView(); 67 | } 68 | 69 | void DialogOptions::setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions) 70 | { 71 | XShortcutsDialog::setGlobal(pShortcuts, pXOptions); 72 | ui->widgetOptions->setGlobal(pShortcuts, pXOptions); 73 | } 74 | -------------------------------------------------------------------------------- /.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/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | project(XBinaryViewer VERSION ${X_PROJECT_VERSION} LANGUAGES CXX) 4 | 5 | include(../../dep/build_tools/cmake/cpp_standart_setup.cmake) 6 | 7 | add_definitions(-DUSE_DEX) 8 | add_definitions(-DUSE_PDF) 9 | add_definitions(-DUSE_ARCHIVE) 10 | add_definitions(-DUSE_YARA) 11 | add_definitions(-DUSE_XSIMD) 12 | 13 | if(WIN32) 14 | add_definitions(-DNOMINMAX) 15 | endif() 16 | 17 | if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") 18 | include(../../dep/build_tools/cmake/init_translation.cmake) 19 | endif() 20 | 21 | include(${CMAKE_CURRENT_LIST_DIR}/../../dep/FormatWidgets/XAbstractWidgets/xformatwidget.cmake) 22 | include(${CMAKE_CURRENT_LIST_DIR}/../../dep/XAboutWidget/xaboutwidget.cmake) 23 | include(${CMAKE_CURRENT_LIST_DIR}/../../dep/XStyles/xstyles.cmake) 24 | 25 | set(PROJECT_SOURCES 26 | ${XFORMATWIDGET_SOURCES} 27 | ${XABOUTWIDGET_SOURCES} 28 | ${XSTYLES_SOURCES} 29 | dialogabout.cpp 30 | dialogabout.h 31 | dialogabout.ui 32 | dialogoptions.cpp 33 | dialogoptions.h 34 | dialogoptions.ui 35 | main_gui.cpp 36 | guimainwindow.cpp 37 | guimainwindow.h 38 | guimainwindow.ui 39 | rsrc.qrc 40 | ) 41 | 42 | if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") 43 | include(../../dep/build_tools/cmake/create_translation.cmake) 44 | endif() 45 | 46 | if(WIN32) 47 | add_executable(XBinaryViewer 48 | WIN32 49 | ${PROJECT_SOURCES} 50 | ${QM_FILES} 51 | ../../res/resource_icon.rc 52 | ) 53 | elseif(APPLE) 54 | add_executable(XBinaryViewer 55 | MACOSX_BUNDLE 56 | ${PROJECT_SOURCES} 57 | ${QM_FILES} 58 | ) 59 | 60 | set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/../../res/main.icns PROPERTIES 61 | MACOSX_PACKAGE_LOCATION "Resources") 62 | target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../res/main.icns) 63 | 64 | else() 65 | add_executable(XBinaryViewer 66 | ${PROJECT_SOURCES} 67 | ${QM_FILES} 68 | ) 69 | endif() 70 | 71 | if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") 72 | if(APPLE) 73 | include(../../dep/build_tools/cmake/macdeployqt.cmake) 74 | endif() 75 | endif() 76 | 77 | target_link_libraries(XBinaryViewer PRIVATE bzip2) 78 | target_link_libraries(XBinaryViewer PRIVATE lzma) 79 | target_link_libraries(XBinaryViewer PRIVATE zlib) 80 | target_link_libraries(XBinaryViewer PRIVATE ppmd) 81 | target_link_libraries(XBinaryViewer PRIVATE capstone) 82 | target_link_libraries(XBinaryViewer PRIVATE cppfilt) 83 | target_link_libraries(XBinaryViewer PRIVATE yara) 84 | target_link_libraries(XBinaryViewer PRIVATE xsimd) 85 | 86 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) 87 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::Concurrent) 88 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::Network) 89 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::PrintSupport) 90 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::OpenGL) 91 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::Svg) 92 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::Sql) 93 | 94 | if(${QT_VERSION_MAJOR} EQUAL 5) 95 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::Script) 96 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::ScriptTools) 97 | endif() 98 | 99 | if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) 100 | target_link_libraries(XBinaryViewer PRIVATE Qt${QT_VERSION_MAJOR}::Qml) 101 | endif() 102 | 103 | if(WIN32) 104 | target_link_libraries(XBinaryViewer PRIVATE Wintrust) 105 | target_link_libraries(XBinaryViewer PRIVATE Crypt32) 106 | endif() 107 | 108 | find_package(Threads REQUIRED) 109 | target_link_libraries(XBinaryViewer PRIVATE Threads::Threads) 110 | 111 | if(WIN32) 112 | install (TARGETS XBinaryViewer DESTINATION "./") 113 | include(../../dep/build_tools/cmake/deploy_qt_windows.cmake) 114 | include(../../dep/build_tools/cmake/deploy_msvc.cmake) 115 | include(../../dep/build_tools/cmake/deploy_openssl.cmake) 116 | elseif(APPLE) 117 | install(TARGETS XBinaryViewer 118 | BUNDLE DESTINATION . 119 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 120 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 121 | ) 122 | else() 123 | install (TARGETS XBinaryViewer DESTINATION ${CMAKE_INSTALL_BINDIR}) 124 | endif() 125 | -------------------------------------------------------------------------------- /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) : XShortcutsDialog(pParent), ui(new Ui::DialogAbout) 26 | { 27 | ui->setupUi(this); 28 | 29 | setWindowFlags(Qt::Window); 30 | 31 | ui->labelVersion->setText(QString("%1").arg(XOptions::getTitle(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION))); 32 | 33 | ui->labelBugreports->setText( 34 | QString("

%1: horsicq@gmail.com

") 36 | .arg(tr("Bugreports"))); 37 | ui->labelWebsite->setText( 38 | QString("

%1: http://ntinfo.biz

") 40 | .arg(tr("Website"))); 41 | ui->labelDonate->setText(QString("

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

") 43 | .arg(tr("Donate"))); 44 | ui->labelSourceCode->setText( 45 | QString("

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

") 47 | .arg(tr("Source code"))); 48 | ui->labelThanks->setText( 49 | QString("" 50 | "

%1:

" 51 | "

" 52 | "Fernando Mercês, " 53 | "David Zimmer, " 54 | "misonothx, " 55 | "

" 56 | "

" 57 | "FrenchYeti, " 58 | "fr0zenbag, " 59 | "Anderson Leite, " 60 | "

" 61 | "

" 62 | "Filip Navara, " 63 | "Ali Hadi, " 64 | "Duncan Ogilvie, " 65 | "

" 66 | "

" 67 | "Leandro Fróes, " 68 | "phithon, " 69 | "Christopher Layne, " 70 | "

" 71 | "

" 72 | "Adric Net, " 73 | "Gilad Reich" 74 | "

" 75 | "") 76 | .arg(tr("Thanks"))); 77 | } 78 | 79 | DialogAbout::~DialogAbout() 80 | { 81 | delete ui; 82 | } 83 | 84 | void DialogAbout::adjustView() 85 | { 86 | // TODO 87 | } 88 | 89 | void DialogAbout::on_pushButtonOK_clicked() 90 | { 91 | this->close(); 92 | } 93 | -------------------------------------------------------------------------------- /.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/XHandlesWidget"] 95 | path = dep/XHandlesWidget 96 | url = https://github.com/horsicq/XHandlesWidget 97 | [submodule "dep/XHashWidget"] 98 | path = dep/XHashWidget 99 | url = https://github.com/horsicq/XHashWidget 100 | [submodule "dep/XHexEdit"] 101 | path = dep/XHexEdit 102 | url = https://github.com/horsicq/XHexEdit 103 | [submodule "dep/XHexView"] 104 | path = dep/XHexView 105 | url = https://github.com/horsicq/XHexView 106 | [submodule "dep/XInfoDB"] 107 | path = dep/XInfoDB 108 | url = https://github.com/horsicq/XInfoDB 109 | [submodule "dep/XLLVMDemangler"] 110 | path = dep/XLLVMDemangler 111 | url = https://github.com/horsicq/XLLVMDemangler 112 | [submodule "dep/XLog"] 113 | path = dep/XLog 114 | url = https://github.com/horsicq/XLog 115 | [submodule "dep/XMemoryMapWidget"] 116 | path = dep/XMemoryMapWidget 117 | url = https://github.com/horsicq/XMemoryMapWidget 118 | [submodule "dep/XOnlineTools"] 119 | path = dep/XOnlineTools 120 | url = https://github.com/horsicq/XOnlineTools 121 | [submodule "dep/XOptions"] 122 | path = dep/XOptions 123 | url = https://github.com/horsicq/XOptions 124 | [submodule "dep/XPDF"] 125 | path = dep/XPDF 126 | url = https://github.com/horsicq/XPDF 127 | [submodule "dep/XQwt"] 128 | path = dep/XQwt 129 | url = https://github.com/horsicq/XQwt 130 | [submodule "dep/XShortcuts"] 131 | path = dep/XShortcuts 132 | url = https://github.com/horsicq/XShortcuts 133 | [submodule "dep/XStyles"] 134 | path = dep/XStyles 135 | url = https://github.com/horsicq/XStyles 136 | [submodule "dep/XSymbolsWidget"] 137 | path = dep/XSymbolsWidget 138 | url = https://github.com/horsicq/XSymbolsWidget 139 | [submodule "dep/XTranslation"] 140 | path = dep/XTranslation 141 | url = https://github.com/horsicq/XTranslation 142 | [submodule "dep/XUpdate"] 143 | path = dep/XUpdate 144 | url = https://github.com/horsicq/XUpdate 145 | [submodule "dep/XVisualizationWidget"] 146 | path = dep/XVisualizationWidget 147 | url = https://github.com/horsicq/XVisualizationWidget 148 | [submodule "dep/XYara"] 149 | path = dep/XYara 150 | url = https://github.com/horsicq/XYara 151 | [submodule "dep/yara_widget"] 152 | path = dep/yara_widget 153 | url = https://github.com/horsicq/yara_widget 154 | [submodule "dep/XDataConvertorWidget"] 155 | path = dep/XDataConvertorWidget 156 | url = https://github.com/horsicq/XDataConvertorWidget 157 | [submodule "dep/XScanEngine"] 158 | path = dep/XScanEngine 159 | url = https://github.com/horsicq/XScanEngine 160 | [submodule "dep/XDisasmCore"] 161 | path = dep/XDisasmCore 162 | url = https://github.com/horsicq/XDisasmCore.git 163 | [submodule "dep/XRegionsWidget"] 164 | path = dep/XRegionsWidget 165 | url = https://github.com/horsicq/XRegionsWidget.git 166 | [submodule "dep/XStaticUnpacker"] 167 | path = dep/XStaticUnpacker 168 | url = https://github.com/horsicq/XStaticUnpacker 169 | -------------------------------------------------------------------------------- /src/gui/dialogabout.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogAbout 4 | 5 | 6 | Qt::WindowModality::ApplicationModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 883 13 | 585 14 | 15 | 16 | 17 | About 18 | 19 | 20 | true 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 308 30 | 235 31 | 32 | 33 | 34 | 35 | 36 | 37 | :/pics/logo.png 38 | 39 | 40 | Qt::AlignmentFlag::AlignCenter 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | XELFViewer 50 | 51 | 52 | Qt::AlignmentFlag::AlignCenter 53 | 54 | 55 | 56 | 57 | 58 | 59 | <html><head/><body><p><span style=" font-weight:700;">Copyright(C) 2019-2025 hors</span></p></body></html> 60 | 61 | 62 | Qt::AlignmentFlag::AlignCenter 63 | 64 | 65 | 66 | 67 | 68 | 69 | <html><head/><body><p><span style=" font-weight:600;">Bugreports</span>: <a href="mailto:horsicq@gmail.com"><span style=" text-decoration: underline; color:#ff0000;">horsicq@gmail.com</span></a></p></body></html> 70 | 71 | 72 | Qt::AlignmentFlag::AlignCenter 73 | 74 | 75 | true 76 | 77 | 78 | 79 | 80 | 81 | 82 | <html><head/><body><p><span style=" font-weight:600;">Website</span>: <a href="http://ntinfo.biz"><span style=" text-decoration: underline; color:#ff0000;">http://ntinfo.biz</span></a></p></body></html> 83 | 84 | 85 | Qt::AlignmentFlag::AlignCenter 86 | 87 | 88 | true 89 | 90 | 91 | 92 | 93 | 94 | 95 | <html><head/><body><p><span style=" font-weight:600;">Donate(Paypal): </span><a href="mailto:ntinfo.re@gmail.com"><span style=" text-decoration: underline; color:#ff0000;">ntinfo.re@gmail.com</span></a></p></body></html> 96 | 97 | 98 | Qt::AlignmentFlag::AlignCenter 99 | 100 | 101 | true 102 | 103 | 104 | 105 | 106 | 107 | 108 | <html><head/><body><p><span style=" font-weight:600;">Source code: </span><a href="https://github.com/horsicq/XELFViewer"><span style=" text-decoration: underline; color:#ff0000;">https://github.com/horsicq/XELFViewer</span></a></p></body></html> 109 | 110 | 111 | Qt::AlignmentFlag::AlignCenter 112 | 113 | 114 | true 115 | 116 | 117 | 118 | 119 | 120 | 121 | Thanks 122 | 123 | 124 | Qt::TextFormat::AutoText 125 | 126 | 127 | true 128 | 129 | 130 | 131 | 132 | 133 | 134 | Qt::Orientation::Vertical 135 | 136 | 137 | 138 | 20 139 | 40 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | Qt::Orientation::Horizontal 154 | 155 | 156 | 157 | 40 158 | 20 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | OK 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | -------------------------------------------------------------------------------- /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 | #ifdef USE_XSIMD 30 | xsimd_init(); 31 | #endif 32 | 33 | XYara::initialize(); 34 | 35 | g_pFile = nullptr; 36 | g_pXInfo = nullptr; 37 | 38 | ui->stackedWidget->setCurrentIndex(0); 39 | 40 | setWindowTitle(XOptions::getTitle(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION)); 41 | 42 | setAcceptDrops(true); 43 | 44 | g_xOptions.setName(X_OPTIONSFILE); 45 | 46 | g_xOptions.addID(XOptions::ID_VIEW_STYLE, "Fusion"); 47 | g_xOptions.addID(XOptions::ID_VIEW_QSS, ""); 48 | g_xOptions.addID(XOptions::ID_VIEW_LANG, "System"); 49 | g_xOptions.addID(XOptions::ID_VIEW_FONT_CONTROLS, XOptions::getDefaultFont().toString()); 50 | g_xOptions.addID(XOptions::ID_VIEW_FONT_TABLEVIEWS, XOptions::getMonoFont().toString()); 51 | g_xOptions.addID(XOptions::ID_VIEW_FONT_TREEVIEWS, XOptions::getDefaultFont().toString()); 52 | g_xOptions.addID(XOptions::ID_VIEW_FONT_TEXTEDITS, XOptions::getMonoFont().toString()); 53 | g_xOptions.addID(XOptions::ID_VIEW_STAYONTOP, false); 54 | g_xOptions.addID(XOptions::ID_VIEW_SHOWLOGO, false); 55 | g_xOptions.addID(XOptions::ID_FILE_SAVELASTDIRECTORY, true); 56 | g_xOptions.addID(XOptions::ID_FILE_SAVEBACKUP, true); 57 | g_xOptions.addID(XOptions::ID_FILE_SAVERECENTFILES, true); 58 | 59 | g_xOptions.addID(XOptions::ID_FEATURE_READBUFFERSIZE, 8 * 1024); 60 | g_xOptions.addID(XOptions::ID_FEATURE_FILEBUFFERSIZE, 2 * 1024 * 1024); 61 | 62 | #ifdef USE_XSIMD 63 | #ifdef Q_PROCESSOR_X86 64 | g_xOptions.addID(XOptions::ID_FEATURE_SSE2, true); 65 | g_xOptions.addID(XOptions::ID_FEATURE_AVX, true); 66 | g_xOptions.addID(XOptions::ID_FEATURE_AVX2, true); 67 | #endif 68 | #endif 69 | 70 | #ifdef Q_OS_WIN 71 | g_xOptions.addID(XOptions::ID_FILE_CONTEXT, "*"); 72 | #endif 73 | 74 | DIEOptionsWidget::setDefaultValues(&g_xOptions); 75 | SearchSignaturesOptionsWidget::setDefaultValues(&g_xOptions); 76 | XHexViewOptionsWidget::setDefaultValues(&g_xOptions); 77 | XDisasmViewOptionsWidget::setDefaultValues(&g_xOptions); 78 | XOnlineToolsOptionsWidget::setDefaultValues(&g_xOptions); 79 | XInfoDBOptionsWidget::setDefaultValues(&g_xOptions); 80 | 81 | g_xOptions.addID(XOptions::ID_SCAN_YARARULESPATH, "$data/yara_rules"); 82 | 83 | g_xOptions.load(); 84 | 85 | g_xShortcuts.setName(X_SHORTCUTSFILE); 86 | g_xShortcuts.setNative(g_xOptions.isNative()); 87 | 88 | g_xShortcuts.addGroup(XShortcuts::GROUPID_HEX); 89 | g_xShortcuts.addGroup(XShortcuts::GROUPID_DISASM); 90 | g_xShortcuts.addGroup(XShortcuts::GROUPID_TABLE); 91 | 92 | g_xShortcuts.load(); 93 | 94 | g_pInfoMenu = new XInfoMenu(&g_xShortcuts, &g_xOptions); 95 | 96 | ui->widgetViewer->setGlobal(&g_xShortcuts, &g_xOptions); 97 | 98 | connect(&g_xOptions, SIGNAL(openFile(QString)), this, SLOT(processFile(QString))); 99 | 100 | createMenus(); 101 | 102 | adjustView(); 103 | 104 | if (QCoreApplication::arguments().count() > 1) { 105 | QString sFileName = QCoreApplication::arguments().at(1); 106 | 107 | processFile(sFileName); 108 | } 109 | } 110 | 111 | GuiMainWindow::~GuiMainWindow() 112 | { 113 | closeCurrentFile(); 114 | g_xOptions.save(); 115 | g_xShortcuts.save(); 116 | 117 | delete g_pInfoMenu; 118 | delete ui; 119 | 120 | XYara::finalize(); 121 | 122 | #ifdef USE_XSIMD 123 | xsimd_cleanup(); 124 | #endif 125 | } 126 | 127 | void GuiMainWindow::createMenus() 128 | { 129 | QMenu *pMenuFile = new QMenu(tr("File"), ui->menubar); 130 | QMenu *pMenuTools = new QMenu(tr("Tools"), ui->menubar); 131 | QMenu *pMenuHelp = new QMenu(tr("Help"), ui->menubar); 132 | 133 | ui->menubar->addAction(pMenuFile->menuAction()); 134 | ui->menubar->addAction(pMenuTools->menuAction()); 135 | ui->menubar->addAction(pMenuHelp->menuAction()); 136 | 137 | QAction *pActionOpen = new QAction(tr("Open"), this); 138 | QAction *pActionClose = new QAction(tr("Close"), this); 139 | QAction *pActionExit = new QAction(tr("Exit"), this); 140 | QAction *pActionOptions = new QAction(tr("Options"), this); 141 | QAction *pActionAbout = new QAction(tr("About"), this); 142 | QAction *pActionShortcuts = new QAction(tr("Shortcuts"), this); 143 | QAction *pActionDemangle = new QAction(tr("Demangle"), this); 144 | 145 | pMenuFile->addAction(pActionOpen); 146 | pMenuFile->addMenu(g_xOptions.createRecentFilesMenu(this)); 147 | pMenuFile->addMenu(g_pInfoMenu->createMenu(this)); 148 | pMenuFile->addAction(pActionClose); 149 | pMenuFile->addAction(pActionExit); 150 | pMenuTools->addAction(pActionDemangle); 151 | pMenuTools->addAction(pActionShortcuts); 152 | pMenuTools->addAction(pActionOptions); 153 | pMenuHelp->addAction(pActionAbout); 154 | 155 | connect(pActionOpen, SIGNAL(triggered()), this, SLOT(actionOpenSlot())); 156 | connect(pActionClose, SIGNAL(triggered()), this, SLOT(actionCloseSlot())); 157 | connect(pActionExit, SIGNAL(triggered()), this, SLOT(actionExitSlot())); 158 | connect(pActionOptions, SIGNAL(triggered()), this, SLOT(actionOptionsSlot())); 159 | connect(pActionAbout, SIGNAL(triggered()), this, SLOT(actionAboutSlot())); 160 | connect(pActionShortcuts, SIGNAL(triggered()), this, SLOT(actionShortcutsSlot())); 161 | connect(pActionDemangle, SIGNAL(triggered()), this, SLOT(actionDemangleSlot())); 162 | } 163 | 164 | void GuiMainWindow::actionOpenSlot() 165 | { 166 | QString sDirectory = g_xOptions.getLastDirectory(); 167 | 168 | QString sFileName = QFileDialog::getOpenFileName(this, tr("Open file") + QString("..."), sDirectory, tr("All files") + QString(" (*)")); 169 | 170 | if (!sFileName.isEmpty()) { 171 | processFile(sFileName); 172 | } 173 | } 174 | 175 | void GuiMainWindow::actionCloseSlot() 176 | { 177 | closeCurrentFile(); 178 | } 179 | 180 | void GuiMainWindow::actionExitSlot() 181 | { 182 | this->close(); 183 | } 184 | 185 | void GuiMainWindow::actionOptionsSlot() 186 | { 187 | DialogOptions dialogOptions(this, &g_xOptions, XOptions::GROUPID_FILE); 188 | dialogOptions.setGlobal(&g_xShortcuts, &g_xOptions); 189 | dialogOptions.exec(); 190 | 191 | adjustView(); 192 | } 193 | 194 | void GuiMainWindow::actionAboutSlot() 195 | { 196 | DialogAbout dialogAbout(this); 197 | dialogAbout.setGlobal(&g_xShortcuts, &g_xOptions); 198 | dialogAbout.exec(); 199 | } 200 | 201 | void GuiMainWindow::adjustView() 202 | { 203 | ui->widgetViewer->adjustView(); 204 | 205 | g_xOptions.adjustStayOnTop(this); 206 | g_xOptions.adjustWidget(this, XOptions::ID_VIEW_FONT_CONTROLS); 207 | 208 | if (g_xOptions.isShowLogo()) { 209 | ui->labelLogo->show(); 210 | } else { 211 | ui->labelLogo->hide(); 212 | } 213 | } 214 | 215 | void GuiMainWindow::processFile(const QString &sFileName) 216 | { 217 | if ((sFileName != "") && (QFileInfo(sFileName).isFile())) { 218 | g_xOptions.setLastFileName(sFileName); 219 | 220 | closeCurrentFile(); 221 | 222 | g_pFile = new QFile; 223 | g_pXInfo = new XInfoDB; 224 | 225 | g_pFile->setFileName(sFileName); 226 | 227 | if (!g_pFile->open(QIODevice::ReadWrite)) { 228 | if (!g_pFile->open(QIODevice::ReadOnly)) { 229 | closeCurrentFile(); 230 | } 231 | } 232 | 233 | // if (!g_pFile->open(QIODevice::ReadOnly)) { 234 | // closeCurrentFile(); 235 | // } 236 | 237 | if (g_pFile) { 238 | XBinary xbinary(g_pFile); 239 | if (xbinary.isValid()) { 240 | g_pInfoMenu->setData(g_pXInfo, g_pFile, sFileName + ".db"); 241 | g_pInfoMenu->tryToLoad(); 242 | 243 | // XFW_DEF::OPTIONS formatOptions = {}; 244 | 245 | // formatOptions.bIsImage = false; 246 | // formatOptions.nImageBase = -1; 247 | // formatOptions.vmode = XFW_DEF::VMODE_FILETYPE; 248 | // // formatOptions.nStartType = SBINARY::TYPE_INFO; 249 | XMainWidget::OPTIONS formatOptions = {}; 250 | formatOptions.bIsImage = false; 251 | formatOptions.nImageBase = -1; 252 | formatOptions.bGlobalHexEnable = true; 253 | 254 | ui->widgetViewer->setData(g_pFile, g_pXInfo, formatOptions); 255 | 256 | ui->widgetViewer->reload(); 257 | 258 | adjustView(); 259 | 260 | setWindowTitle(sFileName); 261 | ui->stackedWidget->setCurrentIndex(1); 262 | } else { 263 | QMessageBox::critical(this, tr("Error"), tr("It is not a valid file")); 264 | } 265 | } else { 266 | QMessageBox::critical(this, tr("Error"), tr("Cannot open file")); 267 | } 268 | } else { 269 | QMessageBox::critical(this, tr("Error"), tr("Cannot open file")); 270 | } 271 | } 272 | 273 | void GuiMainWindow::closeCurrentFile() 274 | { 275 | if (g_pXInfo) { 276 | g_pInfoMenu->tryToSave(); 277 | 278 | delete g_pXInfo; 279 | g_pXInfo = nullptr; 280 | g_pInfoMenu->reset(); 281 | } 282 | 283 | if (g_pFile) { 284 | g_pFile->close(); 285 | delete g_pFile; 286 | g_pFile = nullptr; 287 | } 288 | 289 | ui->stackedWidget->setCurrentIndex(0); 290 | ui->widgetViewer->cleanup(); 291 | 292 | setWindowTitle(XOptions::getTitle(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION)); 293 | } 294 | 295 | void GuiMainWindow::dragEnterEvent(QDragEnterEvent *pEvent) 296 | { 297 | pEvent->acceptProposedAction(); 298 | } 299 | 300 | void GuiMainWindow::dragMoveEvent(QDragMoveEvent *pEvent) 301 | { 302 | pEvent->acceptProposedAction(); 303 | } 304 | 305 | void GuiMainWindow::dropEvent(QDropEvent *pEvent) 306 | { 307 | const QMimeData *mimeData = pEvent->mimeData(); 308 | 309 | if (mimeData->hasUrls()) { 310 | QList urlList = mimeData->urls(); 311 | 312 | if (urlList.count()) { 313 | QString sFileName = urlList.at(0).toLocalFile(); 314 | 315 | sFileName = XBinary::convertFileName(sFileName); 316 | 317 | processFile(sFileName); 318 | } 319 | } 320 | } 321 | 322 | void GuiMainWindow::actionShortcutsSlot() 323 | { 324 | DialogShortcuts dialogShortcuts(this); 325 | dialogShortcuts.setGlobal(&g_xShortcuts, &g_xOptions); 326 | dialogShortcuts.setData(&g_xShortcuts); 327 | 328 | dialogShortcuts.exec(); 329 | 330 | adjustView(); 331 | } 332 | 333 | void GuiMainWindow::actionDemangleSlot() 334 | { 335 | DialogDemangle dialogDemangle(this); 336 | dialogDemangle.setGlobal(&g_xShortcuts, &g_xOptions); 337 | 338 | dialogDemangle.exec(); 339 | } 340 | --------------------------------------------------------------------------------