Created
August 23, 2024 13:42
-
-
Save hasherezade/d5b35139144663430d0b7e8b2476db0a to your computer and use it in GitHub Desktop.
Decompressor for headless APLib blobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import malduck | |
import sys | |
import argparse | |
def main(): | |
parser = argparse.ArgumentParser(description="APLib unpacker") | |
parser.add_argument('--inpath', dest="inpath", default=None, help="APLib compressed blob", | |
required=True) | |
args = parser.parse_args() | |
with open(args.inpath, 'rb') as f: | |
data = f.read() | |
try: | |
res = malduck.aplib(data) | |
if res: | |
with open(args.inpath + '.decompressed', 'wb') as g: | |
g.write(res) | |
else: | |
print(f'Malduck did not decompress the buffer.') | |
except Exception as e: | |
print(f'Could not aplib decompress: {e}') | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment