7 with
open(source
, "r", encoding
="UTF-8") as f
:
8 text
= text_
= f
.read()
9 for item
in findall(r
"0x([0-9A-Fa-f]+): // (\w+)", text
):
12 value
= value
* 131 + ord(i
)
16 print("{} -> {} // {}".format(item
[0], new
, item
[1]))
17 cur
= "0x{}: // {}".format(item
[0], item
[1])
18 new
= "0x{}: // {}".format(new
, item
[1])
19 text
= text
.replace(cur
, new
)
21 with
open(source
, "wb") as f
:
22 f
.write(text
.encode("UTF-8"))
26 for source
in glob(path
, recursive
=True):