guh
this is truly THE experiment: this code does not handle errors. its just a thing i came up when i think of code obfuscation. think exec(stuff that is generated by this program)
This commit is contained in:
1 parent
1804b94cf2
commit
5f05ca9910
2 files changed
+12
-5
No files matched your search
@@ -11,7 +11,7 @@ with open("./real/real.txt", "rb") as f:
|
||||
|
||||
|
||||
def restore_text1(target: bytes, cuh=Iterator[Iterator[tuple[int, int]]]):
|
||||
textin: list[int | None] = []
|
||||
textin: list[int | None] = [] # [None] * len(cuh[0])
|
||||
for key in cuh: # stfu # type: ignore
|
||||
if len(key) != len(target):
|
||||
# raise "actually does happen error"
|
||||
@@ -58,15 +58,17 @@ with open("./real/not_real.txt", "rb") as textin:
|
||||
key5 = getkey("./real/keyreal5.txt", "r")
|
||||
key6 = getkey("./real/realkey6.txt", "r")
|
||||
key7 = getkey("./real/realkey7.bin", "rb")
|
||||
print(list(map(len, [key5, key6, key7]))) # [141, 141, 141]
|
||||
key8 = getkey("./real/realkey8.txt", "r")
|
||||
key9 = getkey("./real/key9real.bin", "rb")
|
||||
print(list(map(len, [key5, key6, key7, key8, key9]))) # [141, 141, 141]
|
||||
# print(key5)
|
||||
content = textin.read()
|
||||
print(len(content)) # 141 now not 145 anymore
|
||||
print(
|
||||
bytes(
|
||||
map(
|
||||
lambda a: a or ord("Q"),
|
||||
restore_text1(content, [key5, key6, key7]), # type: ignore
|
||||
lambda a: a if a is not None else int.from_bytes(b"Z"),
|
||||
restore_text1(content, [key5, key6, key7, key8, key9]), # type: ignore
|
||||
)
|
||||
)
|
||||
) # i love when Q is NEVER used
|
||||
|
||||
@@ -39,6 +39,7 @@ import random
|
||||
import argparse
|
||||
import sys
|
||||
import ast
|
||||
import warnings
|
||||
|
||||
|
||||
def index_list(range_: range, length: int, seed=None) -> Iterator[int]:
|
||||
@@ -158,7 +159,11 @@ def main():
|
||||
# help="Output file (default: stdout)"
|
||||
# )
|
||||
args = parser.parse_args()
|
||||
|
||||
# if isinstance(args.bytes, int):
|
||||
# if args.bytes <= 0:
|
||||
# raise ValueError("how would i store your key stupid")
|
||||
# if args.bytes & (args.bytes - 1) != 0:
|
||||
# warnings.warn(UserWarning("not a power of two: wont be an easy life"))
|
||||
match args.command:
|
||||
case "encrypt":
|
||||
with open(args.filein, "rb") as fin:
|
||||
|
||||
Reference in new issue
Block a user