1
0
mirror of synced 2024-11-15 11:33:23 +01:00
ImHex/source/main.cpp
WerWolv 31e5ec7bc3
Add Yara rule matching interface (#178)
* build: Added YARA as submodule

* ui: Added basic yara rules matching interface

* build: Make libyara link libpthread on Unix

* ui: Add jump-to feature to yara matches list

* yara: Add more modules and patch yara to support mbedtls crypto

* yara: Started to fix scanning of bigger data

* yara: Fixed implementation

* ui: Improved yara matcher interface and added localization

* build: Ignore changed files in yara submodule

* yara: Fixed rules matching agianst entire file

* yara: Properly handle compiler errors
2021-02-26 13:35:19 +01:00

63 lines
1.9 KiB
C++

#include <hex.hpp>
#include "window.hpp"
#include <hex/api/content_registry.hpp>
#include <hex/providers/provider.hpp>
#include <hex/lang/pattern_data.hpp>
#include <hex/helpers/utils.hpp>
#include "views/view_hexeditor.hpp"
#include "views/view_pattern.hpp"
#include "views/view_pattern_data.hpp"
#include "views/view_hashes.hpp"
#include "views/view_information.hpp"
#include "views/view_help.hpp"
#include "views/view_tools.hpp"
#include "views/view_strings.hpp"
#include "views/view_data_inspector.hpp"
#include "views/view_disassembler.hpp"
#include "views/view_bookmarks.hpp"
#include "views/view_patches.hpp"
#include "views/view_command_palette.hpp"
#include "views/view_settings.hpp"
#include "views/view_data_processor.hpp"
#include "views/view_yara.hpp"
#include <vector>
int main(int argc, char **argv) {
using namespace hex;
Window window(argc, argv);
// Shared Data
std::vector<lang::PatternData*> patternData;
// Create views
ContentRegistry::Views::add<ViewHexEditor>(patternData);
ContentRegistry::Views::add<ViewPattern>(patternData);
ContentRegistry::Views::add<ViewPatternData>(patternData);
ContentRegistry::Views::add<ViewDataInspector>();
ContentRegistry::Views::add<ViewHashes>();
ContentRegistry::Views::add<ViewInformation>();
ContentRegistry::Views::add<ViewStrings>();
ContentRegistry::Views::add<ViewDisassembler>();
ContentRegistry::Views::add<ViewBookmarks>();
ContentRegistry::Views::add<ViewPatches>();
ContentRegistry::Views::add<ViewTools>();
ContentRegistry::Views::add<ViewCommandPalette>();
ContentRegistry::Views::add<ViewHelp>();
ContentRegistry::Views::add<ViewSettings>();
ContentRegistry::Views::add<ViewDataProcessor>();
ContentRegistry::Views::add<ViewYara>();
if (argc > 1)
View::postEvent(Events::FileDropped, argv[1]);
window.loop();
return EXIT_SUCCESS;
}