Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] E: runtime error: Pattern count exceeded set limit of '131072' on OSX with ELF Pattern #1680

Closed
1 task
iamthebot opened this issue May 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@iamthebot
Copy link

iamthebot commented May 15, 2024

Operating System

Mac OSX

What's the issue you encountered?

On OSX (M1 chip) IMHex opening an ELF file causes the ELF pattern to not work

Under the pattern editor we can see the error

E: 726 | struct ELF {
E:              ^^^
E: <Source Code>:745:1
E: 745 | ELF elf @ 0x00;
E:       ^^^


E: runtime error: Pattern count exceeded set limit of '131072'.


E: If this is intended, try increasing the limit using '#pragma pattern_limit <new_limit>'.

Note that manually adding #pragma pattern_limit 10000000 at the top fixes it.

How can the issue be reproduced?

Open a nontrivial ELF file like libcrypto.so.3 from openssl on an OSX machine with IMHex. Try seeing if the ELF pattern works.

ImHex Version

1.33.2

ImHex Build Type

  • Nightly or built from sources

Installation type

DMG

Additional context?

libcrypto_example.zip

@iamthebot iamthebot added the bug Something isn't working label May 15, 2024
@jumanji144
Copy link
Collaborator

This is not a bug, as the console clearly states the steps that should be taken to resolve this. This is an intended feature, as we want to limit the amount of patterns to prevent infinite runtime.

@iamthebot
Copy link
Author

@jumanji144 is there a way to set this default globally? So I don't have to edit the pattern every time?

@paxcut
Copy link
Contributor

paxcut commented May 16, 2024

You can save the changes made to any pattern and either overwrite the installed one, given you have permissions to do so, or create your own copy. The one in the installation folder will be overwritten next time you install imhex but the one you save in your own pattern folder will not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants