I want to write a plugin like search function in binary Viewer, searching specific sequence in an binary file by text, hex or bit. https://www.proxoft.com/BinaryViewer.aspx
std::vector<int> search_bit(std::string& file_path, std::string& bit)
std::vector<int> search_hex(std::string& file_path, std::string& hex)
std::vector<int> search_text(std::string& file_path, std::string& text)
For example, I open a 6 bytes binary file "path" : 30 30 31 31 30 31(hex view)
search_bit(path, "001100000001"),
search_hex(path, "3031"), search_text(path, "01") all return {1, 4}.
Because "30 31" starts at 1 and 4 byte in this file. (hex"30" stands for ASCII 0, "31" stands for 1)
Is there any reference that could help? sorry this looks like asking for code, I know litte about memory mapping technique. [1]: https://i.stack.imgur.com/9YmKc.png