INNER CODE UNIT · Python

MAX_EXPANDED_BYTES

KSwordDEV/KSword · GhidraRuntimePlugin/package.py:20

MAX_EXPANDED_BYTES = 4 * 1024 ** 3
MAX_ENTRIES = 100000
DEVICES = {'con', 'prn', 'aux', 'nul', *(f'com{i}' for i in range(10)), *(f'lpt{i}' for i in range(10))}


def file_hash(path: Path) -> str:
    digest = hashlib.sha256()
    with path.open('rb') as stream:
        for block in iter(lambda: stream.read(1024 * 1024), b''):
            digest.update(block)
    return digest.hexdigest()


def safe_member(name: str, expected_root: str) -> PurePosixPath:
    if '\\' in name or '\x00' in name:
        raise ValueError('unsafe ZIP separator or NUL')
    parts = name.rstrip('/').split('/')
    if not parts or parts[0] != expected_root:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…