ImHex-Patterns icon indicating copy to clipboard operation
ImHex-Patterns copied to clipboard

Using existing pattern for embedded files

Open meganukebmp opened this issue 1 year ago • 2 comments

Hello, I have a list of offsets with JPEG files. Since we already have a JPEG file pattern is it possible to use it as a type with an include, or am I forced to have to recreate a JPEG type.

It'd be nice if I could do something along the lines of:

#include <jpeg.hexpat>
JPEG myjpeg @ 0x112233;

meganukebmp avatar Jan 01 '24 17:01 meganukebmp

that is actually a feature proposal that we moved onto the import statement, where you would eventually be able to do something like:

import jpeg::JPEG as jpeg;

jpeg myjpeg @ 0x112233;

The import statement would have broader scope than that, and replace #include entirely.

This will be implemented as soon as the internal refactor of the pattern language is finished.

What you have to do is now, copy the jpeg.hexpat from our patterns repo, remove the last placement line, and then write the rest of the pattern

jumanji144 avatar Jan 01 '24 19:01 jumanji144

Thanks for the quick response! I see, I'm glad this is being worked on.

Should this issue be left open until that feature is complete? To avoid other people asking the same.

meganukebmp avatar Jan 01 '24 19:01 meganukebmp