Find all hex starting with #1996
-
I have a binary file in which all |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can use the Find view for this. Use the Binary Pattern option there and enter |
Beta Was this translation helpful? Give feedback.
-
You are missing some details as to how you want to find these sequences and what happens if the magic numbers 0x55,0xAA are not in the data. Assuming that data starts and end with said sequence and assuming you want to write a pattern to find these sequences the following should work: import type.base;
import std.mem;
struct ReadRow {
$ += 2;
type::Hex<u8> data[while(($[$]!=0x55 || $[$+1] != 0xAA) && !std::mem::eof())];
};
str seq="\x55\xAA";
std::mem::MagicSearch<seq,ReadRow> find@0; I tested it on some made-up data and it seems to work. |
Beta Was this translation helpful? Give feedback.
You are missing some details as to how you want to find these sequences and what happens if the magic numbers 0x55,0xAA are not in the data. Assuming that data starts and end with said sequence and assuming you want to write a pattern to find these sequences the following should work:
I tested it on some made-up data and it seems to work.