├── .coveragerc ├── .flake8 ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yml ├── AUTHORS.md ├── CHANGELOG.md ├── Dockerfile ├── LICENSE ├── MANIFEST.in ├── README.md ├── azure-pipelines.yml ├── codecov.yml ├── conftest.py ├── docs ├── Makefile ├── _static │ ├── demo.gif │ ├── hello_zelos.png │ ├── plugin_active.png │ ├── plugin_select.png │ └── zelos │ │ ├── favicon.ico │ │ └── logo.png ├── args │ └── args.rst ├── conf.py ├── index.rst ├── make.bat └── tutorials │ ├── 01_cmdline.md │ ├── 02_scripting.md │ ├── 03_using_hooks.md │ ├── 04_writing_plugins.md │ ├── 05_syscall_limit_plugin.md │ ├── 06_snapshot_overlay.md │ ├── 07_zml_and_feeds.md │ └── zelos_feeds_diagram.png ├── examples ├── hello │ ├── README.md │ ├── hello.bin │ └── hello.py ├── inmemory_strings │ ├── pwnablekr_flag │ ├── strings_plugin.py │ └── strings_script.py ├── script_brute │ ├── README.md │ ├── brute.py │ └── password.bin ├── script_bypass │ ├── README.md │ ├── bypass.py │ └── password_check.bin └── test_examples.py ├── pyproject.toml ├── setup.py ├── src └── zelos │ ├── __init__.py │ ├── __main__.py │ ├── api │ ├── __init__.py │ ├── memory_api.py │ ├── regs_api.py │ └── zelos_api.py │ ├── breakpoints.py │ ├── config_gen.py │ ├── emulator │ ├── __init__.py │ ├── arm.py │ ├── base.py │ ├── mips.py │ ├── x86.py │ └── x86_gdt.py │ ├── engine.py │ ├── enums.py │ ├── exceptions.py │ ├── ext │ ├── env │ │ ├── linux-armv7 │ │ │ ├── etc │ │ │ │ ├── hosts │ │ │ │ └── resolv.conf │ │ │ ├── lib │ │ │ │ ├── ld-linux-armhf.so.3 │ │ │ │ ├── ld-linux.so.3 │ │ │ │ ├── ld-uClibc-0.9.33.2.so │ │ │ │ ├── ld-uClibc-1.0.31.so │ │ │ │ ├── ld-uClibc.so │ │ │ │ ├── ld-uClibc.so.0 │ │ │ │ ├── ld-uClibc.so.1 │ │ │ │ ├── libc++.so │ │ │ │ ├── libc.so │ │ │ │ ├── libc.so.0 │ │ │ │ ├── libc.so.1 │ │ │ │ ├── libc.so.6 │ │ │ │ ├── libcrypt.so.0 │ │ │ │ ├── libdl.so │ │ │ │ ├── libgcc_s.so.1 │ │ │ │ ├── liblog.so │ │ │ │ ├── libm.so │ │ │ │ ├── libm.so.0 │ │ │ │ ├── libstdc++.so │ │ │ │ ├── libuClibc-1.0.31.so │ │ │ │ └── libz.so │ │ │ ├── proc │ │ │ │ └── net │ │ │ │ │ └── route │ │ │ └── usr │ │ │ │ └── lib │ │ │ │ ├── README.md │ │ │ │ └── libconfig.so │ │ ├── linux-mips │ │ │ └── etc │ │ │ │ ├── hosts │ │ │ │ └── resolv.conf │ │ ├── linux-x86-64 │ │ │ ├── etc │ │ │ │ ├── hosts │ │ │ │ └── resolv.conf │ │ │ ├── lib │ │ │ │ ├── i386-linux-gnu │ │ │ │ │ ├── ld-2.27.so │ │ │ │ │ ├── ld-linux.so.2 │ │ │ │ │ ├── libBrokenLocale-2.27.so │ │ │ │ │ ├── libBrokenLocale.so.1 │ │ │ │ │ ├── libSegFault.so │ │ │ │ │ ├── libanl-2.27.so │ │ │ │ │ ├── libanl.so.1 │ │ │ │ │ ├── libc-2.27.so │ │ │ │ │ ├── libc.so.6 │ │ │ │ │ ├── libcidn-2.27.so │ │ │ │ │ ├── libcidn.so.1 │ │ │ │ │ ├── libcrypt-2.27.so │ │ │ │ │ ├── libcrypt.so.1 │ │ │ │ │ ├── libdl-2.27.so │ │ │ │ │ ├── libdl.so.2 │ │ │ │ │ ├── libgcc_s.so.1 │ │ │ │ │ ├── libm-2.27.so │ │ │ │ │ ├── libm.so.6 │ │ │ │ │ ├── libmemusage.so │ │ │ │ │ ├── libnsl-2.27.so │ │ │ │ │ ├── libnsl.so.1 │ │ │ │ │ ├── libnss_compat-2.27.so │ │ │ │ │ ├── libnss_compat.so.2 │ │ │ │ │ ├── libnss_dns-2.27.so │ │ │ │ │ ├── libnss_dns.so.2 │ │ │ │ │ ├── libnss_files-2.27.so │ │ │ │ │ ├── libnss_files.so.2 │ │ │ │ │ ├── libnss_hesiod-2.27.so │ │ │ │ │ ├── libnss_hesiod.so.2 │ │ │ │ │ ├── libnss_nis-2.27.so │ │ │ │ │ ├── libnss_nis.so.2 │ │ │ │ │ ├── libnss_nisplus-2.27.so │ │ │ │ │ ├── libnss_nisplus.so.2 │ │ │ │ │ ├── libpcprofile.so │ │ │ │ │ ├── libpcre.so.3 │ │ │ │ │ ├── libpthread-2.27.so │ │ │ │ │ ├── libpthread.so.0 │ │ │ │ │ ├── libresolv-2.27.so │ │ │ │ │ ├── libresolv.so.2 │ │ │ │ │ ├── librt-2.27.so │ │ │ │ │ ├── librt.so.1 │ │ │ │ │ ├── libselinux.so.1 │ │ │ │ │ ├── libstdc++.so.6 │ │ │ │ │ ├── libthread_db-1.0.so │ │ │ │ │ ├── libthread_db.so.1 │ │ │ │ │ ├── libutil-2.27.so │ │ │ │ │ └── libutil.so.1 │ │ │ │ └── x86_64-linux-gnu │ │ │ │ │ └── libc.so.6 │ │ │ ├── lib64 │ │ │ │ └── ld-linux-x86-64.so.2 │ │ │ └── usr │ │ │ │ └── lib │ │ │ │ └── i386-linux-gnu │ │ │ │ └── libstdc++.so.6 │ │ └── linux-x86 │ │ │ ├── etc │ │ │ ├── hosts │ │ │ ├── ld.so.cache │ │ │ └── resolv.conf │ │ │ └── lib │ │ │ ├── i386-linux-gnu │ │ │ ├── ld-2.27.so │ │ │ ├── ld-linux.so.2 │ │ │ ├── libBrokenLocale-2.27.so │ │ │ ├── libBrokenLocale.so.1 │ │ │ ├── libSegFault.so │ │ │ ├── libanl-2.27.so │ │ │ ├── libanl.so.1 │ │ │ ├── libc-2.27.so │ │ │ ├── libc.so.6 │ │ │ ├── libcidn-2.27.so │ │ │ ├── libcidn.so.1 │ │ │ ├── libcrypt-2.27.so │ │ │ ├── libcrypt.so.1 │ │ │ ├── libdl-2.27.so │ │ │ ├── libdl.so.2 │ │ │ ├── libgcc_s.so.1 │ │ │ ├── libm-2.27.so │ │ │ ├── libm.so.6 │ │ │ ├── libmemusage.so │ │ │ ├── libnsl-2.27.so │ │ │ ├── libnsl.so.1 │ │ │ ├── libnss_compat-2.27.so │ │ │ ├── libnss_compat.so.2 │ │ │ ├── libnss_dns-2.27.so │ │ │ ├── libnss_dns.so.2 │ │ │ ├── libnss_files-2.27.so │ │ │ ├── libnss_files.so.2 │ │ │ ├── libnss_hesiod-2.27.so │ │ │ ├── libnss_hesiod.so.2 │ │ │ ├── libnss_nis-2.27.so │ │ │ ├── libnss_nis.so.2 │ │ │ ├── libnss_nisplus-2.27.so │ │ │ ├── libnss_nisplus.so.2 │ │ │ ├── libpcprofile.so │ │ │ ├── libpcre.so.3 │ │ │ ├── libpthread-2.27.so │ │ │ ├── libpthread.so.0 │ │ │ ├── libresolv-2.27.so │ │ │ ├── libresolv.so.2 │ │ │ ├── librt-2.27.so │ │ │ ├── librt.so.1 │ │ │ ├── libselinux.so.1 │ │ │ ├── libstdc++.so.6 │ │ │ ├── libthread_db-1.0.so │ │ │ ├── libthread_db.so.1 │ │ │ ├── libutil-2.27.so │ │ │ └── libutil.so.1 │ │ │ └── ld-linux.so.2 │ ├── platforms │ │ └── linux │ │ │ ├── __init__.py │ │ │ ├── kernel.py │ │ │ ├── linux.py │ │ │ ├── loader.py │ │ │ ├── network.py │ │ │ ├── parse.py │ │ │ ├── signals.py │ │ │ ├── syscalls │ │ │ ├── __init__.py │ │ │ ├── arg_strings.py │ │ │ ├── syscall_structs.py │ │ │ ├── syscall_utils.py │ │ │ ├── syscalls.py │ │ │ ├── syscalls_const.py │ │ │ ├── syscalls_socket.py │ │ │ └── syscalls_table.py │ │ │ └── test_network.py │ └── plugins │ │ ├── overlay │ │ ├── __init__.py │ │ ├── overlay.py │ │ └── zelos_ida.py │ │ ├── runner.py │ │ ├── syscall_limiter.py │ │ ├── trace.py │ │ └── yarascan │ │ ├── __init__.py │ │ ├── __main__.py │ │ └── yarascan.py │ ├── feeds.py │ ├── file_system.py │ ├── handles │ ├── __init__.py │ ├── base_handles.py │ └── pipe.py │ ├── hooks.py │ ├── manager.py │ ├── memory.py │ ├── modules.py │ ├── network │ ├── __init__.py │ ├── base_socket.py │ ├── dns.py │ └── network.py │ ├── plugin │ ├── __init__.py │ ├── arg_base.py │ ├── kernel_base.py │ ├── loader_base.py │ ├── parser_base.py │ └── plugin.py │ ├── processes.py │ ├── scheduler.py │ ├── state.py │ ├── symbol_manager.py │ ├── threads.py │ ├── tools │ └── zdbserver │ │ ├── README.md │ │ ├── __init__.py │ │ ├── __main__.py │ │ └── zdbserver.py │ ├── triggers.py │ ├── util.py │ └── zml.py ├── tests ├── __init__.py ├── data │ ├── call_mmap1_i386 │ ├── date │ ├── dns_socket_test │ ├── dynamic_elf_arm_helloworld │ ├── dynamic_elf_heap_overflow │ ├── dynamic_elf_helloworld │ ├── dynamic_elf_x64_helloworld │ ├── errno_mips_example │ ├── ld-linux.so │ ├── ltp_x64 │ │ └── syscalls │ │ │ ├── brk01 │ │ │ ├── chdir01 │ │ │ ├── chdir02 │ │ │ ├── chdir03 │ │ │ ├── chdir04 │ │ │ ├── fork01 │ │ │ ├── fork02 │ │ │ ├── fork03 │ │ │ ├── fork04 │ │ │ ├── fork05 │ │ │ ├── fork06 │ │ │ ├── fork07 │ │ │ ├── fork08 │ │ │ ├── fork09 │ │ │ ├── fork10 │ │ │ ├── fork11 │ │ │ ├── fork12 │ │ │ ├── fork13 │ │ │ ├── fork14 │ │ │ ├── getpid01 │ │ │ ├── getpid02 │ │ │ ├── getppid01 │ │ │ ├── getppid02 │ │ │ ├── kill01 │ │ │ ├── kill02 │ │ │ ├── kill03 │ │ │ ├── kill04 │ │ │ ├── kill05 │ │ │ ├── kill06 │ │ │ ├── kill07 │ │ │ ├── kill08 │ │ │ ├── kill09 │ │ │ ├── kill10 │ │ │ ├── kill11 │ │ │ ├── kill12 │ │ │ ├── open01 │ │ │ ├── open02 │ │ │ ├── open03 │ │ │ ├── open04 │ │ │ ├── open05 │ │ │ ├── open06 │ │ │ ├── open07 │ │ │ ├── open08 │ │ │ ├── open09 │ │ │ ├── open10 │ │ │ ├── open11 │ │ │ ├── open12 │ │ │ ├── open12_child │ │ │ ├── open13 │ │ │ ├── open14 │ │ │ ├── openat01 │ │ │ ├── openat02 │ │ │ ├── openat02_child │ │ │ ├── openat03 │ │ │ ├── pipe01 │ │ │ ├── pipe02 │ │ │ ├── pipe03 │ │ │ ├── pipe04 │ │ │ ├── pipe05 │ │ │ ├── pipe06 │ │ │ ├── pipe07 │ │ │ ├── pipe08 │ │ │ ├── pipe09 │ │ │ ├── pread01 │ │ │ ├── read01 │ │ │ ├── read02 │ │ │ ├── read03 │ │ │ ├── read04 │ │ │ ├── rmdir01 │ │ │ ├── sbrk01 │ │ │ ├── sbrk02 │ │ │ ├── sbrk03 │ │ │ ├── vfork01 │ │ │ ├── vfork02 │ │ │ ├── write01 │ │ │ ├── write02 │ │ │ ├── write03 │ │ │ ├── write04 │ │ │ └── write05 │ ├── read_stdin │ ├── src │ │ ├── call_mmap1_i386.c │ │ ├── errno_example.c │ │ ├── heap_overflow.c │ │ ├── loaddll.c │ │ ├── multithread.c │ │ └── read_stdin.c │ ├── static-socket-x86-musl │ ├── static_elf_arm_helloworld │ ├── static_elf_helloworld │ ├── static_elf_mips_lsb_helloworld_mti │ ├── static_elf_mips_msb_helloworld_img │ ├── static_elf_mips_msb_helloworld_mti │ ├── static_elf_mipseb_mti_helloworld │ ├── static_elf_mipsel_mti_helloworld │ ├── static_elf_x64_helloworld │ └── x86_multithread ├── encrypt_test_file.py ├── plugins │ └── test_yarascan.py ├── test_api.py ├── test_args.py ├── test_config.py ├── test_emu_helper.py ├── test_feeds.py ├── test_file_system.py ├── test_handles.py ├── test_heap_manager.py ├── test_hook_manager.py ├── test_kernel.py ├── test_libutils.py ├── test_linux_arm.py ├── test_linux_mips.py ├── test_linux_x64.py ├── test_linux_x86.py ├── test_ltp_syscalls.py ├── test_memory_manager.py ├── test_overlay.py ├── test_processes.py ├── test_runner.py ├── test_script_interface.py ├── test_sockets.py ├── test_syscall_limiter.py ├── test_thread_manager.py ├── test_trace.py ├── test_unicorn.py ├── test_zelos_profile.py ├── test_zml.py └── tools │ └── test_zdbserver.py └── tox.ini /.coveragerc: -------------------------------------------------------------------------------- 1 | 2 | [run] 3 | branch = True 4 | concurrency = multiprocessing 5 | source = 6 | zelos 7 | 8 | [paths] 9 | source = 10 | src 11 | .tox/*/site-packages 12 | 13 | [report] 14 | show_missing = True 15 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = E203, W503 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # Distribution / packaging 7 | /.Python 8 | /build/ 9 | /develop-eggs/ 10 | /dist/ 11 | /downloads/ 12 | /eggs/ 13 | /.eggs/ 14 | /lib/ 15 | /lib64/ 16 | /parts/ 17 | /sdist/ 18 | /var/ 19 | /wheels/ 20 | /pip-wheel-metadata/ 21 | /share/python-wheels/ 22 | /*.egg-info/ 23 | /.installed.cfg 24 | /*.egg 25 | /MANIFEST 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | /*.manifest 31 | /*.spec 32 | 33 | # Installer logs 34 | /pip-log.txt 35 | /pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | /htmlcov/ 39 | /.tox/ 40 | /.nox/ 41 | /.coverage 42 | /.coverage.* 43 | /.cache 44 | /nosetests.xml 45 | /coverage.xml 46 | /*.cover 47 | /*.py,cover 48 | /.hypothesis/ 49 | /.pytest_cache/ 50 | 51 | # Translations 52 | /*.mo 53 | /*.pot 54 | 55 | # Scrapy stuff: 56 | /.scrapy 57 | 58 | # Sphinx documentation 59 | /docs/_build/ 60 | /docs/api/ 61 | /docs/log.txt 62 | /docs/README.md 63 | 64 | # PyBuilder 65 | /target/ 66 | 67 | # Jupyter Notebook 68 | /.ipynb_checkpoints 69 | 70 | # IPython 71 | /profile_default/ 72 | /ipython_config.py 73 | 74 | # pyenv 75 | /.python-version 76 | 77 | # pipenv 78 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 79 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 80 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 81 | # install all needed dependencies. 82 | #Pipfile.lock 83 | 84 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 85 | __pypackages__/ 86 | 87 | # Celery stuff 88 | /celerybeat-schedule 89 | /celerybeat.pid 90 | 91 | # SageMath parsed files 92 | /*.sage.py 93 | 94 | # Environments 95 | /.env 96 | /.venv 97 | /env 98 | /venv 99 | 100 | # Spyder project settings 101 | /.spyderproject 102 | /.spyproject 103 | 104 | # Rope project settings 105 | /.ropeproject 106 | 107 | # mkdocs documentation 108 | /site 109 | 110 | # mypy 111 | /.mypy_cache/ 112 | /.dmypy.json 113 | /dmypy.json 114 | 115 | # Pyre type checker 116 | /.pyre/ 117 | 118 | # Zelos 119 | /.vscode/* 120 | /settings.json 121 | **/sandbox/* 122 | 123 | # Mypy type checking 124 | /*.mypy_cache/* 125 | 126 | # pyenv local settings 127 | /.python-version 128 | 129 | # pyinstaller 130 | /build/* 131 | /dist/* 132 | 133 | # ida files 134 | *.i64 135 | *.idb 136 | *.id0 137 | *.id1 138 | *.id2 139 | *.nam 140 | *.til 141 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/psf/black 3 | rev: 19.3b0 4 | hooks: 5 | - id: black 6 | language_version: python3 7 | # override until resolved: https://github.com/ambv/black/issues/402 8 | files: \.pyi?$ 9 | types: [] 10 | 11 | - repo: https://gitlab.com/pycqa/flake8 12 | rev: 3.7.8 13 | hooks: 14 | - id: flake8 15 | language_version: python3 16 | 17 | - repo: https://github.com/asottile/seed-isort-config 18 | rev: v1.9.3 19 | hooks: 20 | - id: seed-isort-config 21 | args: [--exclude=examples/.*\.py] 22 | 23 | - repo: https://github.com/pre-commit/mirrors-isort 24 | rev: v4.3.21 25 | hooks: 26 | - id: isort 27 | additional_dependencies: [toml] 28 | language_version: python3 29 | 30 | - repo: https://github.com/pre-commit/pre-commit-hooks 31 | rev: v2.3.0 32 | hooks: 33 | - id: trailing-whitespace 34 | - id: end-of-file-fixer 35 | - id: debug-statements 36 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | python: 4 | version: 3.7 5 | 6 | install: 7 | - method: pip 8 | path: . 9 | extra_requirements: 10 | - docs 11 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | # The Core Zelos Team 2 | 3 | * [Kevin Valakuzhy](//www.linkedin.com/in/kevin-valakuzhy-319a5447/) - Research Engineer, Developer 4 | * [Ryan C. Court](//www.linkedin.com/in/rccourt) - Research Engineer, Developer 5 | * [Kevin Z. Snow](//www.linkedin.com/in/kevinsnow/) - Co-Founder, Developer 6 | 7 | ### Special Thanks To 8 | 9 | * Fabian Monrose - Co-Founder 10 | * Ann Cox - DHS Program Manager 11 | * Angelos Keromytis - DARPA Program Manager (Former) 12 | * Dustin Fraze - DARPA Program Manager 13 | * Suyup Kim - Intern 14 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [Version 0.2.0] - 2020-08-04 9 | 10 | ### Added 11 | 12 | - Plugins: Yarascan 13 | - Introduction of Zelos Manipulation Language (ZML), used for specifying events on the command line and in scripts. New zml_hook function in api 14 | - Ability to redirect input to stdin 15 | - Hooks for internal memory reads, writes, and maps 16 | - Linked to crashd plugin, containing separate plugins for heap memory guards, static analysis via IDA Pro, and dataflow using QEMU TCG 17 | 18 | ### Changed 19 | 20 | - Moved to different command line flags for specifying what degree of information (instructions or syscalls) is printed while running 21 | - Better support for lists in command line arguments 22 | - Flags can be passed to the emulated program via the command line 23 | - Misc. bug fixes (thanks to seth1002) 24 | - General improvements to syscalls 25 | 26 | ### Removed 27 | 28 | - Verbosity command line flag (now handled via other flags) 29 | 30 | ## [Version 0.1.0] - 2020-05-29 31 | 32 | ### Added 33 | 34 | - Plugins: IDA overlays, remote debug server 35 | - Additional plugin APIs 36 | 37 | ### Changed 38 | 39 | - Minor syscall emulation improvements 40 | - Memory management overhaul 41 | 42 | ### Removed 43 | 44 | - N/A 45 | 46 | ## [Version 0.0.1] - 2020-03-03 47 | 48 | ### Added 49 | 50 | - N/A 51 | 52 | ### Changed 53 | 54 | - Updated documentation 55 | 56 | ### Removed 57 | 58 | - N/A 59 | 60 | ## [Version 0.0.0] - 2020-03-02 61 | 62 | Initial public release. 63 | 64 | ### Added 65 | 66 | - Initial open source commit. 67 | 68 | ### Changed 69 | 70 | - N/A 71 | 72 | ### Removed 73 | 74 | - N/A 75 | 76 | [0.0.0]: https://github.com/zeropointdynamics/zelos/releases/tag/v0.0.0 77 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:bionic 2 | MAINTAINER "Kevin Z. Snow " 3 | 4 | RUN apt-get update && \ 5 | apt-get -y upgrade && \ 6 | apt-get install -y python3 python3-pip python3-venv git cmake 7 | 8 | RUN useradd -s /bin/bash -m zelos 9 | RUN su - zelos -c "python3 -m venv /home/zelos/.venv/zelos" 10 | RUN su - zelos -c "source /home/zelos/.venv/zelos/bin/activate && git clone https://github.com/zeropointdynamics/zelos && cd zelos && pip install -e '.[dev]'" 11 | RUN su - zelos -c "echo 'source /home/zelos/.venv/zelos/bin/activate' >> /home/zelos/.bashrc" 12 | CMD su - zelos 13 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | graft src/zelos 2 | 3 | include LICENSE *.md *.toml *.yml *.yaml *.ini .flake8 4 | graft .github 5 | 6 | # Tests 7 | include tox.ini .coveragerc conftest.py 8 | recursive-include tests *.py 9 | 10 | # Documentation 11 | include docs/Makefile docs/make.bat requirements.txt 12 | recursive-include docs *.png 13 | recursive-include docs *.svg 14 | recursive-include docs *.ico 15 | recursive-include docs *.py 16 | recursive-include docs *.rst 17 | recursive-include docs *.md 18 | prune docs/_build 19 | prune docs/api 20 | 21 | # added by check_manifest.py 22 | include Dockerfile 23 | recursive-include tests *.c 24 | recursive-include tests *.so 25 | 26 | # Ignore 27 | global-exclude *.py[co] 28 | global-exclude __pycache__ 29 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | --- 2 | trigger: 3 | - master 4 | 5 | jobs: 6 | - job: 'Test' 7 | pool: 8 | vmImage: 'ubuntu-latest' 9 | strategy: 10 | matrix: 11 | Lint: 12 | python.version: '3.6' 13 | tox.env: lint 14 | 15 | py36: 16 | python.version: '3.6' 17 | tox.env: py36 18 | py37: 19 | python.version: '3.7' 20 | tox.env: py37 21 | py38: 22 | python.version: '3.8' 23 | tox.env: py38 24 | 25 | # pypy3: 26 | # python.version: 'pypy3' 27 | # tox.env: pypy3 28 | 29 | Docs: 30 | python.version: '3.6' 31 | tox.env: docs 32 | PyPI-Description: 33 | python.version: '3.7' 34 | tox.env: pypi-description 35 | 36 | steps: 37 | - task: UsePythonVersion@0 38 | displayName: Get Python for Python tools. 39 | inputs: 40 | versionSpec: '3.7' 41 | addToPath: false 42 | name: pyTools 43 | 44 | - script: $(pyTools.pythonLocation)/bin/pip install --upgrade tox 45 | displayName: Install Python-based tools. 46 | 47 | - task: UsePythonVersion@0 48 | inputs: 49 | versionSpec: '$(python.version)' 50 | architecture: 'x64' 51 | # condition: not(in(variables['python.version'], '3.8')) 52 | displayName: Use cached Python $(python.version) for tests. 53 | 54 | # - script: | 55 | # sudo add-apt-repository ppa:deadsnakes 56 | # sudo apt-get update 57 | # sudo apt-get install -y --no-install-recommends python$(python.version)-dev python$(python.version)-distutils 58 | # condition: in(variables['python.version'], '3.8') 59 | # displayName: Install Python $(python.version) from the deadsnakes PPA for tests. 60 | 61 | - script: $(pyTools.pythonLocation)/bin/tox -e $(tox.env) 62 | env: 63 | TOX_AP_TEST_EXTRAS: azure-pipelines 64 | displayName: run tox -e $(tox.env) 65 | 66 | - script: | 67 | if [ ! -f .coverage.* ]; then 68 | echo No coverage data found. 69 | exit 0 70 | fi 71 | 72 | # codecov shells out to "coverage" and avoiding 'sudo pip' allows for 73 | # package caching. 74 | PATH=$HOME/.local/bin:$PATH 75 | 76 | case "$(python.version)" in 77 | "pypy2") PY=pypy ;; 78 | "pypy3") PY=pypy3 ;; 79 | *) PY=python$(python.version) ;; 80 | esac 81 | 82 | # Python 3.8 needs an up-to-date pip. 83 | if [ "$(python.version)" = "3.8" ]; then 84 | curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 85 | $PY get-pip.py --user 86 | fi 87 | 88 | $PY -m pip install --user coverage codecov 89 | 90 | coverage combine 91 | codecov 92 | env: 93 | CODECOV_TOKEN: $(CODECOV_TOKEN) 94 | 95 | displayName: Report Coverage 96 | condition: succeeded() 97 | 98 | 99 | - job: 'Windows' 100 | pool: 101 | vmImage: 'windows-latest' 102 | strategy: 103 | matrix: 104 | py36: 105 | python.version: '3.6' 106 | 107 | steps: 108 | - task: UsePythonVersion@0 109 | inputs: 110 | versionSpec: '$(python.version)' 111 | architecture: 'x64' 112 | displayName: Use cached Python $(python.version) for tests. 113 | 114 | - script: python -m pip install -e .[dev] 115 | displayName: Install package in dev mode. 116 | 117 | - script: python -m pytest 118 | displayName: Run tests. 119 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | --- 2 | comment: false 3 | coverage: 4 | status: 5 | project: 6 | default: 7 | target: auto 8 | -------------------------------------------------------------------------------- /conftest.py: -------------------------------------------------------------------------------- 1 | import contextlib 2 | import os 3 | 4 | import filelock 5 | import pytest 6 | 7 | from hypothesis import HealthCheck, settings 8 | 9 | 10 | def pytest_configure(config): 11 | # HealthCheck.too_slow causes more trouble than good -- especially in CIs. 12 | settings.register_profile( 13 | "patience", settings(suppress_health_check=[HealthCheck.too_slow]) 14 | ) 15 | settings.load_profile("patience") 16 | 17 | 18 | @pytest.fixture(scope="session") 19 | def lock(tmp_path_factory): 20 | base_temp = tmp_path_factory.getbasetemp() 21 | lock_file = base_temp.parent / "serial.lock" 22 | yield filelock.FileLock(lock_file=str(lock_file)) 23 | with contextlib.suppress(OSError): 24 | os.remove(path=lock_file) 25 | 26 | 27 | @pytest.fixture() 28 | def serial(lock): 29 | with lock.acquire(poll_intervall=0.1): 30 | yield 31 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= -w log.txt -W -n -T 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_static/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/docs/_static/demo.gif -------------------------------------------------------------------------------- /docs/_static/hello_zelos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/docs/_static/hello_zelos.png -------------------------------------------------------------------------------- /docs/_static/plugin_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/docs/_static/plugin_active.png -------------------------------------------------------------------------------- /docs/_static/plugin_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/docs/_static/plugin_select.png -------------------------------------------------------------------------------- /docs/_static/zelos/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/docs/_static/zelos/favicon.ico -------------------------------------------------------------------------------- /docs/_static/zelos/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/docs/_static/zelos/logo.png -------------------------------------------------------------------------------- /docs/args/args.rst: -------------------------------------------------------------------------------- 1 | .. _flag-label: 2 | 3 | Flags 4 | ================= 5 | 6 | Available Flags & Usage 7 | ----------------------- 8 | 9 | .. argparse:: 10 | :ref: zelos.config_gen.generate_parser 11 | :prog: zelos 12 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # This file only contains a selection of the most common options. For a full 4 | # list see the documentation: 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 6 | 7 | # -- Path setup -------------------------------------------------------------- 8 | 9 | # If extensions (or modules to document with autodoc) are in another directory, 10 | # add these directories to sys.path here. If the directory is relative to the 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. 12 | # 13 | 14 | import os 15 | import shutil 16 | import sys 17 | 18 | # The theme to use for HTML and HTML Help pages. See the documentation for 19 | # a list of builtin themes. 20 | # 21 | import sphinx_rtd_theme 22 | 23 | from recommonmark.transform import AutoStructify 24 | 25 | 26 | sys.path.insert(0, os.path.abspath("../")) 27 | 28 | 29 | shutil.copyfile(os.path.join("..", "README.md"), "README.md") 30 | 31 | # -- Project information ----------------------------------------------------- 32 | 33 | project = "Zelos" 34 | copyright = "2020, Zeropoint Dynamics" 35 | author = "Zeropoint Dynamics" 36 | 37 | 38 | # -- General configuration --------------------------------------------------- 39 | 40 | # Add any Sphinx extension module names here, as strings. They can be 41 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 42 | # ones. 43 | extensions = [ 44 | "sphinx.ext.mathjax", 45 | "sphinx.ext.autodoc", 46 | "sphinx.ext.todo", 47 | # 'sphinx.ext.viewcode', 48 | "sphinx.ext.napoleon", 49 | "recommonmark", 50 | "sphinxcontrib.apidoc", 51 | "sphinx.ext.doctest", 52 | "sphinx.ext.todo", 53 | "sphinx.ext.intersphinx", 54 | "sphinxarg.ext", 55 | ] 56 | 57 | intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} 58 | 59 | # Add any paths that contain templates here, relative to this directory. 60 | templates_path = ["_templates"] 61 | 62 | # List of patterns, relative to source directory, that match files and 63 | # directories to ignore when looking for source files. 64 | # This pattern also affects html_static_path and html_extra_path. 65 | exclude_patterns = [ 66 | "_build", 67 | "Thumbs.db", 68 | ".DS_Store", 69 | "api/zelos.lib.*", 70 | "api/zelos.regipy.*", 71 | "api/zelos.unicorn.rst", 72 | "api/zelos.lief.rst", 73 | "api/modules.rst", 74 | ] 75 | 76 | apidoc_module_dir = "../src/zelos" 77 | apidoc_output_dir = "api" 78 | apidoc_excluded_paths = ["lib", "regipy", "unicorn", "lief"] 79 | apidoc_separate_modules = True 80 | 81 | nitpick_ignore = [ 82 | ("py:class", "Any value"), 83 | ("py:class", "callable"), 84 | ("py:class", "callables"), 85 | ("py:class", "tuple of types"), 86 | ("py:class", "object"), 87 | ("py:class", "lark.visitors.Transformer"), 88 | ] 89 | 90 | # -- Options for HTML output ------------------------------------------------- 91 | 92 | 93 | html_theme = "sphinx_rtd_theme" 94 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] 95 | 96 | 97 | # Add any paths that contain custom static files (such as style sheets) here, 98 | # relative to this directory. They are copied after the builtin static files, 99 | # so a file named "default.css" will overwrite the builtin "default.css". 100 | html_static_path = ["_static"] 101 | 102 | html_logo = "_static/zelos/logo.png" 103 | html_favicon = "_static/zelos/favicon.ico" 104 | autodoc_member_order = "bysource" 105 | 106 | 107 | # Setup AutoStructify 108 | def setup(app): 109 | app.add_config_value( 110 | "recommonmark_config", {"auto_toc_tree_section": "Contents"}, True 111 | ) 112 | app.add_transform(AutoStructify) 113 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Zelos Documentation 2 | ================================= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | ./README.md 8 | 9 | 10 | .. toctree:: 11 | :caption: Tutorials 12 | :maxdepth: 1 13 | 14 | tutorials/01_cmdline 15 | tutorials/02_scripting 16 | tutorials/03_using_hooks 17 | tutorials/04_writing_plugins 18 | tutorials/05_syscall_limit_plugin 19 | tutorials/06_snapshot_overlay 20 | tutorials/07_zml_and_feeds 21 | 22 | 23 | .. toctree:: 24 | :caption: Script API 25 | :maxdepth: 1 26 | 27 | api/zelos.api 28 | args/args 29 | 30 | .. toctree:: 31 | :caption: Internal Package Docs 32 | :maxdepth: 1 33 | 34 | api/zelos 35 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/tutorials/01_cmdline.md: -------------------------------------------------------------------------------- 1 | # 01 - Command Line Use 2 | 3 | To emulate a binary with default options: 4 | 5 | ```console 6 | $ zelos my_binary 7 | ``` 8 | 9 | To emulate a binary and view the instructions being executed, add the `-v` flag: 10 | ```console 11 | $ zelos -v my_binary 12 | ``` 13 | 14 | To print only the *first* time an instruction is executed, rather than *every* instruction, using the `--fasttrace` flag: 15 | ```console 16 | $ zelos -v --fasttrace my_binary 17 | ``` 18 | 19 | To write output to a file use the `--trace_file` flag: 20 | ```console 21 | $ zelos --trace_file /path/to/file my_binary 22 | ``` 23 | 24 | To provide command line arguments to the emulated binary, specify them after the binary name: 25 | ```console 26 | $ zelos my_binary arg1 arg2 27 | ``` 28 | 29 | To log various Zelos-related debug information, you can specify log level with flag `--log` and specify one of the options from 'info', 'verbose', 'debug', 'spam', 'notice', 'warning', 'success', 'error', or 'fatal'. The default options is 'info'. 30 | ```console 31 | $ zelos --log debug my_binary 32 | ``` 33 | 34 | To specify a timeout in seconds, after which emulation will stop, use the flag `-t`: 35 | ```console 36 | $ zelos -t 10 my_binary 37 | ``` 38 | 39 | To specify a memory limit in mb, after which an exception is thrown an emulation will stop, use the flag `m`: 40 | ```console 41 | $ zelos -m 1024 my_binary 42 | ``` 43 | 44 | To specify a virtual filename, the name that will be used for the binary during emulation, use the `--virtual_filename` flag: 45 | ```console 46 | $ zelos --virtual_filename virtualname my_binary 47 | ``` 48 | 49 | To specify a virtual file path, the path that will be used for the binary during emulation, use the `--virtual_path` flag: 50 | ```console 51 | $ zelos --virtual_path /home/admin/ my_binary 52 | ``` 53 | 54 | To specify environment variables to use during emulation, use the `--env_vars` (`-ev`) flag. This can be specified multiple times to set multiple environment variables: 55 | ```console 56 | $ zelos --env_vars FOO=bar --env_vars LOREM=ipsum my_binary 57 | ``` 58 | 59 | To specify the date in YYYY-MM-DD format, use the `--date` flag. This is primarily used when emulating date-related system calls such as __time__ and __gettimeofday__. 60 | ```console 61 | $ zelos --date 2020-03-04 my_binary 62 | ``` 63 | 64 | To see an example of the above, you can use zelos to emulate the `date` GNU coreutil. This is included on most linux systems at `/bin/date`. The source code for `date` is available [here](https://github.com/coreutils/coreutils/blob/master/src/date.c). 65 | ``` 66 | $ zelos --date 2020-03-04 /bin/date 67 | ``` 68 | 69 | To mount a specified file or path into the emulated filesystem, use the `--mount` flag. The format is `--mount ARCH,DEST,SRC`. `ARCH` is one of `x86`, `x86-64`, `arm`, or `mips`. `DEST` is the emulated path to mount the specified `SRC`. `SRC` is the absolute host path to the file or path to mount. 70 | ``` 71 | $ zelos --mount x86,/path/to/dest,/path/to/src my_binary 72 | ``` 73 | 74 | To specify a directory to use as the rootfs directory during emulation of a linux system, use `--linux_rootfs` flag. The format is `--linux_rootfs ARCH,PATH`. `ARCH` is one of `x86`, `x86-64`, `arm`, or `mips`. `PATH` is the absolute host path to the directory to be used as rootfs. For example, if you were running Zelos on a linux host machine, and you wanted to use your own root filesystem as the emulated rootfs, you would do the following: 75 | ```console 76 | $ zelos --linux_rootfs x86,/ my_binary 77 | ``` 78 | -------------------------------------------------------------------------------- /docs/tutorials/zelos_feeds_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/docs/tutorials/zelos_feeds_diagram.png -------------------------------------------------------------------------------- /examples/hello/README.md: -------------------------------------------------------------------------------- 1 | ## Hello Zelos 2 | 3 | The sources for this example can be found at 4 | https://github.com/zeropointdynamics/zelos/tree/master/examples/hello 5 | 6 | To emulate a binary with Zelos: 7 | 8 | ```python 9 | from zelos import Zelos 10 | 11 | z = Zelos("hello.bin") 12 | z.start() 13 | ``` 14 | 15 | Which produces the following output 16 | 17 | ``` 18 | [main] [SYSCALL] brk ( addr=0x0 ) -> 90000038 19 | [main] [SYSCALL] brk ( addr=0x90001238 ) -> 90001238 20 | [main] [SYSCALL] arch_prctl ( option=0x1002 (ARCH_SET_FS), addr=0x90000900 ) -> 0 21 | [main] [SYSCALL] uname ( buf=0xff08eae0 ) -> 0 22 | [main] [SYSCALL] readlink ( pathname=0x57ee83 ("/proc/self/exe"), buf=0xff08dc10, bufsiz=0x1000 ) -> 31 23 | [main] [SYSCALL] brk ( addr=0x90022238 ) -> 90022238 24 | [main] [SYSCALL] brk ( addr=0x90023000 ) -> 90023000 25 | [main] [SYSCALL] access ( pathname=0x57ea5a ("/etc/ld.so.nohwcap"), mode=0x0 ) -> -1 26 | [main] [SYSCALL] fstat ( fd=0x1 (stdout), statbuf=0xff08ea50 ) -> 0 27 | IOCTL: 0 28 | [main] [SYSCALL] ioctl ( fd=0x1 (stdout), request=0x5401, data=0xff08e9b0 ) -> -1 29 | [StdOut]: 'bytearray(b'Hello, Zelos!\n')' 30 | [main] [SYSCALL] write ( fd=0x1 (stdout), buf=0x900132d0 ("Hello, Zelos!\n"), count=0xe ) -> e 31 | 16:36:17:threads___:SUCCES:Done executing thread main 32 | [main] [SYSCALL] exit_group ( status=0x0 ) -> void 33 | ``` 34 | -------------------------------------------------------------------------------- /examples/hello/hello.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/examples/hello/hello.bin -------------------------------------------------------------------------------- /examples/hello/hello.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | from os import path 19 | 20 | from zelos import Zelos 21 | 22 | 23 | DATA_DIR = path.dirname(path.abspath(__file__)) 24 | 25 | 26 | # Initialize Zelos 27 | z = Zelos(path.join(DATA_DIR, "hello.bin")) 28 | # Start Execution 29 | z.start() 30 | -------------------------------------------------------------------------------- /examples/inmemory_strings/pwnablekr_flag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/examples/inmemory_strings/pwnablekr_flag -------------------------------------------------------------------------------- /examples/inmemory_strings/strings_plugin.py: -------------------------------------------------------------------------------- 1 | from zelos import CommandLineOption, HookType, IPlugin, Zelos 2 | 3 | 4 | """ 5 | # tl;dr 6 | 7 | This is a copy of the strings_script.py file, except written as a Zelos 8 | plugin. In order to include this plugin, you must either 9 | 10 | * copy this file into the zelos/ext/plugins folder 11 | * specify the containing folder in the ZELOS_PLUGIN_DIR environment 12 | variable 13 | 14 | 15 | """ 16 | 17 | CommandLineOption( 18 | "print_strings", 19 | type=int, 20 | default=None, 21 | help="The minimum size of string to identify", 22 | ) 23 | 24 | 25 | class StringCollectorPlugin(IPlugin): 26 | NAME = "strings" 27 | """ 28 | Identifies strings that are written in-memory. We identify strings by the 29 | observation that when they are written to memory 30 | * They are comprised of valid utf-8 bytes 31 | * The string is written in sequential chunks. 32 | 33 | This runs into some false positives with data that happens to be 34 | valid utf-8. To reduce false positives we observe that 35 | * Strings often end at the first null byte. 36 | * False positives are often short strings. There is a higher 37 | chance that 2 consecutive characters are valid utf-8 than 38 | 4 consecutive characters. 39 | 40 | """ 41 | 42 | def __init__(self, z: Zelos): 43 | super().__init__(z) 44 | if z.config.print_strings: 45 | z.hook_memory( 46 | HookType.MEMORY.WRITE, 47 | self.collect_writes, 48 | name="strings_syscall_hook", 49 | ) 50 | self._min_len = z.config.print_strings 51 | self._current_string = "" 52 | self._next_addr = 0 53 | 54 | def collect_writes(self, zelos, access, address, size, value): 55 | """ 56 | Collects strings that are written to memory. Intended to be used 57 | as a callback in a Zelos HookType.MEMORY hook. 58 | """ 59 | data = zelos.memory.pack(value) 60 | try: 61 | decoded_data = data.decode() 62 | except UnicodeDecodeError: 63 | self._next_addr = 0 64 | self._end_current_string() 65 | return 66 | decoded_data = decoded_data[:size] 67 | 68 | first_null_byte = decoded_data.find("\x00") 69 | if first_null_byte != -1: 70 | decoded_data = decoded_data[:first_null_byte] 71 | self._current_string += decoded_data 72 | self._next_addr = 0 73 | self._end_current_string() 74 | return 75 | 76 | if address != self._next_addr: 77 | self._end_current_string() 78 | 79 | self._next_addr = address + size 80 | self._current_string += decoded_data 81 | return 82 | 83 | def _end_current_string(self) -> None: 84 | """ 85 | Ends the currently identified string. May save the string if it 86 | looks legit enough. 87 | """ 88 | if len(self._current_string) >= self._min_len: 89 | print(f'Found string: "{self._current_string}"') 90 | self._current_string = "" 91 | -------------------------------------------------------------------------------- /examples/script_brute/brute.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | from os import path 19 | 20 | from zelos import Zelos 21 | 22 | 23 | DATA_DIR = path.dirname(path.abspath(__file__)) 24 | 25 | 26 | def brute(): 27 | z = Zelos(path.join(DATA_DIR, "password.bin"), inst=True) 28 | # The address of strcmp observed above 29 | strcmp_address = 0x00400BB6 30 | # run to the address of call to strcmp and break 31 | z.set_breakpoint(strcmp_address, True) 32 | z.start() 33 | 34 | # Execution is now STOPPED at address 0x00400BB6 35 | 36 | # get initial reg values of rdi & rsi before strcmp is called 37 | rdi = z.regs.rdi # user input 38 | rsi = z.regs.rsi # 'real' password 39 | 40 | # 'brute force' the correct string 41 | for i in range(9, -1, -1): 42 | 43 | # write our bruteforced guess to memory 44 | z.memory.write_string(rdi, str(i) + "point") 45 | 46 | # Address of the test instr 47 | test_address = 0x00400BBB 48 | # run to the address of test instr and break 49 | z.set_breakpoint(test_address, True) 50 | z.start() 51 | 52 | # execute one step, in this case the test instr 53 | z.step() 54 | 55 | # check the zf bit for result of test 56 | flags = z.regs.flags 57 | zf = (flags & 0x40) >> 6 58 | if zf == 1: 59 | # if correct, run to completion 60 | z.start() 61 | return 62 | 63 | # otherwise, reset ip to strcmp func & set regs 64 | z.regs.setIP(strcmp_address) 65 | z.regs.rdi = rdi 66 | z.regs.rsi = rsi 67 | 68 | 69 | if __name__ == "__main__": 70 | brute() 71 | -------------------------------------------------------------------------------- /examples/script_brute/password.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/examples/script_brute/password.bin -------------------------------------------------------------------------------- /examples/script_bypass/bypass.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | import sys 19 | 20 | from os import path 21 | 22 | from zelos import Zelos 23 | 24 | 25 | DATA_DIR = path.dirname(path.abspath(__file__)) 26 | 27 | 28 | def patch_mem(): 29 | z = Zelos(path.join(DATA_DIR, "password_check.bin")) 30 | # The address of the cmp instr 31 | target_address = 0x0040107C 32 | # run to the address of cmp and break 33 | z.set_breakpoint(target_address, True) 34 | z.start() 35 | 36 | # Execution is now STOPPED at address 0x0040107C 37 | 38 | # Write 0x0 to address [rbp - 0x38] 39 | z.memory.write_int(z.regs.rbp - 0x38, 0x0) 40 | # resume execution 41 | z.start() 42 | 43 | 44 | def patch_reg(): 45 | z = Zelos(path.join(DATA_DIR, "password_check.bin")) 46 | # The address of the first time eax is used above 47 | target_address = 0x00401810 48 | # run to the target address and break 49 | z.set_breakpoint(target_address, True) 50 | z.start() 51 | 52 | # Execution is now STOPPED at address 0x00401810 53 | 54 | # Set eax to 0x0 55 | z.regs.eax = 0x0 56 | # Resume execution 57 | z.start() 58 | 59 | 60 | def patch_code(): 61 | z = Zelos(path.join(DATA_DIR, "password_check.bin")) 62 | # The address of the cmp instr 63 | target_address = 0x0040107C 64 | # run to the address of cmp and break 65 | z.set_breakpoint(target_address, True) 66 | z.start() 67 | 68 | # Execution is now STOPPED at address 0x0040107C 69 | 70 | # Code we want to insert is: 71 | # NOP; NOP; CMP eax, eax; 72 | # 73 | # The assembled code is: 74 | encoding = [144, 144, 57, 192] 75 | 76 | # replace the four bytes at this location with our code 77 | for i in range(len(encoding)): 78 | z.memory.write_uint8(target_address + i, encoding[i]) 79 | 80 | # resume execution 81 | z.start() 82 | 83 | 84 | if __name__ == "__main__": 85 | fn = "mem" 86 | if len(sys.argv) > 1: 87 | if sys.argv[1] in ["mem", "reg", "code"]: 88 | fn = sys.argv[1] 89 | if fn == "mem": 90 | patch_mem() 91 | elif fn == "reg": 92 | patch_reg() 93 | else: 94 | patch_code() 95 | -------------------------------------------------------------------------------- /examples/script_bypass/password_check.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/examples/script_bypass/password_check.bin -------------------------------------------------------------------------------- /examples/test_examples.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import subprocess 18 | import unittest 19 | 20 | from os import path 21 | 22 | 23 | # from zelos.api.zelos_api import ZelosCmdline 24 | 25 | 26 | DATA_DIR = path.dirname(path.abspath(__file__)) 27 | 28 | 29 | class ExamplesTest(unittest.TestCase): 30 | # def test_inmemory_strings_script(self): 31 | # stdout = subprocess.check_output( 32 | # [ 33 | # "python", 34 | # path.join(DATA_DIR, "inmemory_strings", "strings_script.py"), 35 | # path.join(DATA_DIR, "inmemory_strings", "pwnablekr_flag"), 36 | # ] 37 | # ) 38 | 39 | # self.assertIn(b"UPX...? sounds like a delivery service :)", stdout) 40 | 41 | # def test_inmemory_strings_plugin(self): 42 | # os.environ["ZELOS_PLUGIN_DIR"] = path.join( 43 | # DATA_DIR, "inmemory_strings" 44 | # ) 45 | # filepath = path.join(DATA_DIR, "inmemory_strings", "pwnablekr_flag") 46 | 47 | # # sys.stdout = printed_output 48 | # z = ZelosCmdline(f"--print_strings 4 {filepath}") 49 | # z.start() 50 | 51 | # # This test doesn't work on windows. 52 | # # self.assertIn( 53 | # # "UPX...? sounds like a delivery service :)", 54 | # # printed_output.getvalue(), 55 | # # ) 56 | 57 | def test_hello(self): 58 | output = subprocess.check_output( 59 | ["python", path.join(DATA_DIR, "hello", "hello.py")] 60 | ) 61 | self.assertTrue("Hello, Zelos!" in str(output)) 62 | 63 | def test_brute(self): 64 | output = subprocess.check_output( 65 | ["python", path.join(DATA_DIR, "script_brute", "brute.py")] 66 | ) 67 | self.assertTrue("Correct!" in str(output)) 68 | 69 | def test_bypass_mem(self): 70 | output = subprocess.check_output( 71 | [ 72 | "python", 73 | path.join(DATA_DIR, "script_bypass", "bypass.py"), 74 | "mem", 75 | ] 76 | ) 77 | self.assertTrue("Correct!" in str(output)) 78 | 79 | def test_bypass_reg(self): 80 | output = subprocess.check_output( 81 | [ 82 | "python", 83 | path.join(DATA_DIR, "script_bypass", "bypass.py"), 84 | "reg", 85 | ] 86 | ) 87 | self.assertTrue("Correct!" in str(output)) 88 | 89 | def test_bypass_code(self): 90 | output = subprocess.check_output( 91 | [ 92 | "python", 93 | path.join(DATA_DIR, "script_bypass", "bypass.py"), 94 | "code", 95 | ] 96 | ) 97 | self.assertTrue("Correct!" in str(output)) 98 | 99 | 100 | def main(): 101 | unittest.main() 102 | 103 | 104 | if __name__ == "__main__": 105 | main() 106 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=40.6.0", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | 6 | [tool.black] 7 | line-length = 79 8 | target-version = ['py36', 'py37', 'py38'] 9 | 10 | [tool.isort] 11 | atomic=true 12 | force_grid_wrap=0 13 | include_trailing_comma=true 14 | lines_after_imports=2 15 | lines_between_types=1 16 | multi_line_output=3 17 | not_skip="__init__.py" 18 | use_parentheses=true 19 | 20 | known_first_party="zelos" 21 | known_third_party=["capstone", "colorama", "configargparse", "dnslib", "filelock", "hypothesis", "ida_kernwin", "idaapi", "idc", "lark", "lief", "mock", "pkg_resources", "pypacker", "pytest", "recommonmark", "setuptools", "sortedcontainers", "sphinx_rtd_theme", "termcolor", "verboselogs", "zebracorn", "zelos"] 22 | 23 | [tool.pytest] 24 | junit_family = "xunit2" 25 | -------------------------------------------------------------------------------- /src/zelos/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | __version__ = "0.2.1.dev0" 18 | 19 | __title__ = "zelos" 20 | __description__ = "A comprehensive binary emulation platform." 21 | __url__ = "https://github.com/zeropointdynamics/zelos" 22 | __uri__ = __url__ 23 | __doc__ = __description__ + " <" + __uri__ + ">" 24 | 25 | __author__ = "Zeropoint Dynamics" 26 | __email__ = "zelos@zeropointdynamics.com" 27 | 28 | __license__ = "AGPLv3" 29 | __copyright__ = "Copyright (c) 2017-2020 Zeropoint Dynamics" 30 | 31 | import os 32 | import sys 33 | 34 | import colorama 35 | 36 | from .api.zelos_api import Zelos, ZelosCmdline 37 | from .emulator.base import MemoryRegion 38 | from .engine import Engine 39 | from .exceptions import ( 40 | InvalidHookTypeException, 41 | InvalidRegException, 42 | OutOfMemoryException, 43 | UnsupportedBinaryError, 44 | ZelosException, 45 | ZelosLoadException, 46 | ZelosRuntimeException, 47 | ) 48 | from .hooks import HookType 49 | from .memory import ProtType 50 | from .plugin import CommandLineOption, IPlugin, ISubcommand 51 | 52 | 53 | __all__ = [ 54 | "Zelos", 55 | "ZelosCmdline", 56 | "Engine", 57 | "ZelosException", 58 | "ZelosLoadException", 59 | "ZelosRuntimeException", 60 | "InvalidRegException", 61 | "InvalidHookTypeException", 62 | "UnsupportedBinaryError", 63 | "OutOfMemoryException", 64 | "IPlugin", 65 | "ISubcommand", 66 | "CommandLineOption", 67 | "HookType", 68 | "ProtType", 69 | "MemoryRegion", 70 | ] 71 | 72 | """ Initialize colorama only once """ 73 | colorama.init() 74 | 75 | # FIXME for OSS release 76 | private_path = os.path.abspath( 77 | os.path.join( 78 | os.path.dirname(os.path.abspath(__file__)), 79 | os.pardir, 80 | os.pardir, 81 | os.pardir, 82 | ) 83 | ) 84 | sys.path.insert(0, private_path) 85 | -------------------------------------------------------------------------------- /src/zelos/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | 19 | def main(): 20 | import sys 21 | from zelos.api.zelos_api import ZelosCmdline 22 | 23 | z = ZelosCmdline(sys.argv[1:]) 24 | 25 | try: 26 | z.start(z.config.timeout) 27 | finally: 28 | z.internal_engine.close() 29 | 30 | 31 | if __name__ == "__main__": 32 | main() 33 | -------------------------------------------------------------------------------- /src/zelos/api/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | from .zelos_api import Zelos 18 | 19 | 20 | __all__ = ["Zelos"] 21 | -------------------------------------------------------------------------------- /src/zelos/emulator/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | from .base import create_emulator 18 | 19 | 20 | __all__ = ["create_emulator"] 21 | -------------------------------------------------------------------------------- /src/zelos/enums.py: -------------------------------------------------------------------------------- 1 | from enum import Enum, IntEnum, auto 2 | 3 | from zebracorn import ( 4 | UC_PROT_ALL, 5 | UC_PROT_EXEC, 6 | UC_PROT_NONE, 7 | UC_PROT_READ, 8 | UC_PROT_WRITE, 9 | ) 10 | 11 | 12 | class ProtType(IntEnum): 13 | NONE = UC_PROT_NONE 14 | READ = UC_PROT_READ 15 | WRITE = UC_PROT_WRITE 16 | EXEC = UC_PROT_EXEC 17 | RWX = UC_PROT_ALL 18 | RX = UC_PROT_READ | UC_PROT_EXEC 19 | RW = UC_PROT_READ | UC_PROT_WRITE 20 | 21 | 22 | class HookType: 23 | class MEMORY(Enum): 24 | """ 25 | Used by :py:meth:`zelos.Zelos.hook_memory` to specify the 26 | memory event to hook on. View the registration function for 27 | more details. 28 | 29 | INTERNAL_READ|INTERNAL_WRITE|INTERNAL_MAP are for hooking 30 | reads|writes|maps that are done by Zelos (such as those done 31 | within syscall implementations). Other read and writes only 32 | hook memory accesses done by instructions executed in the 33 | underlying emulator. 34 | 35 | The callback for INTERNAL_MAP does not provide the data for the 36 | mapping in the callback. This is because we didn't find an 37 | efficient way to do so, causing a drastic slowdown for hooks 38 | that didn't need the actual mapped data. 39 | """ 40 | 41 | READ = auto() 42 | WRITE = auto() 43 | READ_UNMAPPED = auto() 44 | WRITE_UNMAPPED = auto() 45 | READ_PROT = auto() 46 | WRITE_PROT = auto() 47 | READ_AFTER = auto() 48 | UNMAPPED = auto() 49 | PROT = auto() 50 | READ_INVALID = auto() 51 | WRITE_INVALID = auto() 52 | INVALID = auto() 53 | VALID = auto() 54 | 55 | INTERNAL_READ = auto() 56 | INTERNAL_WRITE = auto() 57 | INTERNAL_MAP = auto() 58 | 59 | class EXEC(Enum): 60 | """ 61 | Used by :py:meth:`zelos.Zelos.hook_execution`. 62 | If INST is chosen, the registered hook will be executed every 63 | time a single instruction is executed. 64 | 65 | If BLOCK is chosen, the registered hook will be executed after 66 | every block of instructions is executed. A block is interpreted 67 | as a contiguous sequence of code where only the last instruction 68 | can modify control flow, typically a branch or return 69 | instruction. 70 | 71 | View the registration function for more details. 72 | """ 73 | 74 | INST = auto() 75 | BLOCK = auto() 76 | 77 | class THREAD(Enum): 78 | """ 79 | Not usable yet through Zelos API 80 | """ 81 | 82 | CREATE = auto() 83 | SWAP = auto() 84 | DESTROY = auto() 85 | 86 | class PROCESS(Enum): 87 | """ 88 | Not usable yet through Zelos API 89 | """ 90 | 91 | CREATE = auto() 92 | SWAP = auto() 93 | DESTROY = auto() 94 | 95 | class SYSCALL(Enum): 96 | """ 97 | Used by :py:meth:`zelos.Zelos.hook_syscalls`. 98 | 99 | If AFTER is chosen, the hook will be triggered after the syscall 100 | hass been executed. 101 | 102 | View the registration function for more details. 103 | """ 104 | 105 | AFTER = auto() 106 | # TODO: support BEFORE to allow conditionally executing syscall. 107 | # BEFORE = auto() 108 | 109 | class _INST(Enum): 110 | """ 111 | HookTypes used for triggering on specific instructions. These 112 | are intended for internal use only. 113 | """ 114 | 115 | X86_SYSCALL = auto() 116 | 117 | class _OTHER(Enum): 118 | """ 119 | HookTypes that do not need to be specified since they have no 120 | options. Only used internally. 121 | """ 122 | 123 | CLOSE = auto() 124 | INTERRUPT = auto() 125 | EXCEPTION = auto() 126 | -------------------------------------------------------------------------------- /src/zelos/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | 19 | class ZelosException(Exception): 20 | pass 21 | 22 | 23 | class InvalidRegException(ZelosException): 24 | pass 25 | 26 | 27 | class ZelosLoadException(ZelosException): 28 | pass 29 | 30 | 31 | class ZelosRuntimeException(ZelosException): 32 | pass 33 | 34 | 35 | class InvalidHookTypeException(ZelosException): 36 | pass 37 | 38 | 39 | class UnsupportedBinaryError(ZelosException): 40 | pass 41 | 42 | 43 | class OutOfMemoryException(Exception): 44 | pass 45 | 46 | 47 | class MemoryWriteUnmapped(Exception): 48 | pass 49 | 50 | 51 | class MemoryReadUnmapped(Exception): 52 | pass 53 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost 2 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/etc/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 8.8.8.8 2 | options edns0 3 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/ld-linux-armhf.so.3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/ld-linux-armhf.so.3 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/ld-linux.so.3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/ld-linux.so.3 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/ld-uClibc-0.9.33.2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/ld-uClibc-0.9.33.2.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/ld-uClibc-1.0.31.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/ld-uClibc-1.0.31.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/ld-uClibc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/ld-uClibc.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/ld-uClibc.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/ld-uClibc.so.0 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/ld-uClibc.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/ld-uClibc.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libc++.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libc++.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libc.so: -------------------------------------------------------------------------------- 1 | /* GNU ld script 2 | * Use the shared library, but some functions are only in 3 | * the static library, so try that secondarily. */ 4 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", 5 | "elf32-littlearm") 6 | GROUP ( libc.so.1 uclibc_nonshared.a libpthread_nonshared.a AS_NEEDED ( ld-uClibc.so.1 ) ) 7 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libc.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libc.so.0 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libc.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libc.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libc.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libc.so.6 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libcrypt.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libcrypt.so.0 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libdl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libdl.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libgcc_s.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libgcc_s.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/liblog.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/liblog.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libm.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libm.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libm.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libm.so.0 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libstdc++.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libstdc++.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libuClibc-1.0.31.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libuClibc-1.0.31.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/lib/libz.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/lib/libz.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/proc/net/route: -------------------------------------------------------------------------------- 1 | Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT 2 | eth0 00000000 0100000A 0003 0 0 100 00000000 0 0 0 3 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/usr/lib/README.md: -------------------------------------------------------------------------------- 1 | These files were retrieved from the netgear-r9000-arm firmware given to V by Kevin over slack on Aug 21 2 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-armv7/usr/lib/libconfig.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-armv7/usr/lib/libconfig.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-mips/etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost 2 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-mips/etc/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 8.8.8.8 2 | options edns0 3 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost 2 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/etc/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 8.8.8.8 2 | options edns0 3 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/ld-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/ld-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/ld-linux.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/ld-linux.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libBrokenLocale-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libBrokenLocale-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libBrokenLocale.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libBrokenLocale.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libSegFault.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libSegFault.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libanl-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libanl-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libanl.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libanl.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libc-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libc-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libc.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libc.so.6 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libcidn-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libcidn-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libcidn.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libcidn.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libcrypt-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libcrypt-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libcrypt.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libcrypt.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libdl-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libdl-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libdl.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libdl.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libgcc_s.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libgcc_s.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libm-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libm-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libm.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libm.so.6 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libmemusage.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libmemusage.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnsl-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnsl-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnsl.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnsl.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_compat-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_compat-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_compat.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_compat.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_dns-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_dns-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_dns.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_dns.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_files-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_files-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_files.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_files.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_hesiod-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_hesiod-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_hesiod.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_hesiod.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_nis-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_nis-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_nis.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_nis.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_nisplus-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_nisplus-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_nisplus.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libnss_nisplus.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libpcprofile.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libpcprofile.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libpcre.so.3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libpcre.so.3 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libpthread-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libpthread-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libpthread.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libpthread.so.0 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libresolv-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libresolv-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libresolv.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libresolv.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/librt-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/librt-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/librt.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/librt.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libselinux.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libselinux.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libstdc++.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libstdc++.so.6 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libthread_db-1.0.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libthread_db-1.0.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libthread_db.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libthread_db.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libutil-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libutil-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libutil.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/i386-linux-gnu/libutil.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib/x86_64-linux-gnu/libc.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib/x86_64-linux-gnu/libc.so.6 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/lib64/ld-linux-x86-64.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/lib64/ld-linux-x86-64.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86-64/usr/lib/i386-linux-gnu/libstdc++.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86-64/usr/lib/i386-linux-gnu/libstdc++.so.6 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost 2 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/etc/ld.so.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/etc/ld.so.cache -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/etc/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 8.8.8.8 2 | options edns0 3 | -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/ld-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/ld-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/ld-linux.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/ld-linux.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libBrokenLocale-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libBrokenLocale-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libBrokenLocale.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libBrokenLocale.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libSegFault.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libSegFault.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libanl-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libanl-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libanl.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libanl.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libc-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libc-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libc.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libc.so.6 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libcidn-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libcidn-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libcidn.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libcidn.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libcrypt-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libcrypt-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libcrypt.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libcrypt.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libdl-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libdl-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libdl.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libdl.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libgcc_s.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libgcc_s.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libm-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libm-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libm.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libm.so.6 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libmemusage.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libmemusage.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnsl-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnsl-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnsl.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnsl.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_compat-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_compat-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_compat.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_compat.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_dns-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_dns-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_dns.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_dns.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_files-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_files-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_files.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_files.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_hesiod-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_hesiod-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_hesiod.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_hesiod.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_nis-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_nis-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_nis.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_nis.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_nisplus-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_nisplus-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_nisplus.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libnss_nisplus.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libpcprofile.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libpcprofile.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libpcre.so.3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libpcre.so.3 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libpthread-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libpthread-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libpthread.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libpthread.so.0 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libresolv-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libresolv-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libresolv.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libresolv.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/librt-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/librt-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/librt.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/librt.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libselinux.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libselinux.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libstdc++.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libstdc++.so.6 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libthread_db-1.0.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libthread_db-1.0.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libthread_db.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libthread_db.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libutil-2.27.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libutil-2.27.so -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libutil.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/i386-linux-gnu/libutil.so.1 -------------------------------------------------------------------------------- /src/zelos/ext/env/linux-x86/lib/ld-linux.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/src/zelos/ext/env/linux-x86/lib/ld-linux.so.2 -------------------------------------------------------------------------------- /src/zelos/ext/platforms/linux/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | from .linux import Linux 18 | 19 | 20 | __all__ = ["Linux"] 21 | -------------------------------------------------------------------------------- /src/zelos/ext/platforms/linux/network.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | import ipaddress 19 | import socket 20 | 21 | import zelos.util as zelos_util 22 | 23 | from .syscalls.syscalls_const import SOCKADDR_IN, SOCKADDR_IN6, SocketFamily 24 | 25 | 26 | def _bytes_to_host(b, domain): 27 | """ 28 | Converts an integer containing the domain to a string represnting 29 | the ip of the host. 30 | """ 31 | if domain == SocketFamily.AF_INET: 32 | b_htonl = socket.htonl(b) 33 | return str(ipaddress.IPv4Address(b_htonl)) 34 | return None 35 | 36 | 37 | def _host_to_bytes(host, domain): 38 | if domain == SocketFamily.AF_INET: 39 | return int.from_bytes(ipaddress.IPv4Address(host).packed, "little") 40 | return -1 41 | 42 | 43 | def _bytes_to_port(b): 44 | return socket.htons(b) 45 | 46 | 47 | def _port_to_bytes(port): 48 | return socket.ntohs(port) 49 | 50 | 51 | def get_host_and_port(domain, struct_bytes): 52 | host = "255.255.255.255" 53 | port = 65536 54 | if len(struct_bytes) == 0: 55 | return (None, None) 56 | if domain == SocketFamily.AF_INET: 57 | s_in = SOCKADDR_IN() 58 | zelos_util.str2struct(s_in, bytes(struct_bytes)) 59 | host = _bytes_to_host(s_in.sin_addr, domain) 60 | port = _bytes_to_port(s_in.sin_port) 61 | elif domain == SocketFamily.AF_INET6: 62 | s_in6 = SOCKADDR_IN6() 63 | zelos_util.str2struct(s_in6, bytes(struct_bytes)) 64 | host = _bytes_to_host(s_in6.sin6_addr, domain) 65 | port = _bytes_to_port(s_in6.sin6_port) 66 | return (host, port) 67 | -------------------------------------------------------------------------------- /src/zelos/ext/platforms/linux/syscalls/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | -------------------------------------------------------------------------------- /src/zelos/ext/platforms/linux/syscalls/syscall_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | 19 | def twos_comp(val, bits): 20 | """compute the 2's complement of int value val""" 21 | if ( 22 | val & (1 << (bits - 1)) 23 | ) != 0: # if sign bit is set e.g., 8bit: 128-255 24 | val = val - (1 << bits) # compute negative value 25 | return val # return positive value as is 26 | 27 | 28 | # These msr registers are x86 specific 29 | _FSMSR = 0xC0000100 30 | _GSMSR = 0xC0000101 31 | 32 | 33 | def set_gs(p, addr): 34 | p.emu.msr_write(_GSMSR, addr) 35 | 36 | 37 | def get_gs(p): 38 | return p.emu.msr_read(_GSMSR) 39 | 40 | 41 | def set_fs(p, addr): 42 | p.emu.msr_write(_FSMSR, addr) 43 | 44 | 45 | def get_fs(p): 46 | return p.emu.msr_read(_FSMSR) 47 | -------------------------------------------------------------------------------- /src/zelos/ext/platforms/linux/test_network.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | import unittest 19 | 20 | from zelos.ext.platforms.linux.network import _bytes_to_host 21 | from zelos.ext.platforms.linux.syscalls.syscalls_const import SocketFamily 22 | 23 | 24 | class NetworkTest(unittest.TestCase): 25 | def test_helper_funcs(self): 26 | self.assertEqual( 27 | _bytes_to_host(0x80706050, SocketFamily.AF_INET), "80.96.112.128" 28 | ) 29 | 30 | 31 | def main(): 32 | unittest.main() 33 | 34 | 35 | if __name__ == "__main__": 36 | main() 37 | -------------------------------------------------------------------------------- /src/zelos/ext/plugins/overlay/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | from .overlay import Overlay 18 | 19 | 20 | __all__ = ["Overlay"] 21 | -------------------------------------------------------------------------------- /src/zelos/ext/plugins/overlay/zelos_ida.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | import ida_kernwin 19 | import idaapi 20 | import idc 21 | 22 | 23 | class ApplyZelosOverlay(idaapi.action_handler_t): # pragma: no cover 24 | """ 25 | Applies the overlay from the user-selected memory snapshot. 26 | """ 27 | 28 | def __init__(self): 29 | idaapi.action_handler_t.__init__(self) 30 | 31 | def activate(self, ctx): 32 | import json 33 | 34 | filepath = ida_kernwin.ask_file( 35 | False, "*.zmu;*.overlay;*", "Load Zelos Overlay..." 36 | ) 37 | if filepath is None: 38 | return 39 | f = open(filepath, "r") 40 | zelos_data = f.read() 41 | f.close() 42 | 43 | zelos_data = zelos_data[len("DISAS\n") :] 44 | zelos_dump = json.loads(zelos_data) 45 | 46 | # Apply the overlay data 47 | for comment in zelos_dump["comments"]: 48 | ea = comment["address"] 49 | try: 50 | comment_text = str(comment["text"]) 51 | except UnicodeEncodeError: 52 | comment_text = "" 53 | color = comment.get("color", 0x73F0DF) 54 | 55 | # Set color of instruction line 56 | idaapi.set_item_color(ea, color) 57 | idaapi.set_cmt(ea, comment_text, False) 58 | 59 | # Set function name if not already changed 60 | idc.get_func_attr(ea, idc.FUNCATTR_START) 61 | name = idc.get_func_name(ea) 62 | if len(name) > 0 and name.startswith("zmu_") is False: 63 | idc.set_name(ea, "zmu_" + name) 64 | 65 | return 1 66 | 67 | def update(self, ctx): 68 | return idaapi.AST_ENABLE_ALWAYS 69 | 70 | 71 | class zelosoverlay_t(idaapi.plugin_t): # pragma: no cover 72 | """ 73 | Adds a Zelos {View} menu option for loading an overlay. 74 | """ 75 | 76 | flags = 0 77 | comment = "Load an overlay file generated by Zelos." 78 | help = comment 79 | wanted_name = "ZelosOverlay" 80 | wanted_hotkey = "" 81 | menu_name = "View/" 82 | menu_context = [] 83 | 84 | def init(self): 85 | zelos_overlay_action = idaapi.action_desc_t( 86 | "zelosoverlay:action", 87 | "Load Zelos Overlay...", 88 | ApplyZelosOverlay(), 89 | "", 90 | "Load Zelos Overlay...", 91 | 199, 92 | ) 93 | 94 | idaapi.register_action(zelos_overlay_action) 95 | idaapi.attach_action_to_menu( 96 | "View/", "zelosoverlay:action", idaapi.SETMENU_APP 97 | ) 98 | 99 | return idaapi.PLUGIN_KEEP 100 | 101 | def term(self): 102 | pass 103 | 104 | def run(self, arg): 105 | pass 106 | 107 | 108 | def PLUGIN_ENTRY(): # pragma: no cover 109 | return zelosoverlay_t() 110 | -------------------------------------------------------------------------------- /src/zelos/ext/plugins/runner.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | from zelos import HookType, IPlugin 19 | 20 | 21 | class Runner(IPlugin): 22 | """ 23 | Useful for getting the emulator to run until a desired condition 24 | """ 25 | 26 | def run_to_addr(self, address): 27 | """ Stops emulator the next time this address is executed""" 28 | self.zelos.step() 29 | self.stop_at(address) 30 | self.zelos.start() 31 | 32 | def stop_at(self, target_addr): 33 | """ Causes execution to stop at the target_addr """ 34 | 35 | def stop_with_interrupt(zelos, address, size): 36 | current_process = zelos.process 37 | process_name = current_process.name 38 | self.logger.debug( 39 | f"Got to {target_addr:x} in process {process_name}" 40 | ) 41 | 42 | current_process.scheduler.stop("stop_at") 43 | 44 | self.zelos.hook_execution( 45 | HookType.EXEC.INST, 46 | stop_with_interrupt, 47 | name="stop_at_hook", 48 | ip_low=target_addr, 49 | ip_high=target_addr, 50 | end_condition=lambda: True, 51 | ) 52 | 53 | # TODO consider allowing tunability, by giving option to adjust how 54 | # often a hook can be checked 55 | # TODO Work on allowing this to delete itself. 56 | def stop_when(self, condition): 57 | """ 58 | Stops execution when the condition is found to be true. This 59 | will only be checked as frequently as the hook type.For example, 60 | UC_HOOK_BLOCK will only check the condition at the beginning of 61 | each block""" 62 | 63 | def stop_with_interrupt(zelos, address, size): 64 | if condition(): 65 | zelos.stop("stop_when") 66 | 67 | self.zelos.hook_execution( 68 | HookType.EXEC.BLOCK, stop_with_interrupt, name="stop_when_hook" 69 | ) 70 | 71 | def next_ret(self): 72 | """ Stops emulator after the next ret instruction """ 73 | zelos = self.zelos 74 | while True: 75 | zelos.step() 76 | byte = zelos.memory.read(zelos.regs.getIP(), 1) 77 | if byte[0] == 0xC3: 78 | zelos.step() 79 | return 80 | 81 | def next_write(self, target_addr): 82 | """ 83 | Stops emulator after the next time the target address is 84 | written to 85 | """ 86 | 87 | def hook(zelos, access, address, size, value): 88 | print("Writing %x (%d bytes) to %x" % (value, size, address)) 89 | zelos.stop("next_write") 90 | 91 | self.zelos.hook_memory( 92 | HookType.MEMORY.WRITE, 93 | hook, 94 | name="temp_memwrite_hook", 95 | mem_low=target_addr, 96 | mem_high=target_addr, 97 | end_condition=lambda: True, 98 | ) 99 | self.zelos.start() 100 | -------------------------------------------------------------------------------- /src/zelos/ext/plugins/yarascan/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | from .yarascan import YaraScan 18 | 19 | 20 | __all__ = ["YaraScan"] 21 | -------------------------------------------------------------------------------- /src/zelos/ext/plugins/yarascan/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | if __name__ == "__main__": 19 | import sys 20 | 21 | import zelos 22 | 23 | z = zelos.ZelosCmdline(sys.argv[1:]) 24 | -------------------------------------------------------------------------------- /src/zelos/handles/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | from .base_handles import ( 18 | FileHandle, 19 | Handle, 20 | Handles, 21 | KeyedEventHandle, 22 | ObjectHandle, 23 | PipeInHandle, 24 | PipeOutHandle, 25 | ProcessHandle, 26 | RegistryKeyHandle, 27 | SectionHandle, 28 | SocketHandle, 29 | StdErr, 30 | StdIn, 31 | StdOut, 32 | SymbolicLinkObjectHandle, 33 | ThreadHandle, 34 | WorkerFactoryHandle, 35 | ) 36 | 37 | 38 | __all__ = [ 39 | "Handle", 40 | "FileHandle", 41 | "SocketHandle", 42 | "RegistryKeyHandle", 43 | "SectionHandle", 44 | "SymbolicLinkObjectHandle", 45 | "WorkerFactoryHandle", 46 | "ObjectHandle", 47 | "KeyedEventHandle", 48 | "ProcessHandle", 49 | "ThreadHandle", 50 | "PipeInHandle", 51 | "PipeOutHandle", 52 | "StdIn", 53 | "StdOut", 54 | "StdErr", 55 | "Handles", 56 | ] 57 | -------------------------------------------------------------------------------- /src/zelos/handles/pipe.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | 19 | class Pipe: 20 | """ 21 | Class used to communicate information between processes similar 22 | to a linux pipe. 23 | """ 24 | 25 | def __init__(self): 26 | self.buffer = b"" 27 | self.write_end_closed = False 28 | self.read_end_closed = False 29 | 30 | def write(self, data: bytes) -> int: 31 | """ 32 | Write data to the pipe's buffer. Returns the number of bytes 33 | written to buffer 34 | """ 35 | self.buffer += data 36 | return len(data) 37 | 38 | def read(self, size=None) -> bytes: 39 | """ 40 | Read data from the pipe's buffer up to the requested size. 41 | Defaults to reading the entire buffer 42 | """ 43 | if size is None: 44 | size = len(self.buffer) 45 | data, self.buffer = self.buffer[:size], self.buffer[size:] 46 | return data 47 | 48 | def is_empty(self) -> bool: 49 | return len(self.buffer) == 0 50 | -------------------------------------------------------------------------------- /src/zelos/manager.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import logging 18 | 19 | 20 | class IManager: 21 | def __init__(self, helpers): 22 | self._processes = helpers.processes 23 | self.triggers = helpers.triggers 24 | self.handles = helpers.handles 25 | self.state = helpers.state 26 | self.logger = logging.getLogger(__name__) 27 | 28 | def get_current_thread(self): 29 | return self._processes.current_thread 30 | 31 | @property 32 | def emu(self): 33 | return self._processes.current_process.emu 34 | 35 | @property 36 | def scheduler(self): 37 | return self._processes.current_process.scheduler 38 | 39 | @property 40 | def hooks(self): 41 | return self._processes.current_process.hooks 42 | 43 | @property 44 | def memory(self): 45 | return self._processes.current_process.memory 46 | -------------------------------------------------------------------------------- /src/zelos/modules.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import logging 18 | 19 | from os.path import basename 20 | 21 | 22 | # This class does not yet depend on any external Helpers. The Manager 23 | # Superclass was intentionally not included here just to keep it clear 24 | # that no dependency existed. If this this class ends up needing these 25 | # things, feel free to put them in. 26 | 27 | 28 | class Modules: 29 | def __init__(self): 30 | self.logger = logging.getLogger(__name__) 31 | 32 | # Map of name -> function implementation. 33 | self.function_hooks = {} 34 | # The set of currently loaded modules 35 | self.modules = [] 36 | # The set of currently base-hooked module functions 37 | self.module_functions = {} 38 | # Map of address -> import name 39 | self.reverse_module_functions = {} 40 | 41 | def get_function_name(self, address): 42 | return self.reverse_module_functions.get(address, None) 43 | 44 | def get_function_impl(self, function_name, use_function_hooks=True): 45 | """ 46 | Returns the function name and the hook if a corresponding one 47 | exists. 48 | """ 49 | if use_function_hooks: 50 | hook_struct = self.function_hooks.get(function_name, None) 51 | if hook_struct is not None: 52 | return hook_struct.hook 53 | return None 54 | 55 | def get_module_base(self, module_name): 56 | module_name = self._normalize_name(module_name) 57 | for module in self.modules: 58 | if module_name == module[0]: 59 | return module[1] 60 | return 0 61 | 62 | def get_module_name_at_address(self, imagebase): 63 | for module in self.modules: 64 | if module[1] == imagebase: 65 | return module[0] 66 | return "" 67 | 68 | def is_loaded(self, modulename): 69 | modulename = self._normalize_name(modulename) 70 | for module in self.modules: 71 | if modulename == module[0]: 72 | return True 73 | return False 74 | 75 | # Returns the normalized module name with path stripped/lowercased. 76 | def _normalize_name(self, module_name): 77 | module_name = basename(module_name) 78 | module_name = module_name.lower() 79 | return module_name 80 | 81 | def _save_state(self): 82 | return "" 83 | 84 | def _load_state(self, data): 85 | pass 86 | -------------------------------------------------------------------------------- /src/zelos/network/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | from .network import Network 18 | 19 | 20 | __all__ = ["Network"] 21 | -------------------------------------------------------------------------------- /src/zelos/network/dns.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import dnslib 18 | 19 | 20 | # Code that is used to aid dns parsing. 21 | 22 | 23 | def parse_dns_request(raw_packet_data): 24 | try: 25 | d = str( 26 | dnslib.DNSRecord.parse(raw_packet_data).get_q().get_qname() 27 | ).rstrip(".") 28 | return str(d) 29 | except Exception as e: 30 | print("DNS_INVALID:", e) 31 | return None 32 | 33 | 34 | def parse_dns_response(raw_packet_data): 35 | try: 36 | d = str( 37 | dnslib.DNSRecord.parse(raw_packet_data).get_a().get_rname() 38 | ).rstrip(".") 39 | print("DNS_RESPONSE:", str(d)) 40 | return str(d) 41 | except Exception as e: 42 | print("DNS_INVALID:", e) 43 | if len(str(d)) == 0: 44 | return None 45 | return None 46 | 47 | 48 | def create_dns_response(hostname="google.com", ip=None): 49 | """ 50 | Create a DNS response packet for the specified hostname. If `ip` is 51 | specified (as a string, e.g., '127.0.0.1'), it will be used for the 52 | response. Otherwise, a not found (NXDOMAIN) response is returned. 53 | """ 54 | try: 55 | if ip is None: 56 | d = dnslib.DNSRecord( 57 | dnslib.DNSHeader(qr=1, aa=1, ra=1, rcode=3), 58 | q=dnslib.DNSQuestion(hostname), 59 | ) 60 | else: 61 | d = dnslib.DNSRecord( 62 | dnslib.DNSHeader(qr=1, aa=1, ra=1), 63 | q=dnslib.DNSQuestion(hostname), 64 | a=dnslib.RR(hostname, rdata=dnslib.A(ip)), 65 | ) 66 | return d.pack() 67 | except Exception as e: 68 | print("DNS_CREATE failed:", e) 69 | return None 70 | -------------------------------------------------------------------------------- /src/zelos/plugin/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | from .arg_base import ArgFactory 19 | from .kernel_base import IKernel 20 | from .loader_base import Loader 21 | from .parser_base import ParsedBinary, Section 22 | from .plugin import ( 23 | CommandLineOption, 24 | IPlugin, 25 | ISubcommand, 26 | OSPlugin, 27 | OSPlugins, 28 | PluginCommands, 29 | Plugins, 30 | ) 31 | 32 | 33 | __all__ = [ 34 | "IPlugin", 35 | "Plugins", 36 | "CommandLineOption", 37 | "OSPlugin", 38 | "OSPlugins", 39 | "ISubcommand", 40 | "PluginCommands", 41 | "IKernel", 42 | "Loader", 43 | "ParsedBinary", 44 | "Section", 45 | "ArgFactory", 46 | ] 47 | -------------------------------------------------------------------------------- /src/zelos/plugin/arg_base.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Callable, Dict, List, Tuple 2 | 3 | 4 | class Arg: 5 | def __init__(self, type_str, name, value, string): 6 | self.type = type_str 7 | self.name = name 8 | self.value = value 9 | self.string = string 10 | 11 | 12 | class Args: 13 | def __init__(self, args: List[Arg]) -> None: 14 | self._args = args 15 | for a in args: 16 | setattr(self, a.name, a.value) 17 | 18 | def __str__(self) -> str: 19 | return ", ".join(self._arg_str_list()) 20 | 21 | def _arg_str_list(self) -> List[str]: 22 | return [a.string for a in self._args] 23 | 24 | def to_dict_list(self) -> List[Dict[str, Any]]: 25 | """ 26 | Serialize arguments to dictionary list, e.g.: 27 | args = [ { 'type': 'PCHAR', 'name': 'buf', 'value': 0x12345 } ] 28 | """ 29 | return [ 30 | {"type": arg.type, "name": arg.name, "value": arg.value} 31 | for arg in self._args 32 | ] 33 | 34 | 35 | class ArgFactory: 36 | def __init__(self, str_func: Callable[[Arg], str]): 37 | self._str_func = str_func 38 | 39 | def gen_args( 40 | self, 41 | arg_spec: List[Tuple[str, str]], 42 | values: List[int], 43 | arg_string_overrides: Dict[str, Callable[[Args], str]] = {}, 44 | ) -> Args: 45 | arg_list = [] 46 | 47 | # We collect the args first since some overrides require all of 48 | # the arg values. For example, when passed a buffer and a count 49 | # of bytes to write, we may want to restrict the size of the 50 | # buffer to print by the count. 51 | for (type_str, name), val in zip(arg_spec, values): 52 | arg_list.append(Arg(type_str, name, val, "")) 53 | args = Args(arg_list) 54 | 55 | for a in args._args: 56 | if a.name in arg_string_overrides: 57 | a.string = arg_string_overrides[a.name](args) 58 | else: 59 | a.string = self._str_func(a) 60 | 61 | return args 62 | -------------------------------------------------------------------------------- /src/zelos/plugin/loader_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import logging 18 | 19 | 20 | class Loader: 21 | 22 | STACK_BASE = 0x001A0000 23 | 24 | def __init__(self, z, state, files, process, triggers, original_file_name): 25 | self._z = z 26 | self.state = state 27 | self.modules = process.modules 28 | self.files = files 29 | self.process = process 30 | self.triggers = triggers 31 | self.original_file_name = original_file_name 32 | self.logger = logging.getLogger(__name__) 33 | 34 | @property 35 | def emu(self): 36 | return self.process.emu 37 | 38 | @property 39 | def memory(self): 40 | return self.process.memory 41 | 42 | def _get_module_name(self, module_name): 43 | normalized_module_name = self.modules._normalize_name(module_name) 44 | 45 | module_path = self.files.find_library(normalized_module_name) 46 | if module_path is None: 47 | module_path = module_name # support exe's w/out .exe extensions 48 | normalized_module_name = module_path 49 | # Try to find the file in the VFS 50 | if module_path is None: 51 | module_path = self.files.find_library(module_name) 52 | return module_path, normalized_module_name 53 | 54 | def _get_entrypoint(self, pe, entrypoint_override): 55 | if entrypoint_override is None: 56 | return pe.EntryPoint 57 | # If the input is the name of an export or an address, start 58 | # execution of the main thread at that point 59 | try: 60 | return int(entrypoint_override, 16) 61 | except Exception: 62 | pass 63 | try: 64 | return pe.get_export(entrypoint_override).Address 65 | except Exception: 66 | pass 67 | print( 68 | "entrypoint_override (%s) was neither an export nor an address." 69 | % entrypoint_override 70 | ) 71 | return pe.EntryPoint 72 | 73 | """ 74 | Load a new process with specified module path, environment, 75 | arguments and options 76 | """ 77 | 78 | def load( 79 | self, module_path, file, thread_name="main", entrypoint_override=None 80 | ): 81 | raise NotImplementedError() 82 | -------------------------------------------------------------------------------- /src/zelos/state.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import datetime 18 | 19 | 20 | class State: 21 | """ 22 | This maintains all state that is useful internally to other 23 | Components, but does not belong in any specific one. 24 | """ 25 | 26 | def __init__(self, z, binary, date): 27 | if binary is not None: 28 | self.bits = binary.Bits 29 | self.arch = binary.Architecture 30 | else: 31 | self.bits = 32 32 | self.arch = "x86" 33 | 34 | self.date = date 35 | self.datetime = datetime.datetime.now() 36 | 37 | # Whether or not to implement our modification to Unicorn's TCG 38 | # generation. Extra speed, but hooking behavior is different. 39 | self.patched_zebracorn_enabled = False 40 | 41 | self.endianness = self.__get_endianness(binary) 42 | 43 | @property 44 | def is64(self): 45 | return self.bits == 64 46 | 47 | @property 48 | def bytes(self): 49 | assert self.bits % 8 == 0, "Bits is not a multiple of 8" 50 | return self.bits // 8 51 | 52 | def __get_endianness(self, binary): 53 | try: 54 | id = binary.binary.header.identity_data 55 | assert id != id.NONE, "currently only 32 bit is supported" 56 | if id == id.MSB: 57 | return "big" 58 | elif id == id.LSB: 59 | return "little" 60 | else: 61 | return "unknown" 62 | except Exception: 63 | return "little" 64 | -------------------------------------------------------------------------------- /src/zelos/symbol_manager.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | import logging 19 | 20 | from zelos.hooks import HookType 21 | 22 | 23 | class SymbolManager: 24 | def __init__(self, z): 25 | self.z = z 26 | self.logger = logging.getLogger(__name__) 27 | # list of exports currently hooked in Unicorn 28 | self.hooked_exports = {} 29 | 30 | def should_auto_simulate(self, module_name, func_name): 31 | """ 32 | Returns true if the autohooks should be used to simulate apis. 33 | Modify this function in order to modify autohook behavior 34 | """ 35 | return False 36 | 37 | def should_setup_permanent_export_hook(self, address): 38 | # Block translation interrupt, use this to add permanent hooks 39 | # to blocks that represent the start of exported API functions 40 | return False 41 | 42 | def setup_permanent_export_hook(self, address): 43 | funcName = self.z.modules.reverse_module_functions[address] 44 | self.hooked_exports[funcName] = True 45 | self.z.hook_manager.register_exec_hook( 46 | HookType.EXEC.BLOCK, 47 | self.hook_export, 48 | name=f"export_{funcName}_{address:x}", 49 | ip_low=address, 50 | ip_high=address, 51 | ) 52 | 53 | def hook_export(self, zelos, address, size): 54 | pass 55 | -------------------------------------------------------------------------------- /src/zelos/tools/zdbserver/README.md: -------------------------------------------------------------------------------- 1 | # Zelos Remote Debug Server (zdb) 2 | 3 | The `zdbserver` enables remote debugging with `zelos` over an HTTP/XML-based RPC protocol, i.e. the python `xmlrpc` protocol. 4 | 5 | ## Basic Usage 6 | 7 | To remotely debug a binary with default options: 8 | 9 | ```console 10 | $ python -m zelos.tools.zdbserver my_binary 11 | ``` 12 | 13 | All the standard `zelos` flags can be used here as well. By default, the debug server is hosted on http://localhost:62433. The port can be changed: 14 | 15 | ```console 16 | $ python -m zelos.tools.zdbserver --debug_port 555 my_binary 17 | ``` 18 | 19 | Currently, the only `zdb` client is an `angr` [tool](https://github.com/zeropointdynamics/angr-zelos-target) that integrates symbolic execution with `zelos`. 20 | -------------------------------------------------------------------------------- /src/zelos/tools/zdbserver/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | from .zdbserver import ( 19 | DEFAULT_INTERFACE, 20 | DEFAULT_PORT, 21 | ZdbServer, 22 | create_server, 23 | ) 24 | 25 | 26 | __all__ = ["ZdbServer", "create_server", "DEFAULT_INTERFACE", "DEFAULT_PORT"] 27 | -------------------------------------------------------------------------------- /src/zelos/tools/zdbserver/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | if __name__ == "__main__": 19 | import sys 20 | 21 | from .zdbserver import create_server 22 | 23 | server = create_server(sys.argv[1:]) 24 | server.serve_forever() 25 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | -------------------------------------------------------------------------------- /tests/data/call_mmap1_i386: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/call_mmap1_i386 -------------------------------------------------------------------------------- /tests/data/date: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/date -------------------------------------------------------------------------------- /tests/data/dns_socket_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/dns_socket_test -------------------------------------------------------------------------------- /tests/data/dynamic_elf_arm_helloworld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/dynamic_elf_arm_helloworld -------------------------------------------------------------------------------- /tests/data/dynamic_elf_heap_overflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/dynamic_elf_heap_overflow -------------------------------------------------------------------------------- /tests/data/dynamic_elf_helloworld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/dynamic_elf_helloworld -------------------------------------------------------------------------------- /tests/data/dynamic_elf_x64_helloworld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/dynamic_elf_x64_helloworld -------------------------------------------------------------------------------- /tests/data/errno_mips_example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/errno_mips_example -------------------------------------------------------------------------------- /tests/data/ld-linux.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ld-linux.so -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/brk01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/brk01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/chdir01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/chdir01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/chdir02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/chdir02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/chdir03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/chdir03 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/chdir04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/chdir04 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork03 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork04 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork05 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork06: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork06 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork07: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork07 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork08: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork08 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork09: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork09 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork10 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork11 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork12 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork13 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/fork14: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/fork14 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/getpid01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/getpid01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/getpid02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/getpid02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/getppid01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/getppid01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/getppid02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/getppid02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill03 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill04 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill05 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill06: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill06 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill07: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill07 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill08: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill08 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill09: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill09 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill10 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill11 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/kill12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/kill12 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open03 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open04 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open05 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open06: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open06 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open07: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open07 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open08: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open08 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open09: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open09 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open10 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open11 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open12 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open12_child: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open12_child -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open13 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/open14: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/open14 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/openat01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/openat01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/openat02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/openat02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/openat02_child: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/openat02_child -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/openat03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/openat03 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pipe01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pipe01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pipe02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pipe02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pipe03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pipe03 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pipe04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pipe04 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pipe05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pipe05 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pipe06: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pipe06 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pipe07: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pipe07 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pipe08: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pipe08 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pipe09: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pipe09 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/pread01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/pread01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/read01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/read01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/read02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/read02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/read03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/read03 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/read04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/read04 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/rmdir01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/rmdir01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/sbrk01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/sbrk01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/sbrk02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/sbrk02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/sbrk03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/sbrk03 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/vfork01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/vfork01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/vfork02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/vfork02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/write01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/write01 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/write02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/write02 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/write03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/write03 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/write04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/write04 -------------------------------------------------------------------------------- /tests/data/ltp_x64/syscalls/write05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/ltp_x64/syscalls/write05 -------------------------------------------------------------------------------- /tests/data/read_stdin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/read_stdin -------------------------------------------------------------------------------- /tests/data/src/call_mmap1_i386.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | struct mmap_arg_struct32 { 7 | unsigned int addr; 8 | unsigned int len; 9 | unsigned int prot; 10 | unsigned int flags; 11 | unsigned int fd; 12 | unsigned int offset; 13 | }; 14 | 15 | int main(void) { 16 | struct mmap_arg_struct32 arg = {0, 4096, 0x7, 0x22, 0, 0}; 17 | struct mmap_arg_struct32 *arg_ptr; 18 | arg_ptr = &arg; 19 | // int rc = syscall(0xc0, 0, 4096, 0x7, 0x22, -1, 0); 20 | int rc = syscall(0x5a, arg_ptr); // i386 mmap1 21 | if (rc == -1) printf("mmap failed, errno = %d\n", errno); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /tests/data/src/errno_example.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern int errno; 5 | 6 | int main() { 7 | FILE* f; 8 | f = fopen("badfilename", "r"); 9 | if (f == NULL) { 10 | printf("Errno: %d\n", errno); 11 | } else { 12 | fclose(f); 13 | } 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /tests/data/src/heap_overflow.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int args, char** argv) { 4 | void* heap = (void*)malloc(32); 5 | memset(heap, 'A', 64); 6 | printf("%s\n", heap); 7 | free(heap); 8 | heap = NULL; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /tests/data/src/loaddll.c: -------------------------------------------------------------------------------- 1 | // 2 | // Loads the DLL specified on the command line. Used for testing Zemu's ability 3 | // to load various DLLs and successfully execute their DLLMain. 4 | // 5 | // All DLLs in a directory can be tested as follows: 6 | // find zemu/lib/windows/filesystems/win7x86/Windows/System32/ -type f -iname *.dll -exec sh -c 'DLL=$(basename {}); echo Trying to reach NtTerminateProcess with load of $DLL; python3 zemu-exec.py --patched --winnative --disable_export_hooks --timeout=30 --cmdline_args="$DLL" demo/loaddll.exe' _ {} \; 2>&1 | tee loaddll_test.txt 7 | // cat loaddll_test.txt | grep NtTerminateProcess 8 | // 9 | // Originally built in the VC++ 2008 32-bit command prompt with command: 10 | // cl loaddll.c 11 | 12 | #include 13 | #include 14 | 15 | int main(int argc, char *argv[], char *envp[]) { 16 | HINSTANCE hinstLib; 17 | 18 | if (argc < 2) { 19 | return 1; 20 | } 21 | 22 | hinstLib = LoadLibrary(TEXT(argv[1])); 23 | 24 | if (hinstLib == NULL) { 25 | return 1; 26 | } 27 | 28 | printf("OK\n"); 29 | 30 | FreeLibrary(hinstLib); 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /tests/data/src/multithread.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void *inc_x(void *x){ 5 | int *x_ptr = (int *)x; 6 | ++(*x_ptr); 7 | printf("x increment finished\n"); 8 | return NULL; 9 | } 10 | 11 | int main(){ 12 | int x = 0, y = 0; 13 | printf("x: %d, y: %d\n", x, y); 14 | pthread_t inc_x_thread; 15 | if(pthread_create(&inc_x_thread, NULL, inc_x, &x)) { 16 | fprintf(stderr, "Error creating thread\n"); 17 | return 1; 18 | } 19 | ++y; 20 | printf("y increment finished\n"); 21 | if(pthread_join(inc_x_thread, NULL)) { 22 | fprintf(stderr, "Error joining thread\n"); 23 | return 2; 24 | } 25 | printf("x: %d, y: %d\n", x, y); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /tests/data/src/read_stdin.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | int main() { 4 | char buf[20]; 5 | fgets(buf, 20, stdin); 6 | printf("string is: %s\n", buf); 7 | 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /tests/data/static-socket-x86-musl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/static-socket-x86-musl -------------------------------------------------------------------------------- /tests/data/static_elf_arm_helloworld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/static_elf_arm_helloworld -------------------------------------------------------------------------------- /tests/data/static_elf_helloworld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/static_elf_helloworld -------------------------------------------------------------------------------- /tests/data/static_elf_mips_lsb_helloworld_mti: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/static_elf_mips_lsb_helloworld_mti -------------------------------------------------------------------------------- /tests/data/static_elf_mips_msb_helloworld_img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/static_elf_mips_msb_helloworld_img -------------------------------------------------------------------------------- /tests/data/static_elf_mips_msb_helloworld_mti: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/static_elf_mips_msb_helloworld_mti -------------------------------------------------------------------------------- /tests/data/static_elf_mipseb_mti_helloworld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/static_elf_mipseb_mti_helloworld -------------------------------------------------------------------------------- /tests/data/static_elf_mipsel_mti_helloworld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/static_elf_mipsel_mti_helloworld -------------------------------------------------------------------------------- /tests/data/static_elf_x64_helloworld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/static_elf_x64_helloworld -------------------------------------------------------------------------------- /tests/data/x86_multithread: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeropointdynamics/zelos/506554d20656c0d4c64c4d326baec179eede211a/tests/data/x86_multithread -------------------------------------------------------------------------------- /tests/encrypt_test_file.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import sys 18 | 19 | from zelos.util import file_encrypt 20 | 21 | 22 | if __name__ == "__main__": 23 | if len(sys.argv) == 1: 24 | print("Usage: python {0} ".format(sys.argv[0])) 25 | exit() 26 | 27 | files = sys.argv[1:] 28 | for filename in files: 29 | file_encrypt(filename) 30 | -------------------------------------------------------------------------------- /tests/test_args.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | 14 | # . 15 | # ====================================================================== 16 | 17 | # You should have received a copy of the GNU Affero General Public 18 | # License along with this program. If not, see 19 | import unittest 20 | 21 | from zelos.plugin import ArgFactory 22 | 23 | 24 | class ArgFactoryTest(unittest.TestCase): 25 | def test_create_args(self): 26 | arg_factory = ArgFactory(lambda arg: "") 27 | 28 | args = arg_factory.gen_args( 29 | [("int", "fd"), ("void*", "buf"), ("size_t", "count")], 30 | [0x4, 0xDEADBEEF, 0x10], 31 | ) 32 | self.assertEqual(args.fd, 0x4) 33 | self.assertEqual(args.buf, 0xDEADBEEF) 34 | self.assertEqual(args.count, 0x10) 35 | 36 | 37 | def main(): 38 | unittest.main() 39 | 40 | 41 | if __name__ == "__main__": 42 | main() 43 | -------------------------------------------------------------------------------- /tests/test_config.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | 14 | # . 15 | # ====================================================================== 16 | 17 | # You should have received a copy of the GNU Affero General Public 18 | # License along with this program. If not, see 19 | 20 | import unittest 21 | 22 | from os import path 23 | 24 | from zelos import Zelos 25 | 26 | 27 | DATA_DIR = path.join(path.dirname(path.abspath(__file__)), "data") 28 | 29 | 30 | class ConfigTest(unittest.TestCase): 31 | def test_mount_folder(self): 32 | z = Zelos(None, mount=f"x86,/home/data,{DATA_DIR}", log="debug") 33 | file = z.internal_engine.files.open_library( 34 | "/home/data/static_elf_helloworld" 35 | ) 36 | self.assertIsNotNone(file) 37 | 38 | def test_mount_folder_end_slash(self): 39 | z = Zelos(None, mount=f"x86,/home/data/,{DATA_DIR}", log="debug") 40 | file = z.internal_engine.files.open_library( 41 | "/home/data/static_elf_helloworld" 42 | ) 43 | self.assertIsNotNone(file) 44 | 45 | def test_mount_file(self): 46 | real_path = path.join(DATA_DIR, "static_elf_helloworld") 47 | z = Zelos( 48 | None, mount=f"x86,/home/data/sample_file,{real_path}", log="debug" 49 | ) 50 | file = z.internal_engine.files.open_library("/home/data/sample_file") 51 | self.assertIsNotNone(file) 52 | 53 | def test_mount_file_end_slash(self): 54 | real_path = path.join(DATA_DIR, "static_elf_helloworld") 55 | 56 | z = Zelos(None, mount=f"x86,/home/data/,{real_path}", log="debug") 57 | file = z.internal_engine.files.open_library( 58 | "/home/data/static_elf_helloworld" 59 | ) 60 | self.assertIsNotNone(file) 61 | 62 | def test_env_vars(self): 63 | # specify single env_var 64 | z = Zelos(None, env_vars="HELLO=world test spaces") 65 | self.assertDictEqual(z.config.env_vars, {"HELLO": "world test spaces"}) 66 | # specify multiple env_vars 67 | z = Zelos(None, env_vars=["HELLO=world", "LOREM=ipsum"]) 68 | self.assertDictEqual( 69 | z.config.env_vars, {"HELLO": "world", "LOREM": "ipsum"} 70 | ) 71 | 72 | def test_args_with_starting_dash(self): 73 | real_path = path.join(DATA_DIR, "static_elf_helloworld") 74 | z = Zelos(real_path, "--first_arg", "--second_arg") 75 | 76 | self.assertEqual("--first_arg", z.internal_engine.cmdline_args[1]) 77 | self.assertEqual("--second_arg", z.internal_engine.cmdline_args[2]) 78 | 79 | 80 | def main(): 81 | unittest.main() 82 | 83 | 84 | if __name__ == "__main__": 85 | main() 86 | -------------------------------------------------------------------------------- /tests/test_emu_helper.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | from __future__ import absolute_import 19 | 20 | import unittest 21 | 22 | from zelos import Zelos 23 | from zelos.enums import ProtType 24 | 25 | 26 | class EmuHelperTest(unittest.TestCase): 27 | def emu_init(self): 28 | z = Zelos(None) 29 | z.internal_engine.memory.clear() 30 | emu = z.internal_engine.emu 31 | return emu 32 | 33 | def test_emu_memory(self): 34 | emu = self.emu_init() 35 | emu.mem_map(0x1000, 0x3000, prot=ProtType.READ) 36 | emu.mem_map(0x4000, 0x1000, prot=ProtType.NONE, shared=True) 37 | self.assertEqual(2, len(emu.mem_regions())) 38 | mr1 = emu.mem_region(0x1000) 39 | data1 = bytes(b"A" * mr1.size) 40 | mr2 = emu.mem_region(0x4000) 41 | data2 = bytes(b"B" * mr2.size) 42 | emu.mem_write(mr1.address, data1) 43 | emu.mem_write(mr2.address, data2) 44 | self.assertGreater(mr2, mr1) 45 | self.assertNotEqual(mr1, mr2) 46 | self.assertEqual(str(mr1), "00001000-00004000 00003000 r-- private") 47 | self.assertEqual(str(mr2), "00004000-00005000 00001000 --- shared") 48 | self.assertEqual(b"A", emu.mem_read(mr1.address, 1)) 49 | self.assertEqual(b"A", emu.mem_read(0x1FFF, 1)) 50 | self.assertEqual(b"A", emu.mem_read(0x2000, 1)) 51 | self.assertEqual(b"A", emu.mem_read(0x2001, 1)) 52 | self.assertEqual(b"A", emu.mem_read(0x2FFF, 1)) 53 | self.assertEqual(b"A", emu.mem_read(0x1FFF, 1)) 54 | self.assertEqual(b"AAA", emu.mem_read(0x2000, 3)) 55 | self.assertEqual(b"AAA", emu.mem_read(0x1FFF, 3)) 56 | self.assertEqual(data1, emu.mem_read(mr1.address, mr1.size)) 57 | self.assertEqual(b"AABB", emu.mem_read(0x3FFE, 4)) 58 | 59 | emu.mem_map_file(0xA00000000, __file__) 60 | mr3 = emu.mem_region(0xA00000000) 61 | file_data = b"# Copyright (C)" 62 | self.assertEqual(file_data, emu.mem_read(mr3.address, len(file_data))) 63 | 64 | 65 | def main(): 66 | unittest.main() 67 | 68 | 69 | if __name__ == "__main__": 70 | main() 71 | -------------------------------------------------------------------------------- /tests/test_heap_manager.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import unittest 18 | 19 | from zelos import Zelos 20 | 21 | 22 | class HeapManagerTest(unittest.TestCase): 23 | def test_alloc(self): 24 | z = Zelos(None) 25 | heap = z.internal_engine.memory.heap 26 | 27 | addr1 = heap.alloc(0x10, name="obj1") 28 | addr2 = heap.alloc(0x10, name="obj2") 29 | self.assertLessEqual(addr1 + 0x10, addr2) 30 | self.assertEqual(2, len(heap.heap_objects)) 31 | 32 | def test_dealloc(self): 33 | z = Zelos(None) 34 | heap = z.internal_engine.memory.heap 35 | starting_offset = heap.current_offset 36 | 37 | # Don't dealloc past the beginning 38 | new_heap_start = heap.dealloc(0x10) 39 | self.assertEqual(starting_offset, new_heap_start) 40 | 41 | # dealloc when appropriate 42 | heap.alloc(0x100) 43 | new_current_offset = heap.dealloc(0xF0) 44 | self.assertEqual(starting_offset + 0x10, new_current_offset) 45 | 46 | # Dealloc when asking to go back to the beginning. 47 | new_current_offset = heap.dealloc( 48 | heap.current_offset - heap.heap_start 49 | ) 50 | self.assertEqual(starting_offset, new_current_offset) 51 | 52 | def test_bug_alloc_is_aligned(self): 53 | # We should ensure that allocs are aligned, as some binaries 54 | # (helloVB6-native.exe) do not work with unaligned memory 55 | # allocs. 56 | z = Zelos(None) 57 | heap = z.internal_engine.memory.heap 58 | 59 | addr1 = heap.alloc(0x11, name="obj1") 60 | addr2 = heap.alloc(0x3, name="obj2") 61 | 62 | self.assertEqual(0, addr1 % 4) 63 | self.assertEqual(0, addr2 % 4) 64 | self.assertEqual(2, len(heap.heap_objects)) 65 | 66 | def test_allocstr(self): 67 | z = Zelos(None) 68 | heap = z.internal_engine.memory.heap 69 | s1 = "We are the future" 70 | p_str, size = heap.allocstr(s1) 71 | self.assertEqual(size, len(s1) + 1) 72 | expected_s1 = z.internal_engine.memory.read_string(p_str) 73 | self.assertEqual(s1, expected_s1) 74 | 75 | s2 = "you best believe it" 76 | p_str, size = heap.allocstr(s2, is_wide=True) 77 | self.assertEqual(size, len(s2) * 2 + 2) 78 | expected_s2 = z.internal_engine.memory.read_wstring(p_str) 79 | self.assertEqual(expected_s2, s2) 80 | 81 | s3 = "this is it" 82 | size = z.internal_engine.memory.write_string(p_str, s3) 83 | self.assertEqual(size, len(s3) + 1) 84 | expected_s3 = z.internal_engine.memory.read_string(p_str) 85 | self.assertEqual(expected_s3, s3) 86 | 87 | 88 | def main(): 89 | unittest.main() 90 | 91 | 92 | if __name__ == "__main__": 93 | main() 94 | -------------------------------------------------------------------------------- /tests/test_kernel.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import unittest 18 | 19 | from unittest.mock import Mock 20 | 21 | from zelos import Zelos 22 | from zelos.ext.platforms.linux.kernel import X86Kernel 23 | 24 | 25 | class KernelTest(unittest.TestCase): 26 | def test_syscall_override(self): 27 | z = Zelos(None) 28 | k = X86Kernel(z.internal_engine) 29 | k.register_overrides({"getuid": [1, 2]}) 30 | sys_func = k._name2syscall_func["getuid"] 31 | p = Mock() 32 | self.assertEqual(1, sys_func(k, p)) 33 | self.assertEqual(2, sys_func(k, p)) 34 | sys_func(k, p) 35 | 36 | 37 | def main(): 38 | unittest.main() 39 | 40 | 41 | if __name__ == "__main__": 42 | main() 43 | -------------------------------------------------------------------------------- /tests/test_libutils.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | 14 | # . 15 | # ====================================================================== 16 | from __future__ import absolute_import 17 | 18 | # You should have received a copy of the GNU Affero General Public 19 | # License along with this program. If not, see 20 | import unittest 21 | 22 | from io import StringIO 23 | from unittest.mock import patch 24 | 25 | import zelos.util as util 26 | 27 | from zelos.ext.platforms.linux.syscalls.syscall_structs import ( 28 | MMSGHDR, 29 | SIGACTION, 30 | ) 31 | 32 | 33 | class UtilTest(unittest.TestCase): 34 | def test_align(self): 35 | self.assertEqual(0x1000, util.align(0x1000)) 36 | self.assertEqual(0x2000, util.align(0x1001)) 37 | self.assertEqual(0x1000, util.align(1)) 38 | self.assertEqual(0x12000, util.align(0x11002)) 39 | 40 | self.assertEqual(0x14, util.align(0x11, alignment=0x4)) 41 | self.assertEqual(0x10, util.align(0xF, alignment=0x4)) 42 | 43 | def test_dumpstruct(self): 44 | mmsghdr = MMSGHDR() # nested struct 45 | sigact = SIGACTION() # flat struct 46 | with patch("sys.stdout", new=StringIO()) as stdout: 47 | util.dumpstruct(mmsghdr) 48 | self.assertIn("MSGHDR object at", stdout.getvalue()) 49 | self.assertIn("msg_name: 0x0", stdout.getvalue()) 50 | self.assertIn("msg_len: 0x0", stdout.getvalue()) 51 | 52 | util.dumpstruct(sigact) 53 | self.assertIn("sa_handler: 0x0", stdout.getvalue()) 54 | self.assertIn("sa_mask: 0x0", stdout.getvalue()) 55 | -------------------------------------------------------------------------------- /tests/test_linux_arm.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import os 18 | import unittest 19 | 20 | from os import path 21 | 22 | from zelos import Zelos 23 | 24 | 25 | DATA_DIR = path.join(path.dirname(path.abspath(__file__)), "data") 26 | 27 | 28 | class ZelosTest(unittest.TestCase): 29 | def test_static_elf_inst_feed(self): 30 | z = Zelos( 31 | path.join(DATA_DIR, "static_elf_arm_helloworld"), 32 | trace_off=True, 33 | inst_feed=True, 34 | ) 35 | z.start(timeout=3) 36 | 37 | self.assertEqual( 38 | 1, len(z.internal_engine.thread_manager.completed_threads) 39 | ) 40 | 41 | def test_static_elf(self): 42 | z = Zelos( 43 | path.join(DATA_DIR, "static_elf_arm_helloworld"), trace_off=True 44 | ) 45 | z.start(timeout=10) 46 | 47 | self.assertEqual( 48 | 1, len(z.internal_engine.thread_manager.completed_threads) 49 | ) 50 | 51 | def test_dynamic_elf(self): 52 | if os.name == "nt": 53 | raise unittest.SkipTest( 54 | "Skipping `test_dynamic_elf`: " 55 | "Windows fatal exception: access violation" 56 | ) 57 | z = Zelos( 58 | path.join(DATA_DIR, "dynamic_elf_arm_helloworld"), trace_off=True 59 | ) 60 | z.start(timeout=10) 61 | 62 | self.assertEqual( 63 | 1, len(z.internal_engine.thread_manager.completed_threads) 64 | ) 65 | 66 | 67 | def main(): 68 | unittest.main() 69 | 70 | 71 | if __name__ == "__main__": 72 | main() 73 | -------------------------------------------------------------------------------- /tests/test_linux_mips.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import os 18 | import unittest 19 | 20 | from io import StringIO 21 | from os import path 22 | from unittest.mock import patch 23 | 24 | from zelos import Zelos 25 | 26 | 27 | DATA_DIR = path.join(path.dirname(path.abspath(__file__)), "data") 28 | 29 | 30 | class ZelosTest(unittest.TestCase): 31 | def test_static_elf_el(self): 32 | z = Zelos(path.join(DATA_DIR, "static_elf_mipsel_mti_helloworld")) 33 | z.start(timeout=10) 34 | 35 | self.assertEqual( 36 | 1, len(z.internal_engine.thread_manager.completed_threads) 37 | ) 38 | 39 | def test_static_elf_eb(self): 40 | if os.name == "nt": 41 | raise unittest.SkipTest( 42 | "Skipping `test_static_elf_eb`: Windows lief fails to parse" 43 | ) 44 | z = Zelos(path.join(DATA_DIR, "static_elf_mipseb_mti_helloworld")) 45 | z.start(timeout=10) 46 | 47 | self.assertEqual( 48 | 1, len(z.internal_engine.thread_manager.completed_threads) 49 | ) 50 | 51 | def test_linux_errno(self): 52 | if os.name == "nt": 53 | raise unittest.SkipTest( 54 | "Skipping `test_linux_errno`: Windows lief fails to parse" 55 | ) 56 | z = Zelos(path.join(DATA_DIR, "errno_mips_example"), trace_off=True) 57 | 58 | with patch("sys.stdout", new=StringIO()) as stdout: 59 | z.start(timeout=10) 60 | self.assertIn("Errno: 2", stdout.getvalue()) 61 | self.assertEqual( 62 | 1, len(z.internal_engine.thread_manager.completed_threads) 63 | ) 64 | 65 | 66 | def main(): 67 | unittest.main() 68 | 69 | 70 | if __name__ == "__main__": 71 | main() 72 | -------------------------------------------------------------------------------- /tests/test_linux_x64.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import unittest 18 | 19 | from os import path 20 | 21 | from zelos import Zelos 22 | 23 | 24 | DATA_DIR = path.join(path.dirname(path.abspath(__file__)), "data") 25 | 26 | 27 | class ZelosTest(unittest.TestCase): 28 | def test_static_elf_unpatched(self): 29 | z = Zelos( 30 | path.join(DATA_DIR, "static_elf_x64_helloworld"), trace_off=True 31 | ) 32 | z.start(timeout=3) 33 | 34 | self.assertEqual( 35 | 1, len(z.internal_engine.thread_manager.completed_threads) 36 | ) 37 | 38 | def test_static_elf(self): 39 | z = Zelos( 40 | path.join(DATA_DIR, "static_elf_x64_helloworld"), trace_off=True 41 | ) 42 | z.start(timeout=3) 43 | 44 | self.assertEqual( 45 | 1, len(z.internal_engine.thread_manager.completed_threads) 46 | ) 47 | 48 | def test_dynamic_elf_unpatched(self): 49 | z = Zelos( 50 | path.join(DATA_DIR, "dynamic_elf_x64_helloworld"), trace_off=True 51 | ) 52 | z.start(timeout=3) 53 | 54 | self.assertEqual( 55 | 1, len(z.internal_engine.thread_manager.completed_threads) 56 | ) 57 | 58 | def test_dynamic_elf(self): 59 | z = Zelos( 60 | path.join(DATA_DIR, "dynamic_elf_x64_helloworld"), trace_off=True 61 | ) 62 | z.start(timeout=3) 63 | 64 | self.assertEqual( 65 | 1, len(z.internal_engine.thread_manager.completed_threads) 66 | ) 67 | 68 | 69 | def main(): 70 | unittest.main() 71 | 72 | 73 | if __name__ == "__main__": 74 | main() 75 | -------------------------------------------------------------------------------- /tests/test_linux_x86.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | import unittest 18 | 19 | from os import path 20 | 21 | from zelos import Zelos 22 | 23 | 24 | DATA_DIR = path.join(path.dirname(path.abspath(__file__)), "data") 25 | 26 | 27 | class ZelosTest(unittest.TestCase): 28 | def test_static_elf_unpatched(self): 29 | z = Zelos(path.join(DATA_DIR, "static_elf_helloworld"), trace_off=True) 30 | z.start(timeout=3) 31 | 32 | self.assertEqual( 33 | 1, len(z.internal_engine.thread_manager.completed_threads) 34 | ) 35 | 36 | def test_static_elf(self): 37 | z = Zelos(path.join(DATA_DIR, "static_elf_helloworld"), trace_off=True) 38 | z.start(timeout=3) 39 | 40 | self.assertEqual( 41 | 1, len(z.internal_engine.thread_manager.completed_threads) 42 | ) 43 | 44 | def test_dynamic_elf(self): 45 | z = Zelos( 46 | path.join(DATA_DIR, "ld-linux.so"), 47 | "./dynamic_elf_helloworld", 48 | trace_off=True, 49 | ) 50 | z.internal_engine.files.add_file( 51 | path.join(DATA_DIR, "dynamic_elf_helloworld") 52 | ) 53 | 54 | z.start(timeout=3) 55 | 56 | self.assertEqual( 57 | 1, len(z.internal_engine.thread_manager.completed_threads) 58 | ) 59 | 60 | def test_dynamic_elf_directly(self): 61 | z = Zelos( 62 | path.join(DATA_DIR, "dynamic_elf_helloworld"), trace_off=True 63 | ) 64 | z.start(timeout=3) 65 | 66 | self.assertEqual( 67 | 1, len(z.internal_engine.thread_manager.completed_threads) 68 | ) 69 | 70 | def test_socket_elf(self): 71 | z = Zelos( 72 | path.join(DATA_DIR, "static-socket-x86-musl"), trace_off=True 73 | ) 74 | z.internal_engine.network.disable_whitelist() 75 | z.start(timeout=5) 76 | 77 | self.assertEqual( 78 | 1, len(z.internal_engine.thread_manager.completed_threads) 79 | ) 80 | 81 | def test_mmap1(self): 82 | z = Zelos(path.join(DATA_DIR, "call_mmap1_i386"), trace_off=True) 83 | z.start(timeout=5) 84 | self.assertEqual( 85 | 1, len(z.internal_engine.thread_manager.completed_threads) 86 | ) 87 | 88 | 89 | def main(): 90 | unittest.main() 91 | 92 | 93 | if __name__ == "__main__": 94 | main() 95 | -------------------------------------------------------------------------------- /tests/test_overlay.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | 14 | # You should have received a copy of the GNU Affero General Public 15 | # License along with this program. If not, see 16 | # . 17 | # ====================================================================== 18 | 19 | from __future__ import absolute_import 20 | 21 | import json 22 | import os 23 | import tempfile 24 | import unittest 25 | 26 | from io import StringIO 27 | from os import path 28 | 29 | from zelos import Zelos 30 | 31 | 32 | DATA_DIR = path.join(path.dirname(path.abspath(__file__)), "data") 33 | 34 | 35 | class OverlayTest(unittest.TestCase): 36 | def test_overlay_memory(self): 37 | z = Zelos(path.join(DATA_DIR, "static_elf_helloworld")) 38 | 39 | z.start() 40 | 41 | output = StringIO() 42 | z.plugins.overlay.export(output, mem=True) 43 | output.seek(0) 44 | 45 | data = output.read()[len("DISAS\n") :] 46 | memdump = json.loads(data) 47 | 48 | self.assertEqual(len(memdump["sections"]), 18) 49 | self.assertEqual(len(memdump["comments"]), 0) 50 | 51 | def test_overlay_comments(self): 52 | z = Zelos( 53 | path.join(DATA_DIR, "static_elf_helloworld"), 54 | inst=True, 55 | fasttrace=True, 56 | export_trace=True, 57 | trace_off=True, 58 | ) 59 | 60 | directory = tempfile.TemporaryDirectory() 61 | # The exported file is written to the directory that zelos is 62 | # run in 63 | original_dir = os.path.abspath(os.path.curdir) 64 | try: 65 | os.chdir(directory.name) 66 | z.start() 67 | z.close() 68 | finally: 69 | os.chdir(original_dir) 70 | 71 | output = open(path.join(directory.name, "static_elf_helloworld.zmu")) 72 | 73 | data = output.read()[len("DISAS\n") :] 74 | memdump = json.loads(data) 75 | self.assertGreaterEqual(len(memdump["comments"]), 8277) 76 | 77 | self.assertEqual(len(memdump["functions"]), 244) 78 | 79 | self.assertEqual(memdump["comments"][0]["address"], 134515568) 80 | self.assertEqual(memdump["comments"][0]["text"], "ebp = 0x0") 81 | output.close() 82 | -------------------------------------------------------------------------------- /tests/test_runner.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | 14 | # You should have received a copy of the GNU Affero General Public 15 | # License along with this program. If not, see 16 | # . 17 | # ====================================================================== 18 | 19 | from __future__ import absolute_import 20 | 21 | import unittest 22 | 23 | from os import path 24 | 25 | from zelos import Zelos 26 | 27 | 28 | DATA_DIR = path.join(path.dirname(path.abspath(__file__)), "data") 29 | 30 | 31 | class RunnerTest(unittest.TestCase): 32 | def test_run_to_addr(self): 33 | z = Zelos(path.join(DATA_DIR, "dynamic_elf_helloworld")) 34 | z.internal_engine.thread_manager.swap_with_thread("main") 35 | 36 | z.plugins.runner.run_to_addr(0x0B01B3CA) 37 | self.assertEqual(z.thread.getIP(), 0x0B01B3CA) 38 | 39 | def test_stop_when(self): 40 | z = Zelos(path.join(DATA_DIR, "static_elf_helloworld")) 41 | z.internal_engine.thread_manager.swap_with_thread("main") 42 | 43 | def stop(): 44 | # stop when we reach `uname` at 0x81356e2 45 | if z.regs.getIP() == 0x81356E2: 46 | return True 47 | 48 | z.plugins.runner.stop_when(stop) 49 | z.start() 50 | self.assertEqual(z.thread.getIP(), 0x081356E2) 51 | 52 | def test_run_to_ret(self): 53 | z = Zelos(path.join(DATA_DIR, "static_elf_helloworld")) 54 | z.internal_engine.thread_manager.swap_with_thread("main") 55 | 56 | z.step() 57 | z.plugins.runner.next_ret() 58 | self.assertEqual(str(z.thread.getIP()), str(0x08048B80)) 59 | 60 | def test_run_to_next_write(self): 61 | z = Zelos(path.join(DATA_DIR, "static_elf_helloworld")) 62 | z.internal_engine.thread_manager.swap_with_thread("main") 63 | 64 | z.plugins.runner.next_write(0xFF08EDD0) 65 | t = z.thread 66 | self.assertEqual( 67 | t.getIP(), 0x8135778, f"IP is 0x{t.getIP():x} vs. 0x8135778" 68 | ) 69 | 70 | 71 | def main(): 72 | unittest.main() 73 | 74 | 75 | if __name__ == "__main__": 76 | main() 77 | -------------------------------------------------------------------------------- /tests/test_script_interface.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | 14 | # You should have received a copy of the GNU Affero General Public 15 | # License along with this program. If not, see 16 | # . 17 | # ====================================================================== 18 | 19 | import unittest 20 | 21 | from zelos import Zelos 22 | 23 | 24 | class ZelosTest(unittest.TestCase): 25 | def test_invalid_args(self): 26 | self.assertRaises( 27 | SystemExit, 28 | Zelos, 29 | "tests/data/static_elf_helloworld", 30 | invalid_arg="testval", 31 | ) 32 | 33 | 34 | def main(): 35 | unittest.main() 36 | 37 | 38 | if __name__ == "__main__": 39 | main() 40 | -------------------------------------------------------------------------------- /tests/test_sockets.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | 14 | # You should have received a copy of the GNU Affero General Public 15 | # License along with this program. If not, see 16 | # . 17 | # ====================================================================== 18 | 19 | import socket 20 | import unittest 21 | 22 | from os import path 23 | 24 | from zelos import HookType, Zelos 25 | from zelos.network.base_socket import BaseSocket 26 | 27 | 28 | DATA_DIR = path.join(path.dirname(path.abspath(__file__)), "data") 29 | 30 | 31 | class ZelosTest(unittest.TestCase): 32 | def test_dga_example(self): 33 | z = Zelos(path.join(DATA_DIR, "dns_socket_test"), trace_off=True) 34 | syscalls_called = [] 35 | 36 | def record_syscalls(z, syscall_name, args, return_value): 37 | syscalls_called.append(syscall_name) 38 | 39 | z.hook_syscalls(HookType.SYSCALL.AFTER, record_syscalls, "test_hook") 40 | 41 | z.start(timeout=3) 42 | 43 | self.assertIn("socket", syscalls_called) 44 | self.assertIn("connect", syscalls_called) 45 | self.assertIn("sendto", syscalls_called) 46 | self.assertIn("select", syscalls_called) 47 | self.assertIn("recvfrom", syscalls_called) 48 | 49 | self.assertEqual( 50 | 1, len(z.internal_engine.thread_manager.completed_threads) 51 | ) 52 | 53 | def test_base_socket(self): 54 | s = BaseSocket( 55 | None, socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP 56 | ) 57 | 58 | s.setsockopt(0, 1, False) 59 | self.assertFalse(s.getsockopt(0, 1)) 60 | s.set_nonblock(True) 61 | self.assertTrue(s.is_nonblock()) 62 | s.connect(("127.0.0.1", 1)) 63 | self.assertEqual(len(s.history["connect"]), 1) 64 | self.assertEqual(s.host, "127.0.0.1") 65 | self.assertEqual(s.port, 1) 66 | self.assertEqual(s.close(), None) 67 | s.bind(("127.0.0.2", 2)) 68 | self.assertEqual(len(s.history["bind"]), 1) 69 | self.assertEqual(s.host, "127.0.0.2") 70 | self.assertEqual(s.port, 2) 71 | self.assertEqual(s.listen(), 0) 72 | self.assertEqual(s.accept(), 0) 73 | self.assertEqual(s.peek(), b"0") 74 | self.assertEqual(s.send(bytes(1)), 1) 75 | self.assertEqual(s.recv(1, 0), b"0") 76 | self.assertEqual(s.recvfrom(1), (b"0", socket.AF_INET, "127.0.0.2", 2)) 77 | self.assertEqual(s.sendto(bytes(1), (None, None)), 1) 78 | self.assertEqual(len(s.history["sendto"]), 1) 79 | self.assertEqual(s.shutdown(0), None) 80 | 81 | 82 | def main(): 83 | unittest.main() 84 | 85 | 86 | if __name__ == "__main__": 87 | main() 88 | -------------------------------------------------------------------------------- /tests/test_syscall_limiter.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | 14 | # . 15 | # ====================================================================== 16 | 17 | import io 18 | import unittest 19 | 20 | from os import path 21 | from unittest.mock import patch 22 | 23 | from zelos import Zelos 24 | 25 | 26 | # from zelos.api.zelos_api import ZelosCmdline 27 | 28 | DATA_DIR = path.dirname(path.abspath(__file__)) 29 | 30 | 31 | class SyscallLimiterTest(unittest.TestCase): 32 | def test_syscall_limit(self): 33 | z = Zelos( 34 | path.join(DATA_DIR, "data", "dynamic_elf_helloworld"), 35 | syscall_limit=5, 36 | ) 37 | z.start() 38 | self.assertEqual(z.plugins.syscalllimiter.syscall_cnt, 5) 39 | 40 | def test_thread_limit(self): 41 | z = Zelos( 42 | path.join(DATA_DIR, "data", "dynamic_elf_helloworld"), 43 | syscall_thread_limit=5, 44 | ) 45 | z.start() 46 | self.assertEqual(z.plugins.syscalllimiter.syscall_cnt, 5) 47 | 48 | def test_syscall_callback(self): 49 | z = Zelos( 50 | path.join(DATA_DIR, "data", "dynamic_elf_helloworld"), 51 | rep_syscall_print_limit=5, 52 | ) 53 | syscall_name = "brk" 54 | args = None 55 | retval = None 56 | 57 | for _ in range(4): 58 | z.plugins.syscalllimiter._syscall_callback( 59 | z, syscall_name, args, retval 60 | ) 61 | self.assertTrue(z.internal_engine.kernel.should_print_syscalls) 62 | 63 | z.plugins.syscalllimiter._syscall_callback( 64 | z, syscall_name, args, retval 65 | ) 66 | self.assertFalse(z.internal_engine.kernel.should_print_syscalls) 67 | 68 | with patch("sys.stdout", new=io.StringIO()) as stdout: 69 | z.internal_engine.kernel.print("Test") 70 | z.plugins.trace.trace_syscalls(z, syscall_name, args, retval) 71 | self.assertEqual(stdout.getvalue(), "") 72 | 73 | different_syscall_name = "mmap" 74 | z.plugins.syscalllimiter._syscall_callback( 75 | z, different_syscall_name, args, retval 76 | ) 77 | self.assertTrue(z.internal_engine.kernel.should_print_syscalls) 78 | 79 | def test_syscall_callback_rep_0(self): 80 | z = Zelos( 81 | path.join(DATA_DIR, "data", "dynamic_elf_helloworld"), 82 | rep_syscall_print_limit=0, 83 | ) 84 | syscall_name = "brk" 85 | args = None 86 | retval = None 87 | 88 | z.plugins.syscalllimiter._syscall_callback( 89 | z, syscall_name, args, retval 90 | ) 91 | self.assertTrue(z.internal_engine.kernel.should_print_syscalls) 92 | 93 | 94 | def main(): 95 | unittest.main() 96 | 97 | 98 | if __name__ == "__main__": 99 | main() 100 | -------------------------------------------------------------------------------- /tests/test_zelos_profile.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Zeropoint Dynamics 2 | 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU Affero General Public License as 5 | # published by the Free Software Foundation, either version 3 of the 6 | # License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | 13 | # You should have received a copy of the GNU Affero General Public 14 | # License along with this program. If not, see 15 | # . 16 | # ====================================================================== 17 | 18 | import cProfile 19 | import unittest 20 | 21 | from os import path 22 | 23 | from zelos import Zelos # noqa: F401 24 | 25 | 26 | DATA_DIR = path.join(path.dirname(path.abspath(__file__)), "data") 27 | 28 | """ 29 | Run this to get a profile of zelos, in order to understand what 30 | function calls are taking time. 31 | """ 32 | 33 | 34 | class ZelosTest(unittest.TestCase): 35 | def test_profile_helloworld(self): 36 | cProfile.runctx( 37 | 'z = Zelos(path.join(DATA_DIR, "static_elf_helloworld"))', 38 | globals(), 39 | locals(), 40 | ) 41 | 42 | 43 | def main(): 44 | unittest.main() 45 | 46 | 47 | if __name__ == "__main__": 48 | main() 49 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | strict = true 3 | addopts = -ra 4 | testpaths = tests examples 5 | filterwarnings = 6 | once::Warning 7 | ignore:::pympler[.*] 8 | 9 | 10 | [tox] 11 | envlist = lint,py36,py37,py38,manifest,docs,pypi-description,coverage-report 12 | isolated_build = True 13 | 14 | 15 | [testenv] 16 | # Prevent random setuptools/pip breakages like 17 | # https://github.com/pypa/setuptools/issues/1042 from breaking our builds. 18 | setenv = 19 | VIRTUALENV_NO_DOWNLOAD=1 20 | extras = {env:TOX_AP_TEST_EXTRAS:tests} 21 | commands = python -m pytest -n auto --rootdir={envsitepackagesdir}/zelos {posargs} 22 | 23 | 24 | [testenv:py37] 25 | # Python 3.6+ has a number of compile-time warnings on invalid string escapes. 26 | # PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run. 27 | basepython = python3.7 28 | install_command = pip install --no-compile {opts} {packages} 29 | setenv = 30 | PYTHONWARNINGS=d 31 | extras = {env:TOX_AP_TEST_EXTRAS:tests} 32 | commands = coverage run --parallel --source={envsitepackagesdir}/zelos -m pytest {posargs} 33 | 34 | 35 | [testenv:py38] 36 | # Python 3.6+ has a number of compile-time warnings on invalid string escapes. 37 | # PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run. 38 | basepython = python3.8 39 | install_command = pip install --no-compile {opts} {packages} 40 | setenv = 41 | PYTHONWARNINGS=d 42 | extras = {env:TOX_AP_TEST_EXTRAS:tests} 43 | commands = python -m pytest -n auto --rootdir={envsitepackagesdir}/zelos {posargs} 44 | 45 | 46 | [testenv:coverage-report] 47 | basepython = python3.7 48 | skip_install = true 49 | deps = coverage 50 | commands = 51 | coverage combine 52 | coverage report 53 | 54 | 55 | [testenv:lint] 56 | basepython = python3.6 57 | skip_install = true 58 | deps = pre-commit 59 | passenv = HOMEPATH # needed on Windows 60 | commands = pre-commit run --all-files 61 | 62 | 63 | [testenv:docs] 64 | basepython = python3.6 65 | extras = docs 66 | commands = 67 | sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html 68 | sphinx-build -n -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html 69 | python -m doctest README.md 70 | 71 | 72 | [testenv:manifest] 73 | basepython = python3.7 74 | deps = check-manifest 75 | skip_install = true 76 | commands = check-manifest --ignore-bad-ideas src/zelos/ext/env/*.so,tests/*.so --ignore tests/data/* 77 | 78 | 79 | [testenv:pypi-description] 80 | basepython = python3.7 81 | skip_install = true 82 | deps = 83 | twine 84 | pip >= 18.0.0 85 | commands = 86 | pip wheel -w {envtmpdir}/build --no-deps . 87 | twine check {envtmpdir}/build/* 88 | --------------------------------------------------------------------------------