hacktools 0.40.0__tar.gz → 0.40.1__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 (33) hide show
  1. {hacktools-0.40.0/hacktools.egg-info → hacktools-0.40.1}/PKG-INFO +1 -1
  2. hacktools-0.40.1/hacktools/__init__.py +1 -0
  3. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/common.py +6 -1
  4. {hacktools-0.40.0 → hacktools-0.40.1/hacktools.egg-info}/PKG-INFO +1 -1
  5. hacktools-0.40.0/hacktools/__init__.py +0 -1
  6. {hacktools-0.40.0 → hacktools-0.40.1}/LICENSE +0 -0
  7. {hacktools-0.40.0 → hacktools-0.40.1}/MANIFEST.in +0 -0
  8. {hacktools-0.40.0 → hacktools-0.40.1}/README.md +0 -0
  9. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/arch.py +0 -0
  10. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/assets/icon.png +0 -0
  11. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/c_ext/cmp_cri.c +0 -0
  12. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/c_ext/cmp_lzss.c +0 -0
  13. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/c_ext/cmp_misc.c +0 -0
  14. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/c_ext/cmp_racjin.c +0 -0
  15. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/c_ext/inc.h +0 -0
  16. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/compression.py +0 -0
  17. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/cpk.py +0 -0
  18. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/gb.py +0 -0
  19. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/gui.py +0 -0
  20. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/nasm.py +0 -0
  21. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/nds.py +0 -0
  22. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/nitro.py +0 -0
  23. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/psp.py +0 -0
  24. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/psx.py +0 -0
  25. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/wii.py +0 -0
  26. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools/ws.py +0 -0
  27. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools.egg-info/SOURCES.txt +0 -0
  28. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools.egg-info/dependency_links.txt +0 -0
  29. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools.egg-info/requires.txt +0 -0
  30. {hacktools-0.40.0 → hacktools-0.40.1}/hacktools.egg-info/top_level.txt +0 -0
  31. {hacktools-0.40.0 → hacktools-0.40.1}/setup.cfg +0 -0
  32. {hacktools-0.40.0 → hacktools-0.40.1}/setup.py +0 -0
  33. {hacktools-0.40.0 → hacktools-0.40.1}/tests/test_cmp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hacktools
3
- Version: 0.40.0
3
+ Version: 0.40.1
4
4
  Summary: A set of utilities and tools for rom hacking and translations.
5
5
  Home-page: https://github.com/Illidanz/hacktools
6
6
  Author: Illidan
@@ -0,0 +1 @@
1
+ __version__ = "0.40.1"
@@ -1061,7 +1061,7 @@ class BinaryPointer:
1061
1061
  self.str = str
1062
1062
 
1063
1063
 
1064
- def repackBinaryStrings(section, infile, outfile, binranges, freeranges=None, readfunc=detectEncodedString, writefunc=writeEncodedString, encoding="shift_jis", pointerstart=0, injectstart=0, fallbackf=None, injectfallback=0, sectionname="bin", preformat=None, postformat=None):
1064
+ def repackBinaryStrings(section, infile, outfile, binranges, freeranges=None, readfunc=detectEncodedString, writefunc=writeEncodedString, encoding="shift_jis", pointerstart=0, injectstart=0, fallbackf=None, injectfallback=0, sectionname="bin", preformat=None, postformat=None, pointeralign=1):
1065
1065
  insize = os.path.getsize(infile)
1066
1066
  notfound = []
1067
1067
  with Stream(infile, "rb") as fi:
@@ -1158,6 +1158,11 @@ def repackBinaryStrings(section, infile, outfile, binranges, freeranges=None, re
1158
1158
  index = allbin.find(pointersearch, index)
1159
1159
  if index < 0:
1160
1160
  break
1161
+ # Skip matches that aren't aligned: the pattern can collide with
1162
+ # bytes inside code/data, and overwriting those corrupts the binary
1163
+ if pointeralign > 1 and index % pointeralign != 0:
1164
+ index += 1
1165
+ continue
1161
1166
  foundone = True
1162
1167
  logDebug("Replaced pointer at", toHex(pointerstart + index), "with", toHex(newpointer))
1163
1168
  fo.seek(index)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hacktools
3
- Version: 0.40.0
3
+ Version: 0.40.1
4
4
  Summary: A set of utilities and tools for rom hacking and translations.
5
5
  Home-page: https://github.com/Illidanz/hacktools
6
6
  Author: Illidan
@@ -1 +0,0 @@
1
- __version__ = "0.40.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes