I need to process all binary files(PE32) from a folder. I'm looking to extract a specific string from each of these executables. The strings are sometimes found in little-endian, in some files they are big-endian. The string I'm looking for in every binary file is an address: example.site.com/home.asp The home.asp is always present (either in little or big-endian)
Looking to do this with bitstring. I'm thinking I need to use s.find(), and seek to home.asp into the file and then extract the previous X bytes, but the address length is always changing.
Maybe I need to list all strings (little and big E) from the binary first and grep that output for home.asp?
Via bash: '''strings -e l''' '''strings -e b''' gets strings from the binaries, then I can grep for home.asp, but I need to do this in python, and being able to do on all files recursively.
Get all addresses from all files.
{}tool in the Edit menu on selected text. Good luck.