Skip to content

Instantly share code, notes, and snippets.

@TAbdiukov
Last active August 7, 2020 03:38
Show Gist options
  • Save TAbdiukov/a6b2297f25131d2fe43ebf34c69cee88 to your computer and use it in GitHub Desktop.
Save TAbdiukov/a6b2297f25131d2fe43ebf34c69cee88 to your computer and use it in GitHub Desktop.
#!python3
import re
import sys
try:
fn = sys.argv[1]
except IndexError:
fn = "MYOB Premier v7.msi"
fp = open(fn, "rb")
bs = fp.read()
fp.close()
r = re.compile(b'Operating System = (.*?)[\x00-\x10]')
matches = r.findall(bs)
print("OSs supported: ")
matches_in_str = [buf.decode('ascii') for buf in matches]
matches_in_str = sorted(matches_in_str)
[print(s, sep='\n') for s in matches_in_str]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment