Finding multiple of the same patterns in a binary #2514
Unanswered
LawrenceColombo
asked this question in
Pattern Language Q&A
Replies: 1 comment
-
|
The reason it doesn't work is that you can't use loops to place variables. Instead what you need to do is to turn the loop into a struct which is indexed using a while loop. As a possible example something like this may work: u32 sequenceOffset = 0x0;
struct Finder {
u32 riff_offset = std::mem::find_sequence(sequenceOffset, 0x52, 0x49, 0x46, 0x46);
if (riff_offset == -1)
break;
std::print("While loop RIFF offset: {:#x}", riff_offset);
WAVEHeader header @ riff_offset;
};
Finder find[while(true)]@0;
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey all, I wrote the below pattern to find uncompressed WAVE files embedded in a binary, and while I can search for the start offsets, I don't know how to highlight them in the hex editor view unless I do it manually? (and there are a few hundred) You can see below with my WIP that I'm search for the offset of
RIFFbutWAVEHeader header @ riff_offset;doesn't seem to highlight it, anyways fantastic tool so farBeta Was this translation helpful? Give feedback.
All reactions