Searching through a hex dump using regex in Vim (or elsewhere)

后端 未结 3 1026
孤街浪徒
孤街浪徒 2021-01-15 12:59

I’m looking for a way to search for the text representation of a series of hexadecimal numbers. I search in the hex dump of a binary file that looks like so:



        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-15 13:16

    Well it seems none of the more elegant solutions have worked for you so here:

    \v03(\n[^:]+:)? 28(\n[^:]+:)? 0B(\n[^:]+:)?
    

    Yeah, it's copy pasted and super brute forcy but it'd look so much better if I could get friggin backreferences to work.

    Just type '/' then copy that pattern in and hit enter, replace 03 28 0B with whatever you need followed by space, new value, then the parenthetical statement. There's roughly a 100% chance there's something better, but I can't think of it.

    This will match the memory location as well, but that shouldn't matter if all you want to do is take a peek.

    Edit: Forgot about \v

提交回复
热议问题