0

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.

2
  • 1
    can you please share some example input and expected output with your approaching codes so that we can help? Commented Jun 29, 2019 at 9:44
  • use 4 spaces at the front of each line that you want displayed as code, or use the {} tool in the Edit menu on selected text. Good luck. Commented Jun 29, 2019 at 23:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.