966f3b8597
* sys: Initial effort to replace existing project files with a better system * sys: Added back marking provider as dirty * sys: Remove git commit information from project files * sys: Format data processor save file nicely * fix: Automatic pattern loading not working correctly * ui: Added warning popup when closing a provider with modifications Closes #604 * sys: Fixed build issues * tests: Removed useless debug logs * patterns: Updated pattern language * sys: Added log message when crashing with a signal * sys: Make sure abnormal termination handlers are being called more reliably
22 lines
679 B
C++
22 lines
679 B
C++
#include <hex/api/content_registry.hpp>
|
|
#include <hex/providers/provider.hpp>
|
|
|
|
#include <pl/core/evaluator.hpp>
|
|
|
|
namespace hex::plugin::builtin {
|
|
|
|
void registerPatternLanguagePragmas() {
|
|
|
|
ContentRegistry::PatternLanguage::addPragma("base_address", [](pl::PatternLanguage &runtime, const std::string &value) {
|
|
hex::unused(runtime);
|
|
|
|
auto baseAddress = strtoull(value.c_str(), nullptr, 0);
|
|
|
|
ImHexApi::Provider::get()->setBaseAddress(baseAddress);
|
|
return true;
|
|
});
|
|
|
|
ContentRegistry::PatternLanguage::addPragma("MIME", [](pl::PatternLanguage&, const std::string &value) { return !value.empty(); });
|
|
}
|
|
|
|
} |