objutils 0.10.11__tar.gz → 0.10.12__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.11 → objutils-0.10.12}/PKG-INFO +15 -2
- {objutils-0.10.11 → objutils-0.10.12}/docs/README.rst +11 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/scripts.rst +79 -9
- {objutils-0.10.11 → objutils-0.10.12}/objutils/__init__.py +1 -1
- {objutils-0.10.11 → objutils-0.10.12}/objutils/image.py +5 -15
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_hex_info.py +1 -1
- objutils-0.10.12/objutils/scripts/oj_hex_merge.py +130 -0
- objutils-0.10.12/objutils/scripts/oj_hex_split.py +135 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/section.py +4 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/version.py +1 -1
- {objutils-0.10.11 → objutils-0.10.12}/poetry.lock +35 -23
- {objutils-0.10.11 → objutils-0.10.12}/pyproject.toml +9 -5
- objutils-0.10.11/.idea/objutils@1.iml +0 -11
- {objutils-0.10.11 → objutils-0.10.12}/.clang-format +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.codacy.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.codeclimate.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.coveralls.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.github/FUNDING.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE/documentation.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE.md +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.github/copilot-instructions.md +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.github/workflows/pythonapp.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.gitignore +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.idea/.gitignore +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.idea/copilot.data.migration.ask2agent.xml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.idea/deployment.xml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.idea/misc.xml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.idea/modules.xml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.idea/pyLspTools.xml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.idea/pyProjectModel.xml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.idea/vcs.xml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.pre-commit-config.yaml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.pylintrc +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.readthedocs.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/.travis.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/CMakeLists.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/CODE_OF_CONDUCT.md +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/CONTRIBUTORS +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/LICENSE +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/MANIFEST.in +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/PULL_REQUEST_TEMPLATE.md +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/appveyor.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/bandit.yml +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/Data_Formats.pdf +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/ELF_Format.pdf +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/KNOWN_GOOD_DWARF_REFERENCE.md +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/apidoc.sh +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/conf.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.buildinfo +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.buildinfo.bak +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/README.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/environment.pickle +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/howto.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/index.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/installation.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/modules.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/objutils.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/objutils.elf.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/scripts.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/session.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/tutorial.doctree +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/README.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_images/objutils_basic.png +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/index.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/ash.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/binfile.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/checksums.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/cosmac.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/elf/defs.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/elf.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/emon52.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/etek.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/exceptions.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/fpc.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/hexdump.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/hexfile.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/ihex.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/image.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/logger.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/mostec.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/pickleif.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/rca.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/readers.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/registry.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/section.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/sig.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/srec.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/tek.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/titxt.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/utils.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/README.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/howto.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/index.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/installation.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/modules.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/objutils.elf.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/objutils.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/scripts.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/session.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/tutorial.rst.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/alabaster.css +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/basic.css +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/check-solid.svg +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/clipboard.min.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/copy-button.svg +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/copybutton.css +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/copybutton.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/copybutton_funcs.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/custom.css +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/doctools.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/documentation_options.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/file.png +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/github-banner.svg +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/language_data.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/minus.png +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/plus.png +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/pygments.css +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/bootstrap.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/bootstrap.js.LICENSE.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/fontawesome.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/fontawesome.js.LICENSE.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/pydata-sphinx-theme.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/searchtools.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/sphinx_highlight.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/styles/pydata-sphinx-theme.css +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/styles/theme.css +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/webpack-macros.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/genindex.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/howto.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/index.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/installation.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/modules.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/objects.inv +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/objutils.elf.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/objutils.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/py-modindex.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/scripts.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/search.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/searchindex.js +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/session.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/tutorial.html +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/elf-64-gen.pdf +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/example0.srec +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/howto.rst +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/index.rst +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/installation.rst +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/make.bat +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/modules.rst +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/objutils.elf.rst +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/objutils.rst +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/objutils_banner.png +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/objutils_basic.png +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/objutils_dark.jpg +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/objutils_social.jpg +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/requirements.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/session.rst +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/tutorial.rst +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/docs/tutorial1.ipynb +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/.coveragerc +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/.vscode/launch.json +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/.vscode/settings.json +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/a2l_test.shf +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/ash.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/binfile.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/checksums.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/cosmac.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/__init__.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/attrparser.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/c_generator.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/constants.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/encoding.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/lineprog.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/readers.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/sm.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/traverser.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/__init__.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/arm/__init__.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/arm/attributes.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/defs.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/model.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/emon52.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/etek.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/exceptions.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/__init__.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/ctre.hpp +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/difflib.h +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/exceptions.cpp +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/exceptions.hpp +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/hexfile.cpp +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/wrapper.cpp +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/fpc.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/hexdump.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/hexfile.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/ieee695.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/ihex.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/logger.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/mostec.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/objutils.code-workspace +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/oocdtxt.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/pecoff/__init__.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/pecoff/defs.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/pecoff/model.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/pecoff/pdb/__init__.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/pickleif.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/rca.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/readers.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/registry.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/arduino_build_artifacts.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_cgen.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_coff_extract.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_coff_import.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_coff_info.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_coff_syms.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_dwarf_import.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_dwarf_info.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_arm_attrs.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_extract.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_import.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_info.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_syms.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/shf.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/sig.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/srec.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/symbols.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tek.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/__init__.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_arm_attributes.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_ash.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_c_generator.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_checksums.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_cygpath.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_diff_bin.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_elf.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_emon52.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_etek.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_examples_cgen.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_fpc.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_hexdump.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_hexfile.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_ihex.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_image.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_mostec.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_oocdtxt.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_readers.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_registry.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_repr.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_section.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_section_join.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_shf.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_sm.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_srec.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_tek.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_titext.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/titxt.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/utils/__init__.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/utils/arduino.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/objutils/utils/diff.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/requirements.txt +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/setup.cfg +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/setup.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/test_join_sections.py +0 -0
- {objutils-0.10.11 → objutils-0.10.12}/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.12
|
|
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>
|
|
@@ -10,11 +10,12 @@ Classifier: Intended Audience :: Developers
|
|
|
10
10
|
Classifier: Topic :: Software Development
|
|
11
11
|
Classifier: Topic :: Scientific/Engineering
|
|
12
12
|
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
19
|
Project-URL: Repository, https://www.github.com/Christoph2/objutils
|
|
19
20
|
Requires-Python: <4.0,>=3.10
|
|
20
21
|
Requires-Dist: construct>=2.10.70
|
|
@@ -22,6 +23,7 @@ Requires-Dist: mako>=1.3.3
|
|
|
22
23
|
Requires-Dist: sqlalchemy>=2.0.29
|
|
23
24
|
Requires-Dist: rich>=14.2
|
|
24
25
|
Requires-Dist: numpy>=2.2.5
|
|
26
|
+
Requires-Dist: ufilename<0.2.0,>=0.1.1
|
|
25
27
|
Provides-Extra: dev
|
|
26
28
|
Requires-Dist: bumpver>=2023.1129; extra == "dev"
|
|
27
29
|
Requires-Dist: pre-commit>=3.7.0; extra == "dev"
|
|
@@ -78,11 +80,14 @@ Features
|
|
|
78
80
|
|
|
79
81
|
- Read ELF files (including symbols) and extract loadable sections.
|
|
80
82
|
- Inspect PE/COFF files and symbols (optional PDB support).
|
|
83
|
+
- Merge multiple HEX files into one (``oj-hex-merge``).
|
|
84
|
+
- Split HEX files into separate sections (``oj-hex-split``).
|
|
81
85
|
- Typed access (scalars, arrays, strings) to binary data.
|
|
82
86
|
|
|
83
87
|
Recent improvements
|
|
84
88
|
-------------------
|
|
85
89
|
|
|
90
|
+
- New ``oj-hex-merge`` and ``oj-hex-split`` CLI tools for combining and partitioning HEX files.
|
|
86
91
|
- New ``oj-dwarf-import`` CLI replaces ``dwarfer.py``/``cu_info.py`` for DWARF imports, CU listing, summaries, and attribute traversal.
|
|
87
92
|
- Faster DWARF imports: batched ORM writes, quiet flag propagation, and safe DWARF expression evaluation keep large ELF files stable.
|
|
88
93
|
- Exception handling and typing tightened across DWARF/ELF/PECOFF modules and public APIs to surface real errors without masking them.
|
|
@@ -215,6 +220,14 @@ And loaded again...
|
|
|
215
220
|
Section(address = 0X00001000, length = 16, data = b'Hello HEX world!')
|
|
216
221
|
Section(address = 0X00002000, length = 16, data = b'\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10')
|
|
217
222
|
|
|
223
|
+
Or split it into its sections...
|
|
224
|
+
|
|
225
|
+
.. code-block:: python
|
|
226
|
+
|
|
227
|
+
images = img1.split()
|
|
228
|
+
for i, img in enumerate(images):
|
|
229
|
+
dump("srec", f"part_{i}.srec", img)
|
|
230
|
+
|
|
218
231
|
This leads to the conversion idiom.
|
|
219
232
|
|
|
220
233
|
.. code-block:: python
|
|
@@ -44,11 +44,14 @@ Features
|
|
|
44
44
|
|
|
45
45
|
- Read ELF files (including symbols) and extract loadable sections.
|
|
46
46
|
- Inspect PE/COFF files and symbols (optional PDB support).
|
|
47
|
+
- Merge multiple HEX files into one (``oj-hex-merge``).
|
|
48
|
+
- Split HEX files into separate sections (``oj-hex-split``).
|
|
47
49
|
- Typed access (scalars, arrays, strings) to binary data.
|
|
48
50
|
|
|
49
51
|
Recent improvements
|
|
50
52
|
-------------------
|
|
51
53
|
|
|
54
|
+
- New ``oj-hex-merge`` and ``oj-hex-split`` CLI tools for combining and partitioning HEX files.
|
|
52
55
|
- New ``oj-dwarf-import`` CLI replaces ``dwarfer.py``/``cu_info.py`` for DWARF imports, CU listing, summaries, and attribute traversal.
|
|
53
56
|
- Faster DWARF imports: batched ORM writes, quiet flag propagation, and safe DWARF expression evaluation keep large ELF files stable.
|
|
54
57
|
- Exception handling and typing tightened across DWARF/ELF/PECOFF modules and public APIs to surface real errors without masking them.
|
|
@@ -181,6 +184,14 @@ And loaded again...
|
|
|
181
184
|
Section(address = 0X00001000, length = 16, data = b'Hello HEX world!')
|
|
182
185
|
Section(address = 0X00002000, length = 16, data = b'\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10')
|
|
183
186
|
|
|
187
|
+
Or split it into its sections...
|
|
188
|
+
|
|
189
|
+
.. code-block:: python
|
|
190
|
+
|
|
191
|
+
images = img1.split()
|
|
192
|
+
for i, img in enumerate(images):
|
|
193
|
+
dump("srec", f"part_{i}.srec", img)
|
|
194
|
+
|
|
184
195
|
This leads to the conversion idiom.
|
|
185
196
|
|
|
186
197
|
.. code-block:: python
|
|
@@ -278,22 +278,19 @@ oj_hex_info
|
|
|
278
278
|
|
|
279
279
|
.. code-block:: shell
|
|
280
280
|
|
|
281
|
-
usage: oj-hex-info [-h] [-d]
|
|
282
|
-
|
|
283
|
-
hex_file
|
|
281
|
+
usage: oj-hex-info [-h] [-d] [-p]
|
|
282
|
+
[file_type] hex_file
|
|
284
283
|
|
|
285
284
|
Displays informations about HEX files.
|
|
286
285
|
|
|
287
286
|
positional arguments:
|
|
288
|
-
|
|
289
|
-
file type
|
|
287
|
+
file_type file type (optional, if omitted it is probed)
|
|
290
288
|
hex_file HEX file
|
|
291
289
|
|
|
292
290
|
optional arguments:
|
|
293
291
|
-h, --help show this help message and exit
|
|
294
292
|
-d, --dump hexdump contents
|
|
295
|
-
|
|
296
|
-
Filetype is a required argument (no auto-probing yet).
|
|
293
|
+
-p, --print-filename Print filename including path
|
|
297
294
|
|
|
298
295
|
Run it as follows:
|
|
299
296
|
|
|
@@ -301,8 +298,9 @@ Without any optional arguments just the addresses and lengths of the contained s
|
|
|
301
298
|
|
|
302
299
|
.. code-block:: shell
|
|
303
300
|
|
|
304
|
-
$
|
|
301
|
+
$ oj-hex-info sample.srec
|
|
305
302
|
|
|
303
|
+
Sections
|
|
306
304
|
--------
|
|
307
305
|
|
|
308
306
|
Num Address Length
|
|
@@ -316,7 +314,7 @@ If you also want to see the contents, add *-d* option:
|
|
|
316
314
|
|
|
317
315
|
.. code-block:: shell
|
|
318
316
|
|
|
319
|
-
$
|
|
317
|
+
$ oj-hex-info sample.srec -d
|
|
320
318
|
|
|
321
319
|
Sections
|
|
322
320
|
--------
|
|
@@ -342,6 +340,78 @@ If you also want to see the contents, add *-d* option:
|
|
|
342
340
|
16 bytes
|
|
343
341
|
---------------
|
|
344
342
|
|
|
343
|
+
oj_hex_merge
|
|
344
|
+
------------
|
|
345
|
+
|
|
346
|
+
.. code-block:: shell
|
|
347
|
+
|
|
348
|
+
usage: oj-hex-merge [-h] -o OUTPUT [-t OUTPUT_TYPE] [-p] [-v]
|
|
349
|
+
input_files [input_files ...]
|
|
350
|
+
|
|
351
|
+
Merges multiple HEX files into one.
|
|
352
|
+
|
|
353
|
+
positional arguments:
|
|
354
|
+
input_files Input HEX files to be merged.
|
|
355
|
+
|
|
356
|
+
optional arguments:
|
|
357
|
+
-h, --help show this help message and exit
|
|
358
|
+
-o OUTPUT, --output OUTPUT
|
|
359
|
+
Output HEX file.
|
|
360
|
+
-t OUTPUT_TYPE, --type OUTPUT_TYPE
|
|
361
|
+
Output file type (e.g., ihex, srec). If omitted, it's
|
|
362
|
+
inferred from the output file extension.
|
|
363
|
+
-p, --print-filename Print filenames while processing
|
|
364
|
+
-v, --verbose Verbose output
|
|
365
|
+
|
|
366
|
+
Example:
|
|
367
|
+
|
|
368
|
+
.. code-block:: shell
|
|
369
|
+
|
|
370
|
+
$ oj-hex-merge file1.hex file2.hex -o merged.hex
|
|
371
|
+
|
|
372
|
+
Note: Merging files with overlapping sections is not allowed and will result in an error.
|
|
373
|
+
|
|
374
|
+
oj_hex_split
|
|
375
|
+
------------
|
|
376
|
+
|
|
377
|
+
.. code-block:: shell
|
|
378
|
+
|
|
379
|
+
usage: oj-hex-split [-h] [-o OUTPUT_NAMES [OUTPUT_NAMES ...]]
|
|
380
|
+
[-t OUTPUT_TYPE] [-p PREFIX] [-v]
|
|
381
|
+
input_file
|
|
382
|
+
|
|
383
|
+
Splits a HEX file into multiple files based on its sections.
|
|
384
|
+
|
|
385
|
+
positional arguments:
|
|
386
|
+
input_file Input HEX file to be split.
|
|
387
|
+
|
|
388
|
+
optional arguments:
|
|
389
|
+
-h, --help show this help message and exit
|
|
390
|
+
-o OUTPUT_NAMES [OUTPUT_NAMES ...], --output-names OUTPUT_NAMES [OUTPUT_NAMES ...]
|
|
391
|
+
Optional list of output base names. If not provided,
|
|
392
|
+
section numbers are used.
|
|
393
|
+
-t OUTPUT_TYPE, --type OUTPUT_TYPE
|
|
394
|
+
Output file type (e.g., ihex, srec). If omitted, it's
|
|
395
|
+
inferred from the input file extension.
|
|
396
|
+
-p PREFIX, --prefix PREFIX
|
|
397
|
+
Prefix for output filenames. Defaults to input
|
|
398
|
+
filename (without extension).
|
|
399
|
+
-v, --verbose Verbose output
|
|
400
|
+
|
|
401
|
+
Example:
|
|
402
|
+
|
|
403
|
+
.. code-block:: shell
|
|
404
|
+
|
|
405
|
+
$ oj-hex-split merged.hex
|
|
406
|
+
|
|
407
|
+
This will generate files like ``merged_000.hex``, ``merged_001.hex``, etc.
|
|
408
|
+
|
|
409
|
+
You can also specify custom names:
|
|
410
|
+
|
|
411
|
+
.. code-block:: shell
|
|
412
|
+
|
|
413
|
+
$ oj-hex-split merged.hex -o code data
|
|
414
|
+
|
|
345
415
|
oj_coff_info
|
|
346
416
|
------------
|
|
347
417
|
|
|
@@ -940,23 +940,13 @@ class Image:
|
|
|
940
940
|
if not (new_address + len(section) <= s.start_address or new_address >= s.start_address + len(s)):
|
|
941
941
|
raise InvalidAddressError(f"New address 0x{new_address:08x} causes overlap with section at 0x{s.start_address:08x}")
|
|
942
942
|
|
|
943
|
-
def split(self
|
|
944
|
-
"""Split image into multiple parts.
|
|
943
|
+
def split(self) -> list["Image"]:
|
|
944
|
+
"""Split image into multiple parts based on sections.
|
|
945
945
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
equal_parts: Number of equal-sized parts to split into.
|
|
949
|
-
remap: If True, remap addresses after splitting.
|
|
950
|
-
|
|
951
|
-
Raises:
|
|
952
|
-
NotImplementedError: This method is not yet implemented.
|
|
953
|
-
|
|
954
|
-
Note:
|
|
955
|
-
This method is currently a placeholder and needs to be fully
|
|
956
|
-
implemented for production use. The parameters define different
|
|
957
|
-
splitting strategies that need to be developed.
|
|
946
|
+
Returns:
|
|
947
|
+
List of Image objects, each containing exactly one section.
|
|
958
948
|
"""
|
|
959
|
-
|
|
949
|
+
return [Image([section], join=False) for section in self.sections]
|
|
960
950
|
|
|
961
951
|
|
|
962
952
|
def _validate_sections(sections: Iterable[Section]) -> None:
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""Merges multiple HEX files into one."""
|
|
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
|
+
|
|
30
|
+
from objutils import load, probe, dump, Image
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def main():
|
|
34
|
+
parser = argparse.ArgumentParser(description="Merges multiple HEX files into one.")
|
|
35
|
+
parser.add_argument(
|
|
36
|
+
"input_files",
|
|
37
|
+
nargs="+",
|
|
38
|
+
help="Input HEX files to be merged.",
|
|
39
|
+
)
|
|
40
|
+
parser.add_argument(
|
|
41
|
+
"-o",
|
|
42
|
+
"--output",
|
|
43
|
+
required=True,
|
|
44
|
+
help="Output HEX file.",
|
|
45
|
+
)
|
|
46
|
+
parser.add_argument(
|
|
47
|
+
"-t",
|
|
48
|
+
"--type",
|
|
49
|
+
dest="output_type",
|
|
50
|
+
help="Output file type (e.g., ihex, srec). If omitted, it's inferred from the output file extension.",
|
|
51
|
+
)
|
|
52
|
+
parser.add_argument(
|
|
53
|
+
"-p",
|
|
54
|
+
"--print-filename",
|
|
55
|
+
dest="print_filename",
|
|
56
|
+
action="store_true",
|
|
57
|
+
default=False,
|
|
58
|
+
help="Print filenames while processing",
|
|
59
|
+
)
|
|
60
|
+
parser.add_argument(
|
|
61
|
+
"-v",
|
|
62
|
+
"--verbose",
|
|
63
|
+
dest="verbose",
|
|
64
|
+
action="store_true",
|
|
65
|
+
default=False,
|
|
66
|
+
help="Verbose output",
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
args = parser.parse_args()
|
|
70
|
+
|
|
71
|
+
output_type = args.output_type
|
|
72
|
+
if not output_type:
|
|
73
|
+
ext = path.splitext(args.output)[1].lower()
|
|
74
|
+
if ext in (".hex", ".ihex"):
|
|
75
|
+
output_type = "ihex"
|
|
76
|
+
elif ext in (".s19", ".srec", ".mot"):
|
|
77
|
+
output_type = "srec"
|
|
78
|
+
elif ext in (".bin",):
|
|
79
|
+
output_type = "bin"
|
|
80
|
+
else:
|
|
81
|
+
print(f"Could not infer output type from extension '{ext}'. Please specify with -t.")
|
|
82
|
+
sys.exit(1)
|
|
83
|
+
|
|
84
|
+
all_sections = []
|
|
85
|
+
|
|
86
|
+
for filename in args.input_files:
|
|
87
|
+
if not path.exists(filename):
|
|
88
|
+
print(f"File '{filename}' does not exist.")
|
|
89
|
+
sys.exit(1)
|
|
90
|
+
|
|
91
|
+
if args.print_filename:
|
|
92
|
+
print(f"Processing '{filename}'...")
|
|
93
|
+
|
|
94
|
+
with open(filename, "rb") as f:
|
|
95
|
+
file_type = probe(f)
|
|
96
|
+
|
|
97
|
+
if file_type is None:
|
|
98
|
+
print(f"Could not determine file type for '{filename}'.")
|
|
99
|
+
sys.exit(1)
|
|
100
|
+
|
|
101
|
+
img = load(file_type, filename)
|
|
102
|
+
for section in img:
|
|
103
|
+
# Check for overlaps manually to satisfy "No overlaps allowed during merge"
|
|
104
|
+
for existing in all_sections:
|
|
105
|
+
if not (
|
|
106
|
+
section.start_address + section.length <= existing.start_address
|
|
107
|
+
or section.start_address >= existing.start_address + existing.length
|
|
108
|
+
):
|
|
109
|
+
overlap_start = max(section.start_address, existing.start_address)
|
|
110
|
+
print(f"Error: Overlap detected at 0x{overlap_start:08x} between input files.")
|
|
111
|
+
sys.exit(1)
|
|
112
|
+
all_sections.append(section)
|
|
113
|
+
|
|
114
|
+
merged_image = Image(all_sections, join=True)
|
|
115
|
+
|
|
116
|
+
if args.verbose:
|
|
117
|
+
print("\nMerged Image Sections:")
|
|
118
|
+
print("Num Address Length")
|
|
119
|
+
print("-" * 79)
|
|
120
|
+
for idx, sec in enumerate(merged_image):
|
|
121
|
+
print(f"{idx:03d} 0x{sec.start_address:08x} {sec.length}")
|
|
122
|
+
print("-" * 79)
|
|
123
|
+
print(f" {len(merged_image)} total bytes")
|
|
124
|
+
|
|
125
|
+
dump(output_type, args.output, merged_image)
|
|
126
|
+
print(f"Successfully merged into '{args.output}' (type: {output_type}).")
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
if __name__ == "__main__":
|
|
130
|
+
main()
|
|
@@ -0,0 +1,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, Image
|
|
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": output_ext = ".hex"
|
|
104
|
+
elif args.output_type == "srec": output_ext = ".s19"
|
|
105
|
+
elif args.output_type == "bin": output_ext = ".bin"
|
|
106
|
+
|
|
107
|
+
if args.verbose:
|
|
108
|
+
print(f"Splitting '{args.input_file}' into {len(img.sections)} sections...")
|
|
109
|
+
|
|
110
|
+
split_images = img.split()
|
|
111
|
+
|
|
112
|
+
for idx, new_img in enumerate(split_images):
|
|
113
|
+
section = new_img.sections[0]
|
|
114
|
+
if args.output_names and idx < len(args.output_names):
|
|
115
|
+
# User provided a list of names
|
|
116
|
+
name_policy = IdentityPolicy()
|
|
117
|
+
out_base = args.output_names[idx]
|
|
118
|
+
else:
|
|
119
|
+
# Default: append section number
|
|
120
|
+
name_policy = SuffixPolicy(suffix=f"_{idx:03d}")
|
|
121
|
+
out_base = base_prefix
|
|
122
|
+
|
|
123
|
+
out_filename = build_filename(name_policy, out_base, output_ext)
|
|
124
|
+
|
|
125
|
+
print(f"Writing '{out_filename}'...")
|
|
126
|
+
if args.verbose:
|
|
127
|
+
print(f" Section {idx:03d} (0x{section.start_address:08x}, {len(section)} bytes)")
|
|
128
|
+
|
|
129
|
+
dump(output_type, out_filename, new_img)
|
|
130
|
+
|
|
131
|
+
print(f"Successfully split into {len(split_images)} files.")
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
if __name__ == "__main__":
|
|
135
|
+
main()
|
|
@@ -1325,6 +1325,8 @@ def join_sections(sections: list[Section]) -> list[Section]:
|
|
|
1325
1325
|
continue
|
|
1326
1326
|
|
|
1327
1327
|
if section_start == last_end:
|
|
1328
|
+
if isinstance(last_segment.data, bytes):
|
|
1329
|
+
last_segment.data = bytearray(last_segment.data)
|
|
1328
1330
|
last_segment.data.extend(section.data)
|
|
1329
1331
|
continue
|
|
1330
1332
|
|
|
@@ -1342,6 +1344,8 @@ def join_sections(sections: list[Section]) -> list[Section]:
|
|
|
1342
1344
|
|
|
1343
1345
|
if section_end > last_end:
|
|
1344
1346
|
tail_offset = overlap_end - section_start
|
|
1347
|
+
if isinstance(last_segment.data, bytes):
|
|
1348
|
+
last_segment.data = bytearray(last_segment.data)
|
|
1345
1349
|
last_segment.data.extend(section.data[tail_offset:])
|
|
1346
1350
|
|
|
1347
1351
|
return result_sections
|
|
@@ -902,31 +902,31 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"]
|
|
|
902
902
|
|
|
903
903
|
[[package]]
|
|
904
904
|
name = "ruff"
|
|
905
|
-
version = "0.15.
|
|
905
|
+
version = "0.15.21"
|
|
906
906
|
description = "An extremely fast Python linter and code formatter, written in Rust."
|
|
907
907
|
optional = true
|
|
908
908
|
python-versions = ">=3.7"
|
|
909
909
|
groups = ["main"]
|
|
910
910
|
markers = "extra == \"dev\""
|
|
911
911
|
files = [
|
|
912
|
-
{file = "ruff-0.15.
|
|
913
|
-
{file = "ruff-0.15.
|
|
914
|
-
{file = "ruff-0.15.
|
|
915
|
-
{file = "ruff-0.15.
|
|
916
|
-
{file = "ruff-0.15.
|
|
917
|
-
{file = "ruff-0.15.
|
|
918
|
-
{file = "ruff-0.15.
|
|
919
|
-
{file = "ruff-0.15.
|
|
920
|
-
{file = "ruff-0.15.
|
|
921
|
-
{file = "ruff-0.15.
|
|
922
|
-
{file = "ruff-0.15.
|
|
923
|
-
{file = "ruff-0.15.
|
|
924
|
-
{file = "ruff-0.15.
|
|
925
|
-
{file = "ruff-0.15.
|
|
926
|
-
{file = "ruff-0.15.
|
|
927
|
-
{file = "ruff-0.15.
|
|
928
|
-
{file = "ruff-0.15.
|
|
929
|
-
{file = "ruff-0.15.
|
|
912
|
+
{file = "ruff-0.15.21-py3-none-linux_armv6l.whl", hash = "sha256:63ea0e965e5d73c90e95b2434beeafc70820536717f561b32ab6e777cb9bdf5d"},
|
|
913
|
+
{file = "ruff-0.15.21-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:0f212c5d7d54c01bbfe6dcab02b724a39300f3e34ed7acbe995ccb320a2c58bd"},
|
|
914
|
+
{file = "ruff-0.15.21-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e6312e41bc96791299614995ea3a977c5857c3b5662b1ecef6755b02b87cb646"},
|
|
915
|
+
{file = "ruff-0.15.21-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:01d65b4831c6b2a4ba8ee6faa84049d44d982b7a706e622c4094c509e51673be"},
|
|
916
|
+
{file = "ruff-0.15.21-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2c5a913a589120ce67933d5d05fd6ddbcc2481c6a054980ee767f7414c72b4fd"},
|
|
917
|
+
{file = "ruff-0.15.21-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef04b681d02ad4dc9620f00f83ac5c22f652d0e9a9cfe431d219b16ad5ccc41"},
|
|
918
|
+
{file = "ruff-0.15.21-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:16d090c0740916594157e75b80d666eab8e78083b39b3b0e1d698f4670a17b86"},
|
|
919
|
+
{file = "ruff-0.15.21-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3a10e74757dd65004d779b73e2f3c5210156d9980b41224d50d2ebcf1db51e67"},
|
|
920
|
+
{file = "ruff-0.15.21-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bab0905d2f29e0d9fbc3c373ed23db0095edaa3f71f1f4f519ec15134d9e85c8"},
|
|
921
|
+
{file = "ruff-0.15.21-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:00eca240af5789fec6fe7df74c088cc1f9644ed83027113468efba7c92b94075"},
|
|
922
|
+
{file = "ruff-0.15.21-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:262ab31557a75141325e32d3357f3597645a7f084e732b6b054dde428ecd9341"},
|
|
923
|
+
{file = "ruff-0.15.21-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:659c4e7a4212f83306045ec7c5e5a356d16d9a6ef4ae0c7a4d872914fc655d9d"},
|
|
924
|
+
{file = "ruff-0.15.21-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9e866eab611a5f959d36df2d10e446973a3610bc42b0c15b31dc27977d59c233"},
|
|
925
|
+
{file = "ruff-0.15.21-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e89bc93c0d3803ba870b55c29671bad9dc6d94bb1eb181b056b52eb05b52854f"},
|
|
926
|
+
{file = "ruff-0.15.21-py3-none-win32.whl", hash = "sha256:01f8d5be84823c172b389e123174f781f9daf86d6c58719d603f941932195cdd"},
|
|
927
|
+
{file = "ruff-0.15.21-py3-none-win_amd64.whl", hash = "sha256:d4b8d9a2f0f12b816b50447f6eccb9f4bb01a6b82c86b50fb3b5354b458dc6d3"},
|
|
928
|
+
{file = "ruff-0.15.21-py3-none-win_arm64.whl", hash = "sha256:6e83115d4b9377c1cbc13abf0e051f069fab0ef815ea0504a8a008cee24dd0a8"},
|
|
929
|
+
{file = "ruff-0.15.21.tar.gz", hash = "sha256:d0cfc841c572283c36548f82664a54ce6565567f1b0d5b4cf2caac693d8b7500"},
|
|
930
930
|
]
|
|
931
931
|
|
|
932
932
|
[[package]]
|
|
@@ -1135,17 +1135,29 @@ files = [
|
|
|
1135
1135
|
{file = "typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5"},
|
|
1136
1136
|
]
|
|
1137
1137
|
|
|
1138
|
+
[[package]]
|
|
1139
|
+
name = "ufilename"
|
|
1140
|
+
version = "0.1.1"
|
|
1141
|
+
description = "A flexible filename generation library with various policies."
|
|
1142
|
+
optional = false
|
|
1143
|
+
python-versions = ">=3.9"
|
|
1144
|
+
groups = ["main"]
|
|
1145
|
+
files = [
|
|
1146
|
+
{file = "ufilename-0.1.1-py3-none-any.whl", hash = "sha256:5072a7a610032b1c5b5051eac459c35b51db987556596e40e24b50fcd4cc7039"},
|
|
1147
|
+
{file = "ufilename-0.1.1.tar.gz", hash = "sha256:0f496e00fc6a55fc9028fc60fbcad17d6547a8a8457066c4e5ecd60a1a49880d"},
|
|
1148
|
+
]
|
|
1149
|
+
|
|
1138
1150
|
[[package]]
|
|
1139
1151
|
name = "virtualenv"
|
|
1140
|
-
version = "21.6.
|
|
1152
|
+
version = "21.6.1"
|
|
1141
1153
|
description = "Virtual Python Environment builder"
|
|
1142
1154
|
optional = true
|
|
1143
1155
|
python-versions = ">=3.9"
|
|
1144
1156
|
groups = ["main"]
|
|
1145
1157
|
markers = "extra == \"dev\""
|
|
1146
1158
|
files = [
|
|
1147
|
-
{file = "virtualenv-21.6.
|
|
1148
|
-
{file = "virtualenv-21.6.
|
|
1159
|
+
{file = "virtualenv-21.6.1-py3-none-any.whl", hash = "sha256:afe991df855715a2b2f60edfcc0107ef95a79fdfd8cb4cdaa71603d1c12e463b"},
|
|
1160
|
+
{file = "virtualenv-21.6.1.tar.gz", hash = "sha256:15f978b7cd329f24855ff4a0c4b4899cc7678589f49adbdcbbb4d3232e641128"},
|
|
1149
1161
|
]
|
|
1150
1162
|
|
|
1151
1163
|
[package.dependencies]
|
|
@@ -1161,4 +1173,4 @@ dev = ["bandit", "black", "bumpver", "pre-commit", "pytest", "pyupgrade", "ruff"
|
|
|
1161
1173
|
[metadata]
|
|
1162
1174
|
lock-version = "2.1"
|
|
1163
1175
|
python-versions = ">=3.10,<4.0"
|
|
1164
|
-
content-hash = "
|
|
1176
|
+
content-hash = "fecb74c96cf3e09179cd46c4ddc5a4c17a2468e359067e3f23051ed9da8baacc"
|