OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
lib
/
python3.6
/
dist-packages
/
virtualenv
/
util
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📄
__init__.py
0 bytes
05/09/2024 06:58:24 AM
rw-r--r--
📁
__pycache__
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📄
error.py
272 bytes
05/09/2024 06:58:24 AM
rw-r--r--
📄
lock.py
4.55 KB
05/09/2024 06:58:24 AM
rw-r--r--
📁
path
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📁
subprocess
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📄
zipapp.py
982 bytes
05/09/2024 06:58:24 AM
rw-r--r--
Editing: zipapp.py
Close
import logging import os import zipfile from virtualenv.info import IS_WIN, ROOT def read(full_path): sub_file = _get_path_within_zip(full_path) with zipfile.ZipFile(ROOT, "r") as zip_file: with zip_file.open(sub_file) as file_handler: return file_handler.read().decode("utf-8") def extract(full_path, dest): logging.debug("extract %s to %s", full_path, dest) sub_file = _get_path_within_zip(full_path) with zipfile.ZipFile(ROOT, "r") as zip_file: info = zip_file.getinfo(sub_file) info.filename = dest.name zip_file.extract(info, str(dest.parent)) def _get_path_within_zip(full_path): full_path = os.path.abspath(str(full_path)) sub_file = full_path[len(ROOT) + 1 :] if IS_WIN: # paths are always UNIX separators, even on Windows, though __file__ still follows platform default sub_file = sub_file.replace(os.sep, "/") return sub_file __all__ = [ "read", "extract", ]