Skip to content

Commit

Permalink
can decrypt multiple folders at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
jooapa committed Feb 3, 2024
1 parent a59673d commit be06f16
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ or you can run it in the terminal with:

passing only a folder will decrypt all .lua files in the directory.

python birdout.py <directory>
python birdout.py <directory> <directory> ...

Understandable, if you don't trust the .exe or the .jar file: openssl.exe. here is a virustotal scan: [virustotal](https://www.virustotal.com/gui/file/be0f086b9303fd52b6f5ec094c753c2b68f02559eb462f23929e72a6996eb1f8/detection/f-be0f086b9303fd52b6f5ec094c753c2b68f02559eb462f23929e72a6996eb1f8-1703249224)
and here scan for the unluac.jar: [virustotal](https://www.virustotal.com/gui/file/50f23c0b1cb85cc2bd07055ce782a918fdcb5d36d18d268b9606298d801bbb6e/detection/f-50f23c0b1cb85cc2bd07055ce782a918fdcb5d36d18d268b9606298d801bbb6e-1689512688)
Expand Down
35 changes: 22 additions & 13 deletions birdout.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

org_path = os.path.dirname(os.path.realpath(__file__))
# get directory of first file
path_to_current_lua_file = os.path.dirname(arg_files[0])
path_to_current_lua_file = []

if len(arg_files) == 0:
print("Usage: birdout.py <file.lua> <file.lua> ...")
Expand All @@ -18,25 +18,30 @@
# if directory
if os.path.isdir(file):
# loop through all files in directory and if extension is .lua, add to list
for root, dirs, arg_files in os.walk(file):
for file in arg_files:
if file.endswith(".lua"):
file = os.path.join(root, file)
print("File: " + file)

if not os.path.isfile(file):
print("File not found: " + file)
else:
for root, dirs, files_in_dir in os.walk(file):
for file_in_dir in files_in_dir:
if file_in_dir.endswith(".lua"):
file_path = os.path.join(root, file_in_dir)
print("Found file: " + file_path)
files.append(file_path)
elif os.path.isfile(file):
print("Found file: " + file)
files.append(file)
else:
print("File not found: " + file)

if len(files) == 0:
print("No valid files found!")
sys.exit(1)

# get directory of each file
for file in files:
path_to_current_lua_file.append(os.path.dirname(file))

# go to directory of first file
os.chdir(path_to_current_lua_file)
# remove the path from files
files = [os.path.basename(file) for file in files]
# files = [os.path.basename(file) for file in files]


print("\nAngry Birds Lua Decryptor, works on for decrypting Angry Birds Lua files.")
print("For Encrypting Luad files back, Chech README.md")
Expand Down Expand Up @@ -111,6 +116,10 @@ def decrypt_file(hex, file):

# for loop encrypts all files passed as arguments
for file in files:
os.chdir(org_path)
os.chdir(path_to_current_lua_file[files.index(file)])
# remove path from file
file = os.path.basename(file)
decrypt_file(hex, file)

print("nöf nöf! Done!")

0 comments on commit be06f16

Please sign in to comment.