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.
Files changed (274) hide show
  1. {objutils-0.10.11 → objutils-0.10.12}/PKG-INFO +15 -2
  2. {objutils-0.10.11 → objutils-0.10.12}/docs/README.rst +11 -0
  3. {objutils-0.10.11 → objutils-0.10.12}/docs/scripts.rst +79 -9
  4. {objutils-0.10.11 → objutils-0.10.12}/objutils/__init__.py +1 -1
  5. {objutils-0.10.11 → objutils-0.10.12}/objutils/image.py +5 -15
  6. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_hex_info.py +1 -1
  7. objutils-0.10.12/objutils/scripts/oj_hex_merge.py +130 -0
  8. objutils-0.10.12/objutils/scripts/oj_hex_split.py +135 -0
  9. {objutils-0.10.11 → objutils-0.10.12}/objutils/section.py +4 -0
  10. {objutils-0.10.11 → objutils-0.10.12}/objutils/version.py +1 -1
  11. {objutils-0.10.11 → objutils-0.10.12}/poetry.lock +35 -23
  12. {objutils-0.10.11 → objutils-0.10.12}/pyproject.toml +9 -5
  13. objutils-0.10.11/.idea/objutils@1.iml +0 -11
  14. {objutils-0.10.11 → objutils-0.10.12}/.clang-format +0 -0
  15. {objutils-0.10.11 → objutils-0.10.12}/.codacy.yml +0 -0
  16. {objutils-0.10.11 → objutils-0.10.12}/.codeclimate.yml +0 -0
  17. {objutils-0.10.11 → objutils-0.10.12}/.coveralls.yml +0 -0
  18. {objutils-0.10.11 → objutils-0.10.12}/.github/FUNDING.yml +0 -0
  19. {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  20. {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  21. {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE/documentation.yml +0 -0
  22. {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  23. {objutils-0.10.11 → objutils-0.10.12}/.github/ISSUE_TEMPLATE.md +0 -0
  24. {objutils-0.10.11 → objutils-0.10.12}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  25. {objutils-0.10.11 → objutils-0.10.12}/.github/copilot-instructions.md +0 -0
  26. {objutils-0.10.11 → objutils-0.10.12}/.github/workflows/pythonapp.yml +0 -0
  27. {objutils-0.10.11 → objutils-0.10.12}/.gitignore +0 -0
  28. {objutils-0.10.11 → objutils-0.10.12}/.idea/.gitignore +0 -0
  29. {objutils-0.10.11 → objutils-0.10.12}/.idea/copilot.data.migration.ask2agent.xml +0 -0
  30. {objutils-0.10.11 → objutils-0.10.12}/.idea/deployment.xml +0 -0
  31. {objutils-0.10.11 → objutils-0.10.12}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  32. {objutils-0.10.11 → objutils-0.10.12}/.idea/misc.xml +0 -0
  33. {objutils-0.10.11 → objutils-0.10.12}/.idea/modules.xml +0 -0
  34. {objutils-0.10.11 → objutils-0.10.12}/.idea/pyLspTools.xml +0 -0
  35. {objutils-0.10.11 → objutils-0.10.12}/.idea/pyProjectModel.xml +0 -0
  36. {objutils-0.10.11 → objutils-0.10.12}/.idea/vcs.xml +0 -0
  37. {objutils-0.10.11 → objutils-0.10.12}/.pre-commit-config.yaml +0 -0
  38. {objutils-0.10.11 → objutils-0.10.12}/.pylintrc +0 -0
  39. {objutils-0.10.11 → objutils-0.10.12}/.readthedocs.yml +0 -0
  40. {objutils-0.10.11 → objutils-0.10.12}/.travis.yml +0 -0
  41. {objutils-0.10.11 → objutils-0.10.12}/CMakeLists.txt +0 -0
  42. {objutils-0.10.11 → objutils-0.10.12}/CODE_OF_CONDUCT.md +0 -0
  43. {objutils-0.10.11 → objutils-0.10.12}/CONTRIBUTORS +0 -0
  44. {objutils-0.10.11 → objutils-0.10.12}/LICENSE +0 -0
  45. {objutils-0.10.11 → objutils-0.10.12}/MANIFEST.in +0 -0
  46. {objutils-0.10.11 → objutils-0.10.12}/PULL_REQUEST_TEMPLATE.md +0 -0
  47. {objutils-0.10.11 → objutils-0.10.12}/appveyor.yml +0 -0
  48. {objutils-0.10.11 → objutils-0.10.12}/bandit.yml +0 -0
  49. {objutils-0.10.11 → objutils-0.10.12}/docs/Data_Formats.pdf +0 -0
  50. {objutils-0.10.11 → objutils-0.10.12}/docs/ELF_Format.pdf +0 -0
  51. {objutils-0.10.11 → objutils-0.10.12}/docs/KNOWN_GOOD_DWARF_REFERENCE.md +0 -0
  52. {objutils-0.10.11 → objutils-0.10.12}/docs/apidoc.sh +0 -0
  53. {objutils-0.10.11 → objutils-0.10.12}/docs/conf.py +0 -0
  54. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.buildinfo +0 -0
  55. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.buildinfo.bak +0 -0
  56. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/README.doctree +0 -0
  57. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/environment.pickle +0 -0
  58. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/howto.doctree +0 -0
  59. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/index.doctree +0 -0
  60. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/installation.doctree +0 -0
  61. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/modules.doctree +0 -0
  62. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/objutils.doctree +0 -0
  63. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/objutils.elf.doctree +0 -0
  64. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/scripts.doctree +0 -0
  65. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/session.doctree +0 -0
  66. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/.doctrees/tutorial.doctree +0 -0
  67. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/README.html +0 -0
  68. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_images/objutils_basic.png +0 -0
  69. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/index.html +0 -0
  70. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/ash.html +0 -0
  71. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/binfile.html +0 -0
  72. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/checksums.html +0 -0
  73. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/cosmac.html +0 -0
  74. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/elf/defs.html +0 -0
  75. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/elf.html +0 -0
  76. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/emon52.html +0 -0
  77. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/etek.html +0 -0
  78. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/exceptions.html +0 -0
  79. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/fpc.html +0 -0
  80. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/hexdump.html +0 -0
  81. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/hexfile.html +0 -0
  82. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/ihex.html +0 -0
  83. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/image.html +0 -0
  84. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/logger.html +0 -0
  85. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/mostec.html +0 -0
  86. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/pickleif.html +0 -0
  87. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/rca.html +0 -0
  88. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/readers.html +0 -0
  89. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/registry.html +0 -0
  90. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/section.html +0 -0
  91. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/sig.html +0 -0
  92. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/srec.html +0 -0
  93. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/tek.html +0 -0
  94. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/titxt.html +0 -0
  95. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils/utils.html +0 -0
  96. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_modules/objutils.html +0 -0
  97. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/README.rst.txt +0 -0
  98. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/howto.rst.txt +0 -0
  99. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/index.rst.txt +0 -0
  100. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/installation.rst.txt +0 -0
  101. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/modules.rst.txt +0 -0
  102. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/objutils.elf.rst.txt +0 -0
  103. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/objutils.rst.txt +0 -0
  104. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/scripts.rst.txt +0 -0
  105. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/session.rst.txt +0 -0
  106. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_sources/tutorial.rst.txt +0 -0
  107. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/alabaster.css +0 -0
  108. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/basic.css +0 -0
  109. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/check-solid.svg +0 -0
  110. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/clipboard.min.js +0 -0
  111. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/copy-button.svg +0 -0
  112. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/copybutton.css +0 -0
  113. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/copybutton.js +0 -0
  114. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/copybutton_funcs.js +0 -0
  115. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/custom.css +0 -0
  116. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/doctools.js +0 -0
  117. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/documentation_options.js +0 -0
  118. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/file.png +0 -0
  119. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/github-banner.svg +0 -0
  120. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/language_data.js +0 -0
  121. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/minus.png +0 -0
  122. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/plus.png +0 -0
  123. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/pygments.css +0 -0
  124. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/bootstrap.js +0 -0
  125. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/bootstrap.js.LICENSE.txt +0 -0
  126. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/fontawesome.js +0 -0
  127. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/fontawesome.js.LICENSE.txt +0 -0
  128. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/scripts/pydata-sphinx-theme.js +0 -0
  129. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/searchtools.js +0 -0
  130. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/sphinx_highlight.js +0 -0
  131. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/styles/pydata-sphinx-theme.css +0 -0
  132. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/styles/theme.css +0 -0
  133. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.ttf +0 -0
  134. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
  135. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.ttf +0 -0
  136. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
  137. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.ttf +0 -0
  138. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/vendor/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
  139. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/_static/webpack-macros.html +0 -0
  140. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/genindex.html +0 -0
  141. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/howto.html +0 -0
  142. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/index.html +0 -0
  143. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/installation.html +0 -0
  144. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/modules.html +0 -0
  145. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/objects.inv +0 -0
  146. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/objutils.elf.html +0 -0
  147. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/objutils.html +0 -0
  148. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/py-modindex.html +0 -0
  149. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/scripts.html +0 -0
  150. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/search.html +0 -0
  151. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/searchindex.js +0 -0
  152. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/session.html +0 -0
  153. {objutils-0.10.11 → objutils-0.10.12}/docs/docs/_build/html/tutorial.html +0 -0
  154. {objutils-0.10.11 → objutils-0.10.12}/docs/elf-64-gen.pdf +0 -0
  155. {objutils-0.10.11 → objutils-0.10.12}/docs/example0.srec +0 -0
  156. {objutils-0.10.11 → objutils-0.10.12}/docs/howto.rst +0 -0
  157. {objutils-0.10.11 → objutils-0.10.12}/docs/index.rst +0 -0
  158. {objutils-0.10.11 → objutils-0.10.12}/docs/installation.rst +0 -0
  159. {objutils-0.10.11 → objutils-0.10.12}/docs/make.bat +0 -0
  160. {objutils-0.10.11 → objutils-0.10.12}/docs/modules.rst +0 -0
  161. {objutils-0.10.11 → objutils-0.10.12}/docs/objutils.elf.rst +0 -0
  162. {objutils-0.10.11 → objutils-0.10.12}/docs/objutils.rst +0 -0
  163. {objutils-0.10.11 → objutils-0.10.12}/docs/objutils_banner.png +0 -0
  164. {objutils-0.10.11 → objutils-0.10.12}/docs/objutils_basic.png +0 -0
  165. {objutils-0.10.11 → objutils-0.10.12}/docs/objutils_dark.jpg +0 -0
  166. {objutils-0.10.11 → objutils-0.10.12}/docs/objutils_social.jpg +0 -0
  167. {objutils-0.10.11 → objutils-0.10.12}/docs/requirements.txt +0 -0
  168. {objutils-0.10.11 → objutils-0.10.12}/docs/session.rst +0 -0
  169. {objutils-0.10.11 → objutils-0.10.12}/docs/tutorial.rst +0 -0
  170. {objutils-0.10.11 → objutils-0.10.12}/docs/tutorial1.ipynb +0 -0
  171. {objutils-0.10.11 → objutils-0.10.12}/objutils/.coveragerc +0 -0
  172. {objutils-0.10.11 → objutils-0.10.12}/objutils/.vscode/launch.json +0 -0
  173. {objutils-0.10.11 → objutils-0.10.12}/objutils/.vscode/settings.json +0 -0
  174. {objutils-0.10.11 → objutils-0.10.12}/objutils/a2l_test.shf +0 -0
  175. {objutils-0.10.11 → objutils-0.10.12}/objutils/ash.py +0 -0
  176. {objutils-0.10.11 → objutils-0.10.12}/objutils/binfile.py +0 -0
  177. {objutils-0.10.11 → objutils-0.10.12}/objutils/checksums.py +0 -0
  178. {objutils-0.10.11 → objutils-0.10.12}/objutils/cosmac.py +0 -0
  179. {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/__init__.py +0 -0
  180. {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/attrparser.py +0 -0
  181. {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/c_generator.py +0 -0
  182. {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/constants.py +0 -0
  183. {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/encoding.py +0 -0
  184. {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/lineprog.py +0 -0
  185. {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/readers.py +0 -0
  186. {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/sm.py +0 -0
  187. {objutils-0.10.11 → objutils-0.10.12}/objutils/dwarf/traverser.py +0 -0
  188. {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/__init__.py +0 -0
  189. {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/arm/__init__.py +0 -0
  190. {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/arm/attributes.py +0 -0
  191. {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/defs.py +0 -0
  192. {objutils-0.10.11 → objutils-0.10.12}/objutils/elf/model.py +0 -0
  193. {objutils-0.10.11 → objutils-0.10.12}/objutils/emon52.py +0 -0
  194. {objutils-0.10.11 → objutils-0.10.12}/objutils/etek.py +0 -0
  195. {objutils-0.10.11 → objutils-0.10.12}/objutils/exceptions.py +0 -0
  196. {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/__init__.py +0 -0
  197. {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/ctre.hpp +0 -0
  198. {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/difflib.h +0 -0
  199. {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/exceptions.cpp +0 -0
  200. {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/exceptions.hpp +0 -0
  201. {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/hexfile.cpp +0 -0
  202. {objutils-0.10.11 → objutils-0.10.12}/objutils/extensions/wrapper.cpp +0 -0
  203. {objutils-0.10.11 → objutils-0.10.12}/objutils/fpc.py +0 -0
  204. {objutils-0.10.11 → objutils-0.10.12}/objutils/hexdump.py +0 -0
  205. {objutils-0.10.11 → objutils-0.10.12}/objutils/hexfile.py +0 -0
  206. {objutils-0.10.11 → objutils-0.10.12}/objutils/ieee695.py +0 -0
  207. {objutils-0.10.11 → objutils-0.10.12}/objutils/ihex.py +0 -0
  208. {objutils-0.10.11 → objutils-0.10.12}/objutils/logger.py +0 -0
  209. {objutils-0.10.11 → objutils-0.10.12}/objutils/mostec.py +0 -0
  210. {objutils-0.10.11 → objutils-0.10.12}/objutils/objutils.code-workspace +0 -0
  211. {objutils-0.10.11 → objutils-0.10.12}/objutils/oocdtxt.py +0 -0
  212. {objutils-0.10.11 → objutils-0.10.12}/objutils/pecoff/__init__.py +0 -0
  213. {objutils-0.10.11 → objutils-0.10.12}/objutils/pecoff/defs.py +0 -0
  214. {objutils-0.10.11 → objutils-0.10.12}/objutils/pecoff/model.py +0 -0
  215. {objutils-0.10.11 → objutils-0.10.12}/objutils/pecoff/pdb/__init__.py +0 -0
  216. {objutils-0.10.11 → objutils-0.10.12}/objutils/pickleif.py +0 -0
  217. {objutils-0.10.11 → objutils-0.10.12}/objutils/rca.py +0 -0
  218. {objutils-0.10.11 → objutils-0.10.12}/objutils/readers.py +0 -0
  219. {objutils-0.10.11 → objutils-0.10.12}/objutils/registry.py +0 -0
  220. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/arduino_build_artifacts.py +0 -0
  221. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_cgen.py +0 -0
  222. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_coff_extract.py +0 -0
  223. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_coff_import.py +0 -0
  224. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_coff_info.py +0 -0
  225. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_coff_syms.py +0 -0
  226. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_dwarf_import.py +0 -0
  227. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_dwarf_info.py +0 -0
  228. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_arm_attrs.py +0 -0
  229. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_extract.py +0 -0
  230. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_import.py +0 -0
  231. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_info.py +0 -0
  232. {objutils-0.10.11 → objutils-0.10.12}/objutils/scripts/oj_elf_syms.py +0 -0
  233. {objutils-0.10.11 → objutils-0.10.12}/objutils/shf.py +0 -0
  234. {objutils-0.10.11 → objutils-0.10.12}/objutils/sig.py +0 -0
  235. {objutils-0.10.11 → objutils-0.10.12}/objutils/srec.py +0 -0
  236. {objutils-0.10.11 → objutils-0.10.12}/objutils/symbols.py +0 -0
  237. {objutils-0.10.11 → objutils-0.10.12}/objutils/tek.py +0 -0
  238. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/__init__.py +0 -0
  239. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_arm_attributes.py +0 -0
  240. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_ash.py +0 -0
  241. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_c_generator.py +0 -0
  242. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_checksums.py +0 -0
  243. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_cygpath.py +0 -0
  244. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_diff_bin.py +0 -0
  245. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_elf.py +0 -0
  246. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_emon52.py +0 -0
  247. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_etek.py +0 -0
  248. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_examples_cgen.py +0 -0
  249. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_fpc.py +0 -0
  250. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_hexdump.py +0 -0
  251. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_hexfile.py +0 -0
  252. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_ihex.py +0 -0
  253. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_image.py +0 -0
  254. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_mostec.py +0 -0
  255. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_oocdtxt.py +0 -0
  256. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_readers.py +0 -0
  257. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_registry.py +0 -0
  258. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_repr.py +0 -0
  259. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_section.py +0 -0
  260. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_section_join.py +0 -0
  261. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_shf.py +0 -0
  262. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_sm.py +0 -0
  263. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_srec.py +0 -0
  264. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_tek.py +0 -0
  265. {objutils-0.10.11 → objutils-0.10.12}/objutils/tests/test_titext.py +0 -0
  266. {objutils-0.10.11 → objutils-0.10.12}/objutils/titxt.py +0 -0
  267. {objutils-0.10.11 → objutils-0.10.12}/objutils/utils/__init__.py +0 -0
  268. {objutils-0.10.11 → objutils-0.10.12}/objutils/utils/arduino.py +0 -0
  269. {objutils-0.10.11 → objutils-0.10.12}/objutils/utils/diff.py +0 -0
  270. {objutils-0.10.11 → objutils-0.10.12}/requirements.txt +0 -0
  271. {objutils-0.10.11 → objutils-0.10.12}/setup.cfg +0 -0
  272. {objutils-0.10.11 → objutils-0.10.12}/setup.py +0 -0
  273. {objutils-0.10.11 → objutils-0.10.12}/test_join_sections.py +0 -0
  274. {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.11
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
- {ash,cosmac,emon52,etek,fpc,ihex,mostec,rca,shf,sig,srec,tek,titxt}
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
- {ash,cosmac,emon52,etek,fpc,ihex,mostec,rca,shf,sig,srec,tek,titxt}
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
- $ oj_hex_info srec sample.srec
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
- $ oj_hex_info srec sample.srec -d
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
 
@@ -13,7 +13,7 @@ Registers CODECS and implements an interface to them.
13
13
  The first parameter is always the codec name.
14
14
  """
15
15
 
16
- __version__ = "0.10.11"
16
+ __version__ = "0.10.12"
17
17
 
18
18
  __all__ = [
19
19
  "Image",
@@ -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, at: Optional[int] = None, equal_parts: Optional[int] = None, remap: Optional[bool] = None) -> None:
944
- """Split image into multiple parts.
943
+ def split(self) -> list["Image"]:
944
+ """Split image into multiple parts based on sections.
945
945
 
946
- Args:
947
- at: Address at which to split the image.
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
- raise NotImplementedError(f"split() is not yet implemented. Called with: at={at}, equal_parts={equal_parts}, remap={remap}")
949
+ return [Image([section], join=False) for section in self.sections]
960
950
 
961
951
 
962
952
  def _validate_sections(sections: Iterable[Section]) -> None:
@@ -4,7 +4,7 @@
4
4
  __copyright__ = """
5
5
  objutils - Object file library for Python.
6
6
 
7
- (C) 2010-2020 by Christoph Schueler <cpu12.gems@googlemail.com>
7
+ (C) 2010-2026 by Christoph Schueler <cpu12.gems@googlemail.com>
8
8
 
9
9
  All Rights Reserved
10
10
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  """objutils version module"""
2
2
 
3
- __version__ = "0.10.11"
3
+ __version__ = "0.10.12"
@@ -902,31 +902,31 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"]
902
902
 
903
903
  [[package]]
904
904
  name = "ruff"
905
- version = "0.15.20"
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.20-py3-none-linux_armv6l.whl", hash = "sha256:00e188c53e499c3c1637f73c91dcf2fb56d576cab76ce1be50a27c4e80e37078"},
913
- {file = "ruff-0.15.20-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9ebd1fd9b9c95fc0bd7b2761aebec1f030013d2e193a2901b224af68fe47251b"},
914
- {file = "ruff-0.15.20-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c5b16cdd67ca108185cd36dce98c576350c03b1660a751de725fb049193a0632"},
915
- {file = "ruff-0.15.20-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3413bb3c3d2ca6a8208f1f4809cd2dca3c6de6d0b491c0e70847672bde6e6efd"},
916
- {file = "ruff-0.15.20-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bd7ec42b3bb3da066488db093308a69c4ac5ee6d2af333a86ba6e2eb2e7dd44b"},
917
- {file = "ruff-0.15.20-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1a36ad0eb77fba9aabfb69ede54de6f376d04ac18ebea022847046d340a8267"},
918
- {file = "ruff-0.15.20-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b6df3b1e4610432f0386dba04d853b5f08cbbc903410c6fcc02f620f05aff53c"},
919
- {file = "ruff-0.15.20-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e89f198a1ea6ef0d727c1cf16088bc91a6cb0ab947dedc966715691647186eae"},
920
- {file = "ruff-0.15.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309809086c2acb67624950a3c8133e80f32d0d3e27106c0cd60ff26657c9f24b"},
921
- {file = "ruff-0.15.20-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:2d2374caa2f2c2f9e2b7da0a50802cfb8b79f55a9b5e49379f564544fbf56487"},
922
- {file = "ruff-0.15.20-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a1ed17b65293e0c2f22fc387bc13198a5de94bf4429589b0ff6946b0feaf21a3"},
923
- {file = "ruff-0.15.20-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f701305e66b38ea6c91882490eb73459796808e4c6362a1b765255e0cdcd4053"},
924
- {file = "ruff-0.15.20-py3-none-musllinux_1_2_i686.whl", hash = "sha256:5b9c0c367ad8e5d0d5b5b8537864c469a0a0e55417aadfbeca41fa61333be9f4"},
925
- {file = "ruff-0.15.20-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:01cc00dd58f0df339d0e902219dd53990ea99996a0344e5d9cc8d45d5307e460"},
926
- {file = "ruff-0.15.20-py3-none-win32.whl", hash = "sha256:ed65ef510e43a137207e0f01cfcf998aeddb1aeeda5c9d35023e910284d7cf21"},
927
- {file = "ruff-0.15.20-py3-none-win_amd64.whl", hash = "sha256:a525c81c70fb0380344dd1d8745d8cc1c890b7fc94a58d5a07bd8eb9557b8415"},
928
- {file = "ruff-0.15.20-py3-none-win_arm64.whl", hash = "sha256:2f5b2a6d614e8700388806a14996c40fab2c47b819ef57d790a34878858ed9ca"},
929
- {file = "ruff-0.15.20.tar.gz", hash = "sha256:1416eb04349192646b54de98f146c4f59afe37d0decfc02c3cbbf396f3a28566"},
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.0"
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.0-py3-none-any.whl", hash = "sha256:bce9d097950fef9d81129b333babfb7767072850c2f1acce0ec536708401bfd1"},
1148
- {file = "virtualenv-21.6.0.tar.gz", hash = "sha256:e18a4d750f2b64dea73e72ffde3922f3c52365fabdc8157ebd3da20d031c4734"},
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 = "0a525288ffc901d447ac6e718157434113c4a65f28274321632311d6e1c107ba"
1176
+ content-hash = "fecb74c96cf3e09179cd46c4ddc5a4c17a2468e359067e3f23051ed9da8baacc"