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

[Feature] Access prior items in Array #1759

Open
1 task
Nemrav opened this issue Jun 13, 2024 · 0 comments
Open
1 task

[Feature] Access prior items in Array #1759

Nemrav opened this issue Jun 13, 2024 · 0 comments

Comments

@Nemrav
Copy link

Nemrav commented Jun 13, 2024

What feature would you like to see?

If I load an array like so:
Chunk chunks[while($ < std::mem::size()-start)] @ start;
or

struct ChunkList {
   Chunk chunks[]
};
ChunkList list @ start;

While initializing a chunk I would like to be able to access a prior chunk already added to the array, perhaps with syntax like get_container.search(pattern) or get_container[container::get_index()-1].

How will this feature be useful to you and others?

Some files (like the one I'm making a pattern for) might have structs which require information from elsewhere in an array that is not emplaced yet, this feature would help parsing such files.
Or there already is a way to do this, and this issue is unnecessary

Request Type

  • I can provide a PoC for this feature or am willing to work on it myself and submit a PR

Additional context?

As part of trying out ImHex, I am parsing a 3d model file which uses a chunk array of undetermined size. The chunks come in several types and do not come in a fixed order, but in my case, bone weight chunks require finding a prior mesh chunk with a matching id property. Not all possible chunk types in the chunk list have this id property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant