add tool to hardcode files
This commit is contained in:
parent
5b3ae56020
commit
cdce544995
21
hardcfiles.py
Normal file
21
hardcfiles.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import pickle
|
||||||
|
import base64
|
||||||
|
import sys
|
||||||
|
import zlib
|
||||||
|
|
||||||
|
|
||||||
|
files = {}
|
||||||
|
|
||||||
|
for name in sys.argv[1:]:
|
||||||
|
name = name.replace("\\", "/")
|
||||||
|
if name.startswith("./"):
|
||||||
|
name = name[2:]
|
||||||
|
|
||||||
|
with open(name, "rb") as f:
|
||||||
|
data = f.read()
|
||||||
|
files[name] = data
|
||||||
|
|
||||||
|
data = pickle.dumps(files)
|
||||||
|
compressed_data = zlib.compress(data, 9)
|
||||||
|
|
||||||
|
print(base64.b85encode(compressed_data).decode("ascii"))
|
Loading…
Reference in New Issue
Block a user