1

I'd like to find a sequence of values in a 32MB data stream, where the values are all between 0x00 and 0x09 and there are about 20-40 of them in a row.

Maybe this can be done with Hex Workshop, but i have no clue how...

1

I would be inclined to write a quick python script to do this.

with a few lines of code you should be able to break the binary down (complete or just a section) into an array of bytes and then look through and the array and compare each to see if it falls into your sequence.

Check out this library below.

https://github.com/erocarrera/pefile

1
  • What is the connection between pefile and the problem at hand? Additionally, if you could provide an example python script, that would be great. – julian Sep 9 '19 at 12:46
0

grep can do what you ask for

:\>f:\usr\bin\ls -lag foo.bin
-rw-r--r-- 1 197121 33554432 Sep  9 13:31 foo.bin

:\>f:\usr\bin\grep  -obUaP "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39" foo.bin
96:0123456789
336:0123456789
832:0123456789
1472:0123456789
2144:0123456789
3328:0123456789
25895568:0123456789
25895579:0123456789
25895590:0123456789
25895601:0123456789
25895612:0123456789

:\>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.