Skip to content

Recursive Struct Operations #1896

Answered by paxcut
0xfbad asked this question in Get Help
Sep 9, 2024 · 1 comments · 8 replies
Discussion options

You must be logged in to vote

My aim is not to write the exact code you want to end up using. My only intent is to show how to read an array of structs that have their addresses specified by a previously read array of offsets. That is only the part that you are writing fake code for presumably because you are unsure how ImHex can do that operation. My idea is that once that is understood, the other details for your particular pattern should no be that complicated.

Here is the problem. Youwant to perform this operation

SectionData data_sections[i] @ header.sections[ i].data_offset;

for all values of i between 0 and header.num_sections as if it was being done in a loop. As explained, loops cannot be used inside structs …

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@0xfbad
Comment options

@paxcut
Comment options

@0xfbad
Comment options

@paxcut
Comment options

Answer selected by 0xfbad
@0xfbad
Comment options

@paxcut
Comment options

@0xfbad
Comment options

@paxcut
Comment options

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