diff --git a/logger.py b/logger.py new file mode 100644 index 0000000..705d919 --- /dev/null +++ b/logger.py @@ -0,0 +1,23 @@ +import logging + +# Configure logging +logging.basicConfig(level=logging.DEBUG) + +# Create a StreamHandler and set its log level to DEBUG +console_handler = logging.StreamHandler() +console_handler.setLevel(logging.DEBUG) + +# Create a formatter and attach it to the handler +formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') +console_handler.setFormatter(formatter) + +# Create a logger and add the console handler +logger = logging.getLogger(__name__) +logger.addHandler(console_handler) + +# Log messages +logger.debug("This is a debug message") +logger.info("This is an info message") +logger.warning("This is a warning message") +logger.error("This is an error message") +logger.critical("This is a critical message") diff --git a/main.py b/main.py new file mode 100644 index 0000000..e69de29 diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..69a5b31 --- /dev/null +++ b/readme.md @@ -0,0 +1,27 @@ +
+ +# Zipssion + +
+ +## What is this? +Zipssion is a command line program that aids in the design and reverse engineering of custom file types. + +## More about this repository + +This project is just getting started and only has a couple of features implemented + +## Known issues / TODOs + +- [ ] Write TODOs + +## View source + +[![cOborski/zipssion](https://img.shields.io/static/v1?label=cOborski&message=zipssion&color=yellow&logo=github)](https://github.com/coborski/zipssion/) + + +## Credits and references + +- !!! + +[🔝](#zipssion) diff --git a/test.zip b/test.zip new file mode 100644 index 0000000..5817680 Binary files /dev/null and b/test.zip differ diff --git a/test_files/test.zipssion b/test_files/test.zipssion new file mode 100644 index 0000000..5817680 Binary files /dev/null and b/test_files/test.zipssion differ diff --git a/test_files/test1.zipssion b/test_files/test1.zipssion new file mode 100644 index 0000000..5817680 Binary files /dev/null and b/test_files/test1.zipssion differ diff --git a/zipssion.py b/zipssion.py new file mode 100644 index 0000000..a99b1ee --- /dev/null +++ b/zipssion.py @@ -0,0 +1,28 @@ +import argparse +import pathlib +import shutil +import tempfile +import zipfile + +parser = argparse.ArgumentParser() + +parser.add_argument("filename") +args = parser.parse_args() + +print (args.filename) + +def view_files_content(filename): + + path = pathlib.Path(filename) + print(path) + zip_path = path.stem + '.zip' + print(zip_path) + + if (path.exists() and path.is_file()): + shutil.copy(path, zip_path) + + print(path.is_file()) + file = zipfile.ZipFile(zip_path) + file.printdir() + +view_files_content(args.filename)