Dec-24-2024, 10:14 AM
with few informations and nothing to test, i would propose the following snippet:
import re from _Arm64HexDatabase import * inputVar = [ "hex_suba64w0w0w0", "hex_suba64w31w31w31", "hex_suba64x0x0x0", "hex_suba64x31x31x31", ... ] outputVar = [ "hex_mova64w0c0", "hex_mova64w31c0", "hex_mova64x0c0", "hex_mova64x31c0", ... ] # note: the 2 lists might be written once (and for all) in a file and loaded # the snippet assumes the pattern is exactly this one (otherwise if .. then ... must be used) i = 0 with open ("example1", "rb") as handle_file1, open("result1.txt", "a") as hfile3: inputLine = handle_file1.readline() while (inputLine != ''): outputLine = re.sub(inputVar[i], outputVar[i], inputLine) hfile3.write(f"{outputLine}\n") i += 1 inputLine = handle_file1.readline()