WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
44.81k stars 1.95k forks source link

no function named 'nextAfter' found #162

Closed callym closed 3 years ago

callym commented 3 years ago

Hi, I've built from the master branch (df06dd49c571e00828859a7571d3a3939cd67cfa), and pulled from https://github.com/WerWolv/ImHex-Patterns, opened the pe.hexpat pattern file, and get the error that nextAfter isn't found.

I also tried with print, which looks like it's an older function? and I get the same result, so not sure if the pattern editor is finding any functions at all for some reason?

If I comment out the last two lines in the pattern file, it works fine, if I replace the @ nextAfter("peHeader.dosHeader.coffHeaderPointer"); with @ [the raw value found by hand], it also works fine.

I'm not really sure if there's logs or debugging or anything I should attach to this issue, or if I'm just using the pattern files in the wrong way?

WerWolv commented 3 years ago

Hi! Are you on Linux by chance? Currently there's an issue in the build system that causes default plugins to not be put into the right folder on Linux. All the builtin functions of the pattern language are defined in the builtin.hexplug plugin so if that file isn't in the plugins folder next to the executable, it won't be loaded and those functions won't be registered properly.

callym commented 3 years ago

Yep I am!

I'm running from ImHex/build/imhex, ImHex/build/plugins/builtin/builtin.hexplug does exist, but should it be ImHex/build/plugins/builtin.hexplug instead? (not nested in the builtin dir)

WerWolv commented 3 years ago

Yeah exactly

callym commented 3 years ago

Yep that solved it, thanks!