objutils 0.10.12__tar.gz → 0.10.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {objutils-0.10.12 → objutils-0.10.13}/.pre-commit-config.yaml +1 -1
- {objutils-0.10.12 → objutils-0.10.13}/PKG-INFO +1 -1
- {objutils-0.10.12 → objutils-0.10.13}/objutils/__init__.py +1 -1
- {objutils-0.10.12 → objutils-0.10.13}/objutils/image.py +69 -5
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_hex_split.py +138 -135
- {objutils-0.10.12 → objutils-0.10.13}/objutils/section.py +24 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_image.py +37 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_section.py +18 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/version.py +1 -1
- {objutils-0.10.12 → objutils-0.10.13}/pyproject.toml +2 -2
- {objutils-0.10.12 → objutils-0.10.13}/.clang-format +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.codacy.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.codeclimate.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.coveralls.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.github/FUNDING.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.github/ISSUE_TEMPLATE/documentation.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.github/ISSUE_TEMPLATE.md +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.github/copilot-instructions.md +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.github/workflows/pythonapp.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.gitignore +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.idea/.gitignore +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.idea/copilot.data.migration.ask2agent.xml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.idea/deployment.xml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.idea/misc.xml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.idea/modules.xml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.idea/pyLspTools.xml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.idea/pyProjectModel.xml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.idea/vcs.xml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.pylintrc +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.readthedocs.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/.travis.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/CMakeLists.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/CODE_OF_CONDUCT.md +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/CONTRIBUTORS +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/LICENSE +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/MANIFEST.in +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/PULL_REQUEST_TEMPLATE.md +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/appveyor.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/bandit.yml +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/Data_Formats.pdf +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/ELF_Format.pdf +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/KNOWN_GOOD_DWARF_REFERENCE.md +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/README.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/apidoc.sh +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/conf.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.buildinfo +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.buildinfo.bak +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/README.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/environment.pickle +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/howto.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/index.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/installation.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/modules.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/objutils.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/objutils.elf.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/scripts.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/session.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/.doctrees/tutorial.doctree +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/README.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_images/objutils_basic.png +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/index.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/ash.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/binfile.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/checksums.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/cosmac.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/elf/defs.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/elf.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/emon52.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/etek.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/exceptions.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/fpc.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/hexdump.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/hexfile.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/ihex.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/image.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/logger.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/mostec.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/pickleif.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/rca.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/readers.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/registry.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/section.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/sig.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/srec.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/tek.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/titxt.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils/utils.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_modules/objutils.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/README.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/howto.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/index.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/installation.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/modules.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/objutils.elf.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/objutils.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/scripts.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/session.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_sources/tutorial.rst.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/alabaster.css +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/basic.css +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/check-solid.svg +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/clipboard.min.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/copy-button.svg +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/copybutton.css +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/copybutton.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/copybutton_funcs.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/custom.css +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/doctools.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/documentation_options.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/file.png +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/github-banner.svg +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/language_data.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/minus.png +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/plus.png +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/pygments.css +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/scripts/bootstrap.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/scripts/bootstrap.js.LICENSE.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/scripts/fontawesome.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/scripts/fontawesome.js.LICENSE.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/scripts/pydata-sphinx-theme.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/searchtools.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/sphinx_highlight.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/styles/pydata-sphinx-theme.css +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/styles/theme.css +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/_static/webpack-macros.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/genindex.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/howto.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/index.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/installation.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/modules.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/objects.inv +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/objutils.elf.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/objutils.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/py-modindex.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/scripts.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/search.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/searchindex.js +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/session.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/docs/_build/html/tutorial.html +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/elf-64-gen.pdf +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/example0.srec +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/howto.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/index.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/installation.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/make.bat +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/modules.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/objutils.elf.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/objutils.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/objutils_banner.png +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/objutils_basic.png +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/objutils_dark.jpg +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/objutils_social.jpg +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/requirements.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/scripts.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/session.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/tutorial.rst +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/docs/tutorial1.ipynb +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/.coveragerc +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/.vscode/launch.json +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/.vscode/settings.json +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/a2l_test.shf +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/ash.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/binfile.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/checksums.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/cosmac.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/dwarf/__init__.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/dwarf/attrparser.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/dwarf/c_generator.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/dwarf/constants.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/dwarf/encoding.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/dwarf/lineprog.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/dwarf/readers.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/dwarf/sm.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/dwarf/traverser.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/elf/__init__.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/elf/arm/__init__.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/elf/arm/attributes.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/elf/defs.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/elf/model.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/emon52.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/etek.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/exceptions.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/extensions/__init__.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/extensions/ctre.hpp +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/extensions/difflib.h +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/extensions/exceptions.cpp +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/extensions/exceptions.hpp +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/extensions/hexfile.cpp +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/extensions/wrapper.cpp +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/fpc.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/hexdump.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/hexfile.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/ieee695.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/ihex.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/logger.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/mostec.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/objutils.code-workspace +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/oocdtxt.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/pecoff/__init__.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/pecoff/defs.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/pecoff/model.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/pecoff/pdb/__init__.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/pickleif.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/rca.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/readers.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/registry.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/arduino_build_artifacts.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_cgen.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_coff_extract.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_coff_import.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_coff_info.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_coff_syms.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_dwarf_import.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_dwarf_info.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_elf_arm_attrs.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_elf_extract.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_elf_import.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_elf_info.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_elf_syms.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_hex_info.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/scripts/oj_hex_merge.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/shf.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/sig.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/srec.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/symbols.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tek.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/__init__.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_arm_attributes.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_ash.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_c_generator.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_checksums.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_cygpath.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_diff_bin.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_elf.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_emon52.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_etek.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_examples_cgen.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_fpc.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_hexdump.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_hexfile.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_ihex.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_mostec.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_oocdtxt.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_readers.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_registry.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_repr.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_section_join.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_shf.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_sm.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_srec.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_tek.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/tests/test_titext.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/titxt.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/utils/__init__.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/utils/arduino.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/objutils/utils/diff.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/poetry.lock +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/requirements.txt +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/setup.cfg +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/setup.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/test_join_sections.py +0 -0
- {objutils-0.10.12 → objutils-0.10.13}/test_requirements.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: objutils
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.13
|
|
4
4
|
Summary: Objectfile library for Python
|
|
5
5
|
Keywords: hex files,intel hex,s19,srec,srecords,object files,map files,embedded,microcontroller,ECU,shf,rfc4194
|
|
6
6
|
Author-Email: Christoph Schueler <cpu12.gems@googlemail.com>
|
|
@@ -165,6 +165,10 @@ Usage Examples
|
|
|
165
165
|
if 0x1050 in img:
|
|
166
166
|
data = img.read(0x1050, 16)
|
|
167
167
|
|
|
168
|
+
# Check if address range is fully contained
|
|
169
|
+
if img.contains_range(0x1000, 0x100):
|
|
170
|
+
data = img.read(0x1000, 0x100)
|
|
171
|
+
|
|
168
172
|
# Iterate over sections
|
|
169
173
|
for section in img:
|
|
170
174
|
print(f"Section at 0x{section.start_address:08X}, "
|
|
@@ -468,8 +472,61 @@ class Image:
|
|
|
468
472
|
return not (self == other)
|
|
469
473
|
|
|
470
474
|
def __contains__(self, addr: int) -> bool:
|
|
471
|
-
"""Check if address is contained in any section.
|
|
472
|
-
|
|
475
|
+
"""Check if address is contained in any section of the image.
|
|
476
|
+
|
|
477
|
+
Args:
|
|
478
|
+
addr: Address to check.
|
|
479
|
+
|
|
480
|
+
Returns:
|
|
481
|
+
True if the address is within any section, False otherwise.
|
|
482
|
+
"""
|
|
483
|
+
return any(addr in section for section in self.sections)
|
|
484
|
+
|
|
485
|
+
def contains_range(self, addr: int, size: int) -> bool:
|
|
486
|
+
"""Check if address range is fully contained in the image.
|
|
487
|
+
|
|
488
|
+
Args:
|
|
489
|
+
addr: Start address of the range.
|
|
490
|
+
size: Size of the range.
|
|
491
|
+
|
|
492
|
+
Returns:
|
|
493
|
+
True if the entire range [addr, addr + size) is covered by sections.
|
|
494
|
+
"""
|
|
495
|
+
if size < 0:
|
|
496
|
+
return False
|
|
497
|
+
if size == 0:
|
|
498
|
+
return addr in self
|
|
499
|
+
|
|
500
|
+
# Check if the range is covered by sections.
|
|
501
|
+
# Since sections are sorted and non-overlapping, we can check continuity.
|
|
502
|
+
remaining_size = size
|
|
503
|
+
current_addr = addr
|
|
504
|
+
|
|
505
|
+
# Find the first section that could contain current_addr
|
|
506
|
+
import bisect
|
|
507
|
+
from operator import attrgetter
|
|
508
|
+
idx = bisect.bisect_right(self.sections, current_addr, key=attrgetter("start_address")) - 1
|
|
509
|
+
if idx < 0:
|
|
510
|
+
idx = 0
|
|
511
|
+
|
|
512
|
+
while idx < len(self.sections) and remaining_size > 0:
|
|
513
|
+
section = self.sections[idx]
|
|
514
|
+
if current_addr < section.start_address:
|
|
515
|
+
# Gap before this section
|
|
516
|
+
return False
|
|
517
|
+
|
|
518
|
+
if current_addr < section.start_address + len(section):
|
|
519
|
+
# current_addr is in this section
|
|
520
|
+
covered = min(remaining_size, (section.start_address + len(section)) - current_addr)
|
|
521
|
+
remaining_size -= covered
|
|
522
|
+
current_addr += covered
|
|
523
|
+
else:
|
|
524
|
+
# current_addr is beyond this section
|
|
525
|
+
pass
|
|
526
|
+
|
|
527
|
+
idx += 1
|
|
528
|
+
|
|
529
|
+
return remaining_size == 0
|
|
473
530
|
|
|
474
531
|
def hexdump(self, fp=sys.stdout) -> None:
|
|
475
532
|
"""Print hexadecimal dump of all sections.
|
|
@@ -818,16 +875,21 @@ class Image:
|
|
|
818
875
|
self._call_address_function("write_string", addr, value, encoding, **kws)
|
|
819
876
|
|
|
820
877
|
def _address_contained(self, address: int, length: int) -> bool:
|
|
821
|
-
"""Check if address range
|
|
878
|
+
"""Check if address range has ANY overlap with the image.
|
|
822
879
|
|
|
823
880
|
Args:
|
|
824
881
|
address: Start address to check.
|
|
825
882
|
length: Length of the address range.
|
|
826
883
|
|
|
827
884
|
Returns:
|
|
828
|
-
True if the address range
|
|
885
|
+
True if the address range overlaps with any section, False otherwise.
|
|
829
886
|
"""
|
|
830
|
-
|
|
887
|
+
if length <= 0:
|
|
888
|
+
return False
|
|
889
|
+
end = address + length
|
|
890
|
+
# A range [address, end) overlaps with [s.start, s.end) if:
|
|
891
|
+
# address < s.end AND s.start < end
|
|
892
|
+
return any(address < (s.start_address + len(s)) and s.start_address < end for s in self.sections)
|
|
831
893
|
|
|
832
894
|
def insert_section(
|
|
833
895
|
self, data: Union[bytes, bytearray, memoryview, str], start_address: Optional[int] = None, join: bool = True
|
|
@@ -901,6 +963,8 @@ class Image:
|
|
|
901
963
|
This method currently only validates the address range but does not
|
|
902
964
|
perform the actual update operation. Full implementation is pending.
|
|
903
965
|
"""
|
|
966
|
+
if address is None:
|
|
967
|
+
address = self.address
|
|
904
968
|
if not self._address_contained(address, len(data)):
|
|
905
969
|
raise InvalidAddressError("Address-space not in range")
|
|
906
970
|
|
|
@@ -1,135 +1,138 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
"""Splits a HEX file into multiple files based on its sections."""
|
|
3
|
-
|
|
4
|
-
__copyright__ = """
|
|
5
|
-
objutils - Object file library for Python.
|
|
6
|
-
|
|
7
|
-
(C) 2010-2026 by Christoph Schueler <cpu12.gems@googlemail.com>
|
|
8
|
-
|
|
9
|
-
All Rights Reserved
|
|
10
|
-
|
|
11
|
-
This program is free software; you can redistribute it and/or modify
|
|
12
|
-
it under the terms of the GNU General Public License as published by
|
|
13
|
-
the Free Software Foundation; either version 2 of the License, or
|
|
14
|
-
(at your option) any later version.
|
|
15
|
-
|
|
16
|
-
This program is distributed in the hope that it will be useful,
|
|
17
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
-
GNU General Public License for more details.
|
|
20
|
-
|
|
21
|
-
You should have received a copy of the GNU General Public License along
|
|
22
|
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
23
|
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
import argparse
|
|
27
|
-
import sys
|
|
28
|
-
from os import path
|
|
29
|
-
from pathlib import Path
|
|
30
|
-
|
|
31
|
-
from objutils import load, probe, dump
|
|
32
|
-
from ufilename import build_filename, SuffixPolicy, IdentityPolicy
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def main():
|
|
36
|
-
parser = argparse.ArgumentParser(description="Splits a HEX file into multiple files based on its sections.")
|
|
37
|
-
parser.add_argument(
|
|
38
|
-
"input_file",
|
|
39
|
-
help="Input HEX file to be split.",
|
|
40
|
-
)
|
|
41
|
-
parser.add_argument(
|
|
42
|
-
"-o",
|
|
43
|
-
"--output-names",
|
|
44
|
-
nargs="+",
|
|
45
|
-
help="Optional list of output base names. If not provided, section numbers are used.",
|
|
46
|
-
)
|
|
47
|
-
parser.add_argument(
|
|
48
|
-
"-t",
|
|
49
|
-
"--type",
|
|
50
|
-
dest="output_type",
|
|
51
|
-
help="Output file type (e.g., ihex, srec). If omitted, it's inferred from the input file extension.",
|
|
52
|
-
)
|
|
53
|
-
parser.add_argument(
|
|
54
|
-
"-p",
|
|
55
|
-
"--prefix",
|
|
56
|
-
help="Prefix for output filenames. Defaults to input filename (without extension).",
|
|
57
|
-
)
|
|
58
|
-
parser.add_argument(
|
|
59
|
-
"-v",
|
|
60
|
-
"--verbose",
|
|
61
|
-
dest="verbose",
|
|
62
|
-
action="store_true",
|
|
63
|
-
default=False,
|
|
64
|
-
help="Verbose output",
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
args = parser.parse_args()
|
|
68
|
-
|
|
69
|
-
if not path.exists(args.input_file):
|
|
70
|
-
print(f"File '{args.input_file}' does not exist.")
|
|
71
|
-
sys.exit(1)
|
|
72
|
-
|
|
73
|
-
with open(args.input_file, "rb") as f:
|
|
74
|
-
file_type = probe(f)
|
|
75
|
-
|
|
76
|
-
if file_type is None:
|
|
77
|
-
print(f"Could not determine file type for '{args.input_file}'.")
|
|
78
|
-
sys.exit(1)
|
|
79
|
-
|
|
80
|
-
img = load(file_type, args.input_file)
|
|
81
|
-
|
|
82
|
-
if not img.sections:
|
|
83
|
-
print(f"No sections found in '{args.input_file}'.")
|
|
84
|
-
sys.exit(0)
|
|
85
|
-
|
|
86
|
-
output_type = args.output_type
|
|
87
|
-
input_path = Path(args.input_file)
|
|
88
|
-
if not output_type:
|
|
89
|
-
ext = input_path.suffix.lower()
|
|
90
|
-
if ext in (".hex", ".ihex"):
|
|
91
|
-
output_type = "ihex"
|
|
92
|
-
elif ext in (".s19", ".srec", ".mot"):
|
|
93
|
-
output_type = "srec"
|
|
94
|
-
elif ext in (".bin",):
|
|
95
|
-
output_type = "bin"
|
|
96
|
-
else:
|
|
97
|
-
output_type = "ihex"
|
|
98
|
-
|
|
99
|
-
base_prefix = args.prefix if args.prefix else input_path.stem
|
|
100
|
-
output_ext = input_path.suffix if not args.output_type else f".{args.output_type}"
|
|
101
|
-
# Normalize extension mapping for ufilename
|
|
102
|
-
if args.output_type:
|
|
103
|
-
if args.output_type == "ihex":
|
|
104
|
-
|
|
105
|
-
elif args.output_type == "
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""Splits a HEX file into multiple files based on its sections."""
|
|
3
|
+
|
|
4
|
+
__copyright__ = """
|
|
5
|
+
objutils - Object file library for Python.
|
|
6
|
+
|
|
7
|
+
(C) 2010-2026 by Christoph Schueler <cpu12.gems@googlemail.com>
|
|
8
|
+
|
|
9
|
+
All Rights Reserved
|
|
10
|
+
|
|
11
|
+
This program is free software; you can redistribute it and/or modify
|
|
12
|
+
it under the terms of the GNU General Public License as published by
|
|
13
|
+
the Free Software Foundation; either version 2 of the License, or
|
|
14
|
+
(at your option) any later version.
|
|
15
|
+
|
|
16
|
+
This program is distributed in the hope that it will be useful,
|
|
17
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
GNU General Public License for more details.
|
|
20
|
+
|
|
21
|
+
You should have received a copy of the GNU General Public License along
|
|
22
|
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
23
|
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
import argparse
|
|
27
|
+
import sys
|
|
28
|
+
from os import path
|
|
29
|
+
from pathlib import Path
|
|
30
|
+
|
|
31
|
+
from objutils import load, probe, dump
|
|
32
|
+
from ufilename import build_filename, SuffixPolicy, IdentityPolicy
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def main():
|
|
36
|
+
parser = argparse.ArgumentParser(description="Splits a HEX file into multiple files based on its sections.")
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
"input_file",
|
|
39
|
+
help="Input HEX file to be split.",
|
|
40
|
+
)
|
|
41
|
+
parser.add_argument(
|
|
42
|
+
"-o",
|
|
43
|
+
"--output-names",
|
|
44
|
+
nargs="+",
|
|
45
|
+
help="Optional list of output base names. If not provided, section numbers are used.",
|
|
46
|
+
)
|
|
47
|
+
parser.add_argument(
|
|
48
|
+
"-t",
|
|
49
|
+
"--type",
|
|
50
|
+
dest="output_type",
|
|
51
|
+
help="Output file type (e.g., ihex, srec). If omitted, it's inferred from the input file extension.",
|
|
52
|
+
)
|
|
53
|
+
parser.add_argument(
|
|
54
|
+
"-p",
|
|
55
|
+
"--prefix",
|
|
56
|
+
help="Prefix for output filenames. Defaults to input filename (without extension).",
|
|
57
|
+
)
|
|
58
|
+
parser.add_argument(
|
|
59
|
+
"-v",
|
|
60
|
+
"--verbose",
|
|
61
|
+
dest="verbose",
|
|
62
|
+
action="store_true",
|
|
63
|
+
default=False,
|
|
64
|
+
help="Verbose output",
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
args = parser.parse_args()
|
|
68
|
+
|
|
69
|
+
if not path.exists(args.input_file):
|
|
70
|
+
print(f"File '{args.input_file}' does not exist.")
|
|
71
|
+
sys.exit(1)
|
|
72
|
+
|
|
73
|
+
with open(args.input_file, "rb") as f:
|
|
74
|
+
file_type = probe(f)
|
|
75
|
+
|
|
76
|
+
if file_type is None:
|
|
77
|
+
print(f"Could not determine file type for '{args.input_file}'.")
|
|
78
|
+
sys.exit(1)
|
|
79
|
+
|
|
80
|
+
img = load(file_type, args.input_file)
|
|
81
|
+
|
|
82
|
+
if not img.sections:
|
|
83
|
+
print(f"No sections found in '{args.input_file}'.")
|
|
84
|
+
sys.exit(0)
|
|
85
|
+
|
|
86
|
+
output_type = args.output_type
|
|
87
|
+
input_path = Path(args.input_file)
|
|
88
|
+
if not output_type:
|
|
89
|
+
ext = input_path.suffix.lower()
|
|
90
|
+
if ext in (".hex", ".ihex"):
|
|
91
|
+
output_type = "ihex"
|
|
92
|
+
elif ext in (".s19", ".srec", ".mot"):
|
|
93
|
+
output_type = "srec"
|
|
94
|
+
elif ext in (".bin",):
|
|
95
|
+
output_type = "bin"
|
|
96
|
+
else:
|
|
97
|
+
output_type = "ihex" # Fallback
|
|
98
|
+
|
|
99
|
+
base_prefix = args.prefix if args.prefix else input_path.stem
|
|
100
|
+
output_ext = input_path.suffix if not args.output_type else f".{args.output_type}"
|
|
101
|
+
# Normalize extension mapping for ufilename
|
|
102
|
+
if args.output_type:
|
|
103
|
+
if args.output_type == "ihex":
|
|
104
|
+
output_ext = ".hex"
|
|
105
|
+
elif args.output_type == "srec":
|
|
106
|
+
output_ext = ".s19"
|
|
107
|
+
elif args.output_type == "bin":
|
|
108
|
+
output_ext = ".bin"
|
|
109
|
+
|
|
110
|
+
if args.verbose:
|
|
111
|
+
print(f"Splitting '{args.input_file}' into {len(img.sections)} sections...")
|
|
112
|
+
|
|
113
|
+
split_images = img.split()
|
|
114
|
+
|
|
115
|
+
for idx, new_img in enumerate(split_images):
|
|
116
|
+
section = new_img.sections[0]
|
|
117
|
+
if args.output_names and idx < len(args.output_names):
|
|
118
|
+
# User provided a list of names
|
|
119
|
+
name_policy = IdentityPolicy()
|
|
120
|
+
out_base = args.output_names[idx]
|
|
121
|
+
else:
|
|
122
|
+
# Default: append section number
|
|
123
|
+
name_policy = SuffixPolicy(suffix=f"_{idx:03d}")
|
|
124
|
+
out_base = base_prefix
|
|
125
|
+
|
|
126
|
+
out_filename = build_filename(name_policy, out_base, output_ext)
|
|
127
|
+
|
|
128
|
+
print(f"Writing '{out_filename}'...")
|
|
129
|
+
if args.verbose:
|
|
130
|
+
print(f" Section {idx:03d} (0x{section.start_address:08x}, {len(section)} bytes)")
|
|
131
|
+
|
|
132
|
+
dump(output_type, out_filename, new_img)
|
|
133
|
+
|
|
134
|
+
print(f"Successfully split into {len(split_images)} files.")
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
if __name__ == "__main__":
|
|
138
|
+
main()
|
|
@@ -47,6 +47,14 @@ Usage Examples
|
|
|
47
47
|
# From bytes
|
|
48
48
|
s1 = Section(start_address=0x1000, data=b"Hello")
|
|
49
49
|
|
|
50
|
+
# Check if address is in the section
|
|
51
|
+
if 0x1050 in s1:
|
|
52
|
+
data = s1.read(0x1050, 1)
|
|
53
|
+
|
|
54
|
+
# Check if address range is fully contained
|
|
55
|
+
if s1.contains_range(0x1000, 5):
|
|
56
|
+
data = s1.read(0x1000, 5)
|
|
57
|
+
|
|
50
58
|
# From string (ASCII encoded)
|
|
51
59
|
s2 = Section(0x2000, "World")
|
|
52
60
|
|
|
@@ -1201,6 +1209,22 @@ class Section:
|
|
|
1201
1209
|
def __contains__(self, addr) -> bool:
|
|
1202
1210
|
return self.start_address <= addr < (self.start_address + self.length)
|
|
1203
1211
|
|
|
1212
|
+
def contains_range(self, addr: int, size: int) -> bool:
|
|
1213
|
+
"""Check if address range is fully contained in the section.
|
|
1214
|
+
|
|
1215
|
+
Args:
|
|
1216
|
+
addr: Start address of the range.
|
|
1217
|
+
size: Size of the range.
|
|
1218
|
+
|
|
1219
|
+
Returns:
|
|
1220
|
+
True if the entire range [addr, addr + size) is within the section.
|
|
1221
|
+
"""
|
|
1222
|
+
if size < 0:
|
|
1223
|
+
return False
|
|
1224
|
+
if size == 0:
|
|
1225
|
+
return addr in self
|
|
1226
|
+
return addr in self and (addr + size - 1) in self
|
|
1227
|
+
|
|
1204
1228
|
@property
|
|
1205
1229
|
def address(self) -> int: # Alias
|
|
1206
1230
|
return self.start_address
|
|
@@ -124,6 +124,43 @@ def test_update2(images):
|
|
|
124
124
|
img0.update_section(data=b"abcdefghij", address=0x109)
|
|
125
125
|
|
|
126
126
|
|
|
127
|
+
def test_image_contains_range():
|
|
128
|
+
s1 = Section(0x100, b"0123")
|
|
129
|
+
s2 = Section(0x104, b"4567")
|
|
130
|
+
img = Image([s1, s2], join=False)
|
|
131
|
+
|
|
132
|
+
# Spanning across sections
|
|
133
|
+
assert img.contains_range(0x100, 8) is True
|
|
134
|
+
assert img.contains_range(0x102, 4) is True
|
|
135
|
+
|
|
136
|
+
# Gaps
|
|
137
|
+
s3 = Section(0x200, b"ABCD")
|
|
138
|
+
img2 = Image([s1, s3], join=False)
|
|
139
|
+
assert img2.contains_range(0x100, 4) is True
|
|
140
|
+
assert img2.contains_range(0x200, 4) is True
|
|
141
|
+
assert img2.contains_range(0x100, 0x104) is False # Gap at 0x104-0x1FF
|
|
142
|
+
|
|
143
|
+
# Partial coverage
|
|
144
|
+
assert img2.contains_range(0x103, 2) is False
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def test_image_address_contained_overlap():
|
|
148
|
+
s1 = Section(0x100, b"0123")
|
|
149
|
+
img = Image(s1)
|
|
150
|
+
|
|
151
|
+
# Internal overlap
|
|
152
|
+
assert img._address_contained(0x101, 2) is True
|
|
153
|
+
# Start overlap
|
|
154
|
+
assert img._address_contained(0x0FF, 2) is True
|
|
155
|
+
# End overlap
|
|
156
|
+
assert img._address_contained(0x103, 2) is True
|
|
157
|
+
# Fully containing
|
|
158
|
+
assert img._address_contained(0x0F0, 0x100) is True
|
|
159
|
+
# No overlap
|
|
160
|
+
assert img._address_contained(0x0F0, 1) is False
|
|
161
|
+
assert img._address_contained(0x104, 1) is False
|
|
162
|
+
|
|
163
|
+
|
|
127
164
|
"""
|
|
128
165
|
|
|
129
166
|
|
|
@@ -96,6 +96,24 @@ def test_adress_out_of_range2():
|
|
|
96
96
|
assert 0x15 not in s0
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
def test_section_contains_range():
|
|
100
|
+
s = Section(0x100, b"0123456789")
|
|
101
|
+
# Full containment
|
|
102
|
+
assert s.contains_range(0x100, 10) is True
|
|
103
|
+
assert s.contains_range(0x100, 5) is True
|
|
104
|
+
assert s.contains_range(0x105, 5) is True
|
|
105
|
+
|
|
106
|
+
# Out of bounds
|
|
107
|
+
assert s.contains_range(0x0FF, 5) is False
|
|
108
|
+
assert s.contains_range(0x100, 11) is False
|
|
109
|
+
assert s.contains_range(0x10A, 1) is False
|
|
110
|
+
|
|
111
|
+
# Zero size
|
|
112
|
+
assert s.contains_range(0x100, 0) is True
|
|
113
|
+
assert s.contains_range(0x109, 0) is True
|
|
114
|
+
assert s.contains_range(0x10A, 0) is False
|
|
115
|
+
|
|
116
|
+
|
|
99
117
|
def test_copy_data_from_other_section():
|
|
100
118
|
data = Section(data="abcd", start_address=0x8000)
|
|
101
119
|
section = Section(data=data)
|
|
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "objutils"
|
|
7
|
-
version = "0.10.
|
|
7
|
+
version = "0.10.13"
|
|
8
8
|
description = "Objectfile library for Python"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Christoph Schueler", email = "cpu12.gems@googlemail.com"}
|
|
@@ -126,7 +126,7 @@ skip = ["*_i686", "*-musllinux*"]
|
|
|
126
126
|
build-frontend = "build"
|
|
127
127
|
|
|
128
128
|
[tool.bumpver]
|
|
129
|
-
current_version = "0.10.
|
|
129
|
+
current_version = "0.10.13"
|
|
130
130
|
version_pattern = "MAJOR.MINOR.PATCH"
|
|
131
131
|
commit_message = "bump version {old_version} -> {new_version}"
|
|
132
132
|
commit = true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|