Replies: 1 comment
-
It's not a real binary, just a zip file. You can simply unzip it or use other zip tools of your choice. Here is an example session where I create a simple PEX file and run it as a baseline: $ mkdir -p src/foo
$ for x in bar baz spam; do echo "from colors import cyan; print(cyan('$x'))" > "src/foo/${x}.py"; done
$ pex -D src/ ansicolors -o example.pex -m foo.bar
$ ./example.pex
bar
$ PEX_MODULE=foo.spam ./example.pex
spam And here I inspect the PEX file and display its contents: $ file example.pex
example.pex: Zip archive data, made by v2.0 UNIX, extract using at least v2.0, last modified Mon Jan 26 00:44:48 1970, method=deflate
$ zipinfo -1 example.pex
.bootstrap/
.bootstrap/pex/
.bootstrap/pex/__init__.py
.bootstrap/pex/__main__.py
.bootstrap/pex/argparse.py
.bootstrap/pex/atomic_directory.py
.bootstrap/pex/attrs.py
.bootstrap/pex/auth.py
.bootstrap/pex/bootstrap.py
.bootstrap/pex/common.py
.bootstrap/pex/compatibility.py
.bootstrap/pex/compiler.py
.bootstrap/pex/dist_metadata.py
.bootstrap/pex/enum.py
.bootstrap/pex/environment.py
.bootstrap/pex/executor.py
.bootstrap/pex/fetcher.py
.bootstrap/pex/finders.py
.bootstrap/pex/fingerprinted_distribution.py
.bootstrap/pex/hashing.py
.bootstrap/pex/inherit_path.py
.bootstrap/pex/interpreter.py
.bootstrap/pex/interpreter_constraints.py
.bootstrap/pex/jobs.py
.bootstrap/pex/layout.py
.bootstrap/pex/network_configuration.py
.bootstrap/pex/orderedset.py
.bootstrap/pex/pep_376.py
.bootstrap/pex/pep_425.py
.bootstrap/pex/pep_440.py
.bootstrap/pex/pep_503.py
.bootstrap/pex/pep_508.py
.bootstrap/pex/pex.py
.bootstrap/pex/pex_bootstrapper.py
.bootstrap/pex/pex_builder.py
.bootstrap/pex/pex_info.py
.bootstrap/pex/pex_warnings.py
.bootstrap/pex/platforms.py
.bootstrap/pex/pth.py
.bootstrap/pex/pyenv.py
.bootstrap/pex/rank.py
.bootstrap/pex/requirements.py
.bootstrap/pex/resolver.py
.bootstrap/pex/result.py
.bootstrap/pex/sh_boot.py
.bootstrap/pex/sorted_tuple.py
.bootstrap/pex/targets.py
.bootstrap/pex/third_party/
.bootstrap/pex/third_party/__init__.py
.bootstrap/pex/tracer.py
.bootstrap/pex/typing.py
.bootstrap/pex/util.py
.bootstrap/pex/variables.py
.bootstrap/pex/vendor/
.bootstrap/pex/vendor/__init__.py
.bootstrap/pex/vendor/_vendored/
.bootstrap/pex/vendor/_vendored/__init__.py
.bootstrap/pex/vendor/_vendored/attrs/
.bootstrap/pex/vendor/_vendored/attrs/__init__.py
.bootstrap/pex/vendor/_vendored/attrs/attr/
.bootstrap/pex/vendor/_vendored/attrs/attr/__init__.py
.bootstrap/pex/vendor/_vendored/attrs/attr/__init__.pyi
.bootstrap/pex/vendor/_vendored/attrs/attr/_cmp.py
.bootstrap/pex/vendor/_vendored/attrs/attr/_cmp.pyi
.bootstrap/pex/vendor/_vendored/attrs/attr/_compat.py
.bootstrap/pex/vendor/_vendored/attrs/attr/_config.py
.bootstrap/pex/vendor/_vendored/attrs/attr/_funcs.py
.bootstrap/pex/vendor/_vendored/attrs/attr/_make.py
.bootstrap/pex/vendor/_vendored/attrs/attr/_next_gen.py
.bootstrap/pex/vendor/_vendored/attrs/attr/_version_info.py
.bootstrap/pex/vendor/_vendored/attrs/attr/_version_info.pyi
.bootstrap/pex/vendor/_vendored/attrs/attr/converters.py
.bootstrap/pex/vendor/_vendored/attrs/attr/converters.pyi
.bootstrap/pex/vendor/_vendored/attrs/attr/exceptions.py
.bootstrap/pex/vendor/_vendored/attrs/attr/exceptions.pyi
.bootstrap/pex/vendor/_vendored/attrs/attr/filters.py
.bootstrap/pex/vendor/_vendored/attrs/attr/filters.pyi
.bootstrap/pex/vendor/_vendored/attrs/attr/py.typed
.bootstrap/pex/vendor/_vendored/attrs/attr/setters.py
.bootstrap/pex/vendor/_vendored/attrs/attr/setters.pyi
.bootstrap/pex/vendor/_vendored/attrs/attr/validators.py
.bootstrap/pex/vendor/_vendored/attrs/attr/validators.pyi
.bootstrap/pex/vendor/_vendored/packaging_20_9/
.bootstrap/pex/vendor/_vendored/packaging_20_9/__init__.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/__about__.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/__init__.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/_compat.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/_structures.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/_typing.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/markers.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/py.typed
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/requirements.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/specifiers.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/tags.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/utils.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/packaging/version.py
.bootstrap/pex/vendor/_vendored/packaging_20_9/pyparsing.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/
.bootstrap/pex/vendor/_vendored/packaging_21_3/__init__.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/__about__.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/__init__.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/_manylinux.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/_musllinux.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/_structures.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/markers.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/py.typed
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/requirements.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/specifiers.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/tags.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/utils.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/packaging/version.py
.bootstrap/pex/vendor/_vendored/packaging_21_3/pyparsing.py
.bootstrap/pex/vendor/_vendored/setuptools/
.bootstrap/pex/vendor/_vendored/setuptools/__init__.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/__init__.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/__init__.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/appdirs.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/__about__.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/__init__.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/_compat.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/_structures.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/markers.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/requirements.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/specifiers.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/utils.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/version.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/pyparsing.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/six.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/extern/
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/extern/__init__.py
.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/py31compat.py
.bootstrap/pex/venv/
.bootstrap/pex/venv/README.md
.bootstrap/pex/venv/__init__.py
.bootstrap/pex/venv/bin_path.py
.bootstrap/pex/venv/install_scope.py
.bootstrap/pex/venv/pex.py
.bootstrap/pex/venv/virtualenv.py
.bootstrap/pex/venv/virtualenv_16.7.12_py
.bootstrap/pex/version.py
.bootstrap/pex/ziputils.py
.deps/
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/.layout.json
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/ansicolors-1.1.8.dist-info/
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/ansicolors-1.1.8.dist-info/DESCRIPTION.rst
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/ansicolors-1.1.8.dist-info/INSTALLER
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/ansicolors-1.1.8.dist-info/METADATA
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/ansicolors-1.1.8.dist-info/REQUESTED
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/ansicolors-1.1.8.dist-info/WHEEL
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/ansicolors-1.1.8.dist-info/metadata.json
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/ansicolors-1.1.8.dist-info/top_level.txt
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__init__.py
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/colors.py
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/csscolors.py
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/version.py
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__pycache__/
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__pycache__/__init__.cpython-311.pyc
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__pycache__/__init__.cpython-39.pyc
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__pycache__/colors.cpython-311.pyc
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__pycache__/colors.cpython-39.pyc
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__pycache__/csscolors.cpython-311.pyc
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__pycache__/csscolors.cpython-39.pyc
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__pycache__/version.cpython-311.pyc
.deps/ansicolors-1.1.8-py2.py3-none-any.whl/colors/__pycache__/version.cpython-39.pyc
PEX-INFO
__main__.py
__pex__/
__pex__/__init__.py
foo/
foo/bar.py
foo/baz.py
foo/spam.py
$ unzip -qc example.pex foo/baz.py
from colors import cyan; print(cyan('baz')) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ie decrypt the binary to .py
Beta Was this translation helpful? Give feedback.
All reactions