mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 00:10:02 -05:00
feat: Added various custom built-in types to the pattern language (#1991)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <imgui.h>
|
||||
|
||||
#include <capstone/capstone.h>
|
||||
#include <content/helpers/disassembler.hpp>
|
||||
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
@@ -23,13 +24,12 @@ namespace hex::plugin::disasm {
|
||||
if (shouldReset) {
|
||||
auto pattern = arguments[0].toPattern();
|
||||
auto baseAddress = arguments[1].toUnsigned();
|
||||
auto architecture = arguments[2].toUnsigned();
|
||||
auto mode = arguments[3].toUnsigned();
|
||||
const auto [arch, mode] = Disassembler::stringToSettings(arguments[2].toString());
|
||||
|
||||
disassembly.clear();
|
||||
|
||||
csh capstone;
|
||||
if (cs_open(static_cast<cs_arch>(architecture), static_cast<cs_mode>(mode), &capstone) == CS_ERR_OK) {
|
||||
if (cs_open(arch, mode, &capstone) == CS_ERR_OK) {
|
||||
cs_option(capstone, CS_OPT_SKIPDATA, CS_OPT_ON);
|
||||
|
||||
auto data = pattern->getBytes();
|
||||
|
||||
Reference in New Issue
Block a user