import re

with open("GuessNumber.txt", "r") as f:
    lines = f.readlines()

data = bytearray()

for line in lines:
    # zober časť medzi offsetom a ASCII stĺpcom
    m = re.match(r"^[0-9a-fA-F]+:\s+(.+?)\s{2,}", line)
    if not m:
        continue

    hexpart = m.group(1)

    # odstráň medzery medzi skupinami
    hexpart = hexpart.replace(" ", "")

    data.extend(bytes.fromhex(hexpart))

with open("GuessNumber_restored.exe", "wb") as f:
    f.write(data)
