SearchBin icon indicating copy to clipboard operation
SearchBin copied to clipboard

Update searchbin.py

Open michelerenzullo opened this issue 3 years ago • 4 comments

added option to see the matched pattern when you use wildcard "??"

michelerenzullo avatar Dec 17 '20 12:12 michelerenzullo

Thanks for your submission on this super old project. I don't use it myself anymore, but I'm glad someone can still get use out of it. When I have available time, I'll be happy to merge your additions.

Sepero avatar Dec 19 '20 06:12 Sepero

Yes, for me it's useful because I create patch for android, I search pattern, it's fast, light and useful.

michelerenzullo avatar Dec 19 '20 12:12 michelerenzullo

After further review, I want to merge your modifications, but I've run into a few issues which prevent me. To do it the right way, we should do the following.

  1. The new output is non-standard. Which means it can't be used across all outputs (-t -p -f). Also, modifying the output format could break automated scripts for people that rely on the current output format. My best idea to overcome this issue, is create a new runtime flag that can be used to say "Please give me more output info on wildcard matches".

  2. This code was specifically written to be as efficient as possible. Especially the location you wish to include code, the main search loop. It looks like the following code may be more efficient?

     if print_wildcards:
         STDOUT.write("Match (%s) at offset: %14d decimal %12X hex in %s\n" % (
         bytes(buffer[match:match+len_pattern],'utf-8','replace'),
         find_offset, find_offset, fh_name ))
    
  3. While I could code and implement these delicate charges myself, My largest problem is that I no longer have a workstation do be doing this kind of coding. Nowadays, I don't program much anymore, and I do most of my work from my Rooted mobile Android. It's possible to do coding on Android, but I'm rusty and don't have large amounts of time for programming and debugging.

So where do we go from here? I appreciate your contribution and value it. You could fork the code and start an improved version of SearchBin. Implement all of the above changes yourself, and debug it. If done well, then I could even put a link to your project. But I suspect you have other things you'd rather be coding.

As an simple alternative solution, perhaps I could just create a separate branch for your code. The Wildcard Output branch. A non-standard version of SearchBin dedicated to this purpose.

I'm just throwing out ideas here. You let me know what you think. 😊

PS. Add me on Jami messenger ring:a55e8e0d3558031d8c90faa43a14bf3746a7f9da

Sepero avatar Dec 19 '20 17:12 Sepero

I got your messages on Jami. Did you get mine?

Sepero avatar Dec 20 '20 04:12 Sepero