hacktools 0.38.7__tar.gz → 0.39.0__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.38.7/hacktools.egg-info → hacktools-0.39.0}/PKG-INFO +4 -3
  2. hacktools-0.39.0/hacktools/__init__.py +1 -0
  3. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/c_ext/cmp_lzss.c +8 -2
  4. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/common.py +1 -1
  5. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/nds.py +2 -2
  6. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/psx.py +5 -5
  7. {hacktools-0.38.7 → hacktools-0.39.0/hacktools.egg-info}/PKG-INFO +4 -3
  8. {hacktools-0.38.7 → hacktools-0.39.0}/setup.py +2 -2
  9. hacktools-0.38.7/hacktools/__init__.py +0 -1
  10. {hacktools-0.38.7 → hacktools-0.39.0}/LICENSE +0 -0
  11. {hacktools-0.38.7 → hacktools-0.39.0}/MANIFEST.in +0 -0
  12. {hacktools-0.38.7 → hacktools-0.39.0}/README.md +0 -0
  13. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/arch.py +0 -0
  14. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/assets/icon.png +0 -0
  15. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/c_ext/cmp_cri.c +0 -0
  16. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/c_ext/cmp_misc.c +0 -0
  17. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/c_ext/cmp_racjin.c +0 -0
  18. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/c_ext/inc.h +0 -0
  19. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/compression.py +0 -0
  20. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/cpk.py +0 -0
  21. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/gb.py +0 -0
  22. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/gui.py +0 -0
  23. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/nasm.py +0 -0
  24. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/nitro.py +0 -0
  25. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/psp.py +0 -0
  26. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/wii.py +0 -0
  27. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools/ws.py +0 -0
  28. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools.egg-info/SOURCES.txt +0 -0
  29. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools.egg-info/dependency_links.txt +0 -0
  30. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools.egg-info/requires.txt +0 -0
  31. {hacktools-0.38.7 → hacktools-0.39.0}/hacktools.egg-info/top_level.txt +0 -0
  32. {hacktools-0.38.7 → hacktools-0.39.0}/setup.cfg +0 -0
  33. {hacktools-0.38.7 → hacktools-0.39.0}/tests/test_cmp.py +0 -0
@@ -1,17 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hacktools
3
- Version: 0.38.7
3
+ Version: 0.39.0
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
7
- Classifier: Programming Language :: Python :: 3.7
7
+ License: MIT
8
8
  Classifier: Programming Language :: Python :: 3.8
9
9
  Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
- Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3.14
15
15
  Classifier: Operating System :: OS Independent
16
16
  Requires-Python: >=3.7
17
17
  Description-Content-Type: text/markdown
@@ -52,6 +52,7 @@ Dynamic: classifier
52
52
  Dynamic: description
53
53
  Dynamic: description-content-type
54
54
  Dynamic: home-page
55
+ Dynamic: license
55
56
  Dynamic: license-file
56
57
  Dynamic: provides-extra
57
58
  Dynamic: requires-python
@@ -0,0 +1 @@
1
+ __version__ = "0.39.0"
@@ -210,7 +210,10 @@ static PyObject* compressLZ10(PyObject* m, PyObject* args, PyObject* kwargs)
210
210
  if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#i", kwlist, &indata, &inlength, &mindisp))
211
211
  return NULL;
212
212
 
213
- unsigned char* out = PyMem_Malloc(inlength);
213
+ // Worst case: uncompressible data emits 1 flag byte per 8 input bytes,
214
+ // so output can reach inlength + ceil(inlength/8)
215
+ size_t outcap = inlength + (inlength + 7) / 8 + 32;
216
+ unsigned char* out = PyMem_Malloc(outcap);
214
217
  MALLOC_CHECK(out);
215
218
 
216
219
  unsigned int compressedlength = 0;
@@ -288,7 +291,10 @@ static PyObject* compressLZ11(PyObject* m, PyObject* args, PyObject* kwargs)
288
291
  if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#i", kwlist, &indata, &inlength, &mindisp))
289
292
  return NULL;
290
293
 
291
- unsigned char* out = PyMem_Malloc(inlength);
294
+ // Worst case: uncompressible data emits 1 flag byte per 8 input bytes,
295
+ // so output can reach inlength + ceil(inlength/8)
296
+ size_t outcap = inlength + (inlength + 7) / 8 + 32;
297
+ unsigned char* out = PyMem_Malloc(outcap);
292
298
  MALLOC_CHECK(out);
293
299
 
294
300
  unsigned int compressedlength = 0;
@@ -1171,7 +1171,7 @@ def repackBinaryStrings(section, infile, outfile, binranges, freeranges=None, re
1171
1171
  fo.writeZero(endpos - fo.tell())
1172
1172
  pos = fi.tell() - 1
1173
1173
  fi.seek(pos + 1)
1174
- return notfound
1174
+ return notfound, freeranges
1175
1175
 
1176
1176
 
1177
1177
  # Folders
@@ -152,14 +152,14 @@ def repackBIN(binrange, freeranges=[], readfunc=common.detectEncodedString, writ
152
152
  section.preloadLookup(comments)
153
153
  if type(binrange) == tuple:
154
154
  binrange = [binrange]
155
- notfound = common.repackBinaryStrings(section, binin, binout, binrange, freeranges, readfunc, writefunc, encoding, pointerstart, injectstart, fallbackf, injectfallback, sectionname, preformat, postformat)
155
+ notfound, freeranges = common.repackBinaryStrings(section, binin, binout, binrange, freeranges, readfunc, writefunc, encoding, pointerstart, injectstart, fallbackf, injectfallback, sectionname, preformat, postformat)
156
156
  for pointer in notfound:
157
157
  common.logError("Pointer", common.toHex(pointer.old), "->", common.toHex(pointer.new), "not found for string", pointer.str)
158
158
  if binfile.endswith(".txt"):
159
159
  common.logMessage("Done! Translation is at {0:.2f}%".format((100 * transtot) / chartot))
160
160
  else:
161
161
  common.logMessage("Done! Translation is at {0:.2f}%".format(section.getProgress()))
162
- return True
162
+ return freeranges
163
163
 
164
164
 
165
165
  class BINSection:
@@ -7,13 +7,13 @@ from hacktools import common
7
7
  # Image functions
8
8
  def extractBIN(infolder, outfolder, cuefile):
9
9
  try:
10
- import pymkpsxiso
10
+ import pydumpsxiso
11
11
  except ImportError:
12
- common.logError("pymkpsxiso not found")
12
+ common.logError("pydumpsxiso not found")
13
13
  return
14
14
  common.logMessage("Extracting BIN", cuefile, "...")
15
15
  common.makeFolder(infolder)
16
- pymkpsxiso.dump(cuefile.replace(".cue", ".bin"), infolder[:-1], infolder[:-1] + ".xml")
16
+ pydumpsxiso.run(cuefile.replace(".cue", ".bin"), infolder[:-1], infolder[:-1] + ".xml")
17
17
  common.logMessage("Copying data to", outfolder, "...")
18
18
  common.copyFolder(infolder, outfolder)
19
19
  with open(infolder[:-1] + ".xml", "r") as f:
@@ -30,7 +30,7 @@ def repackBIN(infolder, binin, binout, cuefile, patchfile=""):
30
30
  common.logError("pymkpsxiso not found")
31
31
  return
32
32
  common.logMessage("Repacking BIN", binout, "...")
33
- pymkpsxiso.make(binout, cuefile, infolder[:-1] + ".xml")
33
+ pymkpsxiso.run(binout, cuefile, infolder[:-1] + ".xml")
34
34
  common.logMessage("Done!")
35
35
  # Create xdelta patch
36
36
  if patchfile != "":
@@ -64,7 +64,7 @@ def repackEXE(binrange, freeranges=None, manualptrs=None, readfunc=common.detect
64
64
  chartot, transtot = common.getSectionPercentage(section)
65
65
  if type(binrange) == tuple:
66
66
  binrange = [binrange]
67
- notfound = common.repackBinaryStrings(section, exein, exeout, binrange, freeranges, readfunc, writefunc, encoding, 0x8000f800)
67
+ notfound, freeranges = common.repackBinaryStrings(section, exein, exeout, binrange, freeranges, readfunc, writefunc, encoding, 0x8000f800)
68
68
  # Handle not found pointers by manually replacing the opcodes
69
69
  if len(notfound) > 0 and manualptrs is not None:
70
70
  with open(ptrfile, "w") as f:
@@ -1,17 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hacktools
3
- Version: 0.38.7
3
+ Version: 0.39.0
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
7
- Classifier: Programming Language :: Python :: 3.7
7
+ License: MIT
8
8
  Classifier: Programming Language :: Python :: 3.8
9
9
  Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
- Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3.14
15
15
  Classifier: Operating System :: OS Independent
16
16
  Requires-Python: >=3.7
17
17
  Description-Content-Type: text/markdown
@@ -52,6 +52,7 @@ Dynamic: classifier
52
52
  Dynamic: description
53
53
  Dynamic: description-content-type
54
54
  Dynamic: home-page
55
+ Dynamic: license
55
56
  Dynamic: license-file
56
57
  Dynamic: provides-extra
57
58
  Dynamic: requires-python
@@ -43,15 +43,15 @@ setup(
43
43
  Extension("hacktools.cmp_misc", sources=["hacktools/c_ext/cmp_misc.c"]),
44
44
  Extension("hacktools.cmp_racjin", sources=["hacktools/c_ext/cmp_racjin.c"]),
45
45
  ],
46
+ license="MIT",
46
47
  classifiers=[
47
- "Programming Language :: Python :: 3.7",
48
48
  "Programming Language :: Python :: 3.8",
49
49
  "Programming Language :: Python :: 3.9",
50
50
  "Programming Language :: Python :: 3.10",
51
51
  "Programming Language :: Python :: 3.11",
52
52
  "Programming Language :: Python :: 3.12",
53
53
  "Programming Language :: Python :: 3.13",
54
- "License :: OSI Approved :: MIT License",
54
+ "Programming Language :: Python :: 3.14",
55
55
  "Operating System :: OS Independent",
56
56
  ],
57
57
  extras_require = {
@@ -1 +0,0 @@
1
- __version__ = "0.38.7"
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