mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
Following the documentation (which is not being updated for this type) on using `hex::type::Instruction` fails to produce any patterns regardless of how you format the string that is passed to capstone to select architecture and options. The error is traced back to mishandling the input string so that the correct parts are not selected properly. Rather than manually selecting the parts of the input string from the result of find it is much simpler to use splitString() (which uses find internally) and does all the work for us with fewer chances for errors. There are still problems. The resulting string for the formatter doesn't return the disassembled instruction and prints the variable name with the @ used to place it. To view the instruction you need to unseal the pattern and open the child which then shows the instruction. That only happens after this fix has been applied.