Python Forum
Search for multiple unknown 3 (2) Byte combinations in a file.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search for multiple unknown 3 (2) Byte combinations in a file.
#1
Hi all

I` d like to search a file for multiple unknown hex combinations in a file and have absolutely no idea how to start.

The hex combinations are always 3 byte long and the second and third byte will have different unknown values.

What i know is that the initial combinations to search start with one of the following

8c , 8d , 8e

so ac???? or 8d???? 8e????

Now i want to return the ???? values only if there is also one or multiple ac???? or 8d???? 8e???? or ee???? or ce???? in that file aswell.

For example if 8c21d0 is found anywhere in that file then seach for a second,third... 8c21d0 and also for
ee21d0 8d21d0 8e21d0 ce21d0

Once that is found i`d like to skip returning values if the found bytes match e.g. 8d 12 d0 or 8d 22 d0 or 8d 00 04 etc.

I think to store the skip values in an list is the best solution here.

If the 2nd and third byte is not in that skiplist the function should return 21d0 in that case as first found combinations, but
continue searching for other possible matches and return them aswell.

What would be the best solution / funtion to start such a Project ?
Reply


Messages In This Thread
Search for multiple unknown 3 (2) Byte combinations in a file. - by lastyle - Aug-12-2023, 05:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search Excel File with a list of values huzzug 4 1,312 Nov-03-2023, 05:35 PM
Last Post: huzzug
  search file by regex SamLiu 1 951 Feb-23-2023, 01:19 PM
Last Post: deanhystad
  Finding combinations of list of items (30 or so) LynnS 1 908 Jan-25-2023, 02:57 PM
Last Post: deanhystad
  If function is false search next file mattbatt84 2 1,185 Sep-04-2022, 01:56 PM
Last Post: deanhystad
  Python: re.findall to find multiple instances don't work but search worked Secret 1 1,256 Aug-30-2022, 08:40 PM
Last Post: deanhystad
  Search multiple CSV files for a string or strings cubangt 7 8,210 Feb-23-2022, 12:53 AM
Last Post: Pedroski55
  fuzzywuzzy search string in text file marfer 9 4,710 Aug-03-2021, 02:41 AM
Last Post: deanhystad
  How can I find all combinations with a regular expression? AlekseyPython 0 1,700 Jun-23-2021, 04:48 PM
Last Post: AlekseyPython
  Cloning a directory and using a .CSV file as a reference to search and replace bg25lam 2 2,177 May-31-2021, 07:00 AM
Last Post: bowlofred
  All possible combinations CODEP 2 1,899 Dec-01-2020, 06:10 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020