https://github.com/Sepero/SearchBin - compiles file in regex beforehand - python => ignored: naive
https://github.com/rsharo/bgrep - overcomplicated - no need for regex support, only offsets - no effective string match algs inside - no alg for mmap() usage => ignored: inadequate Alg for mmap() is the most crucial part for performance after algorithm itself. As alg+mmap() must be optimized to SDD/RAM/LCache limitations and access type. On Fri, Mar 24, 2017 at 11:37:15PM +0300, Alexander Krotov wrote:
On Fri, Mar 24, 2017 at 08:03:38PM +0200, Amer wrote:Does anybody knows any cli tools which allows to search offset of one binary file inside another ? Find if ./chunk.bin contained and its offset inside ./dump.bin * simple case: 200kB inside 100MB * hard case: 2GB inside 100GB I thought this idea is as old as PC itself, but I couldn't find any tool in arch distro, nor by google, nor at github. However, maybe my requests simply couldn't their descriptions. I acknowledge that implementation isn't as simple as it seems, when taking into account performance for hard case. But I even couldn't find straight clean implementation in C / mmap(). I appreciate anything related, even links to sophisticated algorithms, if there is really no tool / code-snippet in existence yet.Not C, but Python: https://github.com/Sepero/SearchBin For C, you can modify this one to make it read pattern from file or mmap it: https://github.com/rsharo/bgrep
