splat64 0.33.1__py3-none-any.whl → 0.33.2__py3-none-any.whl

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.
splat/__init__.py CHANGED
@@ -1,7 +1,7 @@
1
1
  __package_name__ = __name__
2
2
 
3
3
  # Should be synced with pyproject.toml
4
- __version__ = "0.33.1"
4
+ __version__ = "0.33.2"
5
5
  __author__ = "ethteck"
6
6
 
7
7
  from . import util as util
@@ -1,10 +1,4 @@
1
- from pathlib import Path
2
- from typing import Optional, TextIO
3
-
4
- from ...util import log, options
5
-
6
1
  from .asm import CommonSegAsm
7
- from .codesubsegment import CommonSegCodeSubsegment
8
2
 
9
3
 
10
4
  class CommonSegAsmtu(CommonSegAsm):
@@ -18,48 +12,4 @@ class CommonSegAsmtu(CommonSegAsm):
18
12
  out_path = self.out_path()
19
13
  assert out_path is not None, str(self)
20
14
 
21
- out_path.parent.mkdir(parents=True, exist_ok=True)
22
-
23
- self.print_file_boundaries()
24
-
25
- with open(out_path, "w", newline="\n") as f:
26
- # Write `.text` contents
27
- for line in self.get_asm_file_header():
28
- f.write(line + "\n")
29
- f.write(self.spim_section.disassemble())
30
-
31
- # Disassemble the siblings to this file by respecting the `section_order`
32
- for sect in self.section_order:
33
- if sect == self.get_linker_section_linksection():
34
- continue
35
-
36
- sibling = self.siblings.get(sect)
37
- if sibling is None:
38
- continue
39
-
40
- if (
41
- isinstance(sibling, CommonSegCodeSubsegment)
42
- and sibling.spim_section is not None
43
- and not sibling.should_self_split()
44
- ):
45
- f.write("\n")
46
- f.write(f"{sibling.get_section_asm_line()}\n\n")
47
- f.write(sibling.spim_section.disassemble())
48
-
49
- # Another loop to check anything that somehow may not be present on the `section_order`
50
- for sect, sibling in self.siblings.items():
51
- if sect == self.get_linker_section_linksection():
52
- continue
53
-
54
- if sect in self.section_order:
55
- # Already handled on the above loop
56
- continue
57
-
58
- if (
59
- isinstance(sibling, CommonSegCodeSubsegment)
60
- and sibling.spim_section is not None
61
- and not sibling.should_self_split()
62
- ):
63
- f.write("\n")
64
- f.write(f"{sibling.get_section_asm_line()}\n\n")
65
- f.write(sibling.spim_section.disassemble())
15
+ self.split_as_asmtu_file(out_path)
@@ -250,7 +250,7 @@ class CommonSegC(CommonSegCodeSubsegment):
250
250
  assert func_sym is not None
251
251
 
252
252
  if (
253
- not entry.function.getName() in self.global_asm_funcs
253
+ entry.function.getName() not in self.global_asm_funcs
254
254
  and options.opts.disassemble_all
255
255
  and not is_new_c_file
256
256
  ):
@@ -281,7 +281,7 @@ class CommonSegC(CommonSegCodeSubsegment):
281
281
  section = self.spim_section.get_section()
282
282
  old_value = section.getGpRelHack()
283
283
  section.setGpRelHack(False)
284
- self.split_as_asm_file(self.asm_out_path())
284
+ self.split_as_asmtu_file(self.asm_out_path())
285
285
  section.setGpRelHack(old_value)
286
286
 
287
287
  def get_c_preamble(self):
@@ -304,7 +304,7 @@ class CommonSegC(CommonSegCodeSubsegment):
304
304
 
305
305
  if rodata_sym.vramEnd != next_rodata_sym.vram:
306
306
  log.write(
307
- f"\nA gap was detected in migrated rodata symbols!", status="warn"
307
+ "\nA gap was detected in migrated rodata symbols!", status="warn"
308
308
  )
309
309
  log.write(
310
310
  f"\t In function '{func.getName()}' (0x{func.vram:08X}), gap detected between '{rodata_sym.getName()}' (0x{rodata_sym.vram:08X}) and '{next_rodata_sym.getName()}' (0x{next_rodata_sym.vram:08X})"
@@ -313,7 +313,7 @@ class CommonSegC(CommonSegCodeSubsegment):
313
313
  f"\t The address of the missing rodata symbol is 0x{rodata_sym.vramEnd:08X}"
314
314
  )
315
315
  log.write(
316
- f"\t Try to force the migration of that symbol with `force_migration:True` in the symbol_addrs.txt file; or avoid the migration of symbols around this address with `force_not_migration:True`"
316
+ "\t Try to force the migration of that symbol with `force_migration:True` in the symbol_addrs.txt file; or avoid the migration of symbols around this address with `force_not_migration:True`"
317
317
  )
318
318
 
319
319
  def create_c_asm_file(
@@ -238,12 +238,69 @@ class CommonSegCodeSubsegment(Segment):
238
238
  if self.spim_section is None:
239
239
  return
240
240
 
241
- if out_path:
242
- out_path.parent.mkdir(parents=True, exist_ok=True)
241
+ if not out_path:
242
+ return
243
+
244
+ out_path.parent.mkdir(parents=True, exist_ok=True)
245
+
246
+ self.print_file_boundaries()
247
+
248
+ with open(out_path, "w", newline="\n") as f:
249
+ # Write `.text` contents
250
+ for line in self.get_asm_file_header():
251
+ f.write(line + "\n")
252
+ f.write(self.spim_section.disassemble())
243
253
 
244
- self.print_file_boundaries()
254
+ # Same as above but write all sections from siblings
255
+ def split_as_asmtu_file(self, out_path: Optional[Path]):
256
+ if self.spim_section is None:
257
+ return
258
+
259
+ if not out_path:
260
+ return
245
261
 
246
- with open(out_path, "w", newline="\n") as f:
247
- for line in self.get_asm_file_header():
248
- f.write(line + "\n")
249
- f.write(self.spim_section.disassemble())
262
+ out_path.parent.mkdir(parents=True, exist_ok=True)
263
+
264
+ self.print_file_boundaries()
265
+
266
+ with open(out_path, "w", newline="\n") as f:
267
+ # Write `.text` contents
268
+ for line in self.get_asm_file_header():
269
+ f.write(line + "\n")
270
+ f.write(self.spim_section.disassemble())
271
+
272
+ # Disassemble the siblings to this file by respecting the `section_order`
273
+ for sect in self.section_order:
274
+ if sect == self.get_linker_section_linksection():
275
+ continue
276
+
277
+ sibling = self.siblings.get(sect)
278
+ if sibling is None:
279
+ continue
280
+
281
+ if (
282
+ isinstance(sibling, CommonSegCodeSubsegment)
283
+ and sibling.spim_section is not None
284
+ and not sibling.should_self_split()
285
+ ):
286
+ f.write("\n")
287
+ f.write(f"{sibling.get_section_asm_line()}\n\n")
288
+ f.write(sibling.spim_section.disassemble())
289
+
290
+ # Another loop to check anything that somehow may not be present on the `section_order`
291
+ for sect, sibling in self.siblings.items():
292
+ if sect == self.get_linker_section_linksection():
293
+ continue
294
+
295
+ if sect in self.section_order:
296
+ # Already handled on the above loop
297
+ continue
298
+
299
+ if (
300
+ isinstance(sibling, CommonSegCodeSubsegment)
301
+ and sibling.spim_section is not None
302
+ and not sibling.should_self_split()
303
+ ):
304
+ f.write("\n")
305
+ f.write(f"{sibling.get_section_asm_line()}\n\n")
306
+ f.write(sibling.spim_section.disassemble())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splat64
3
- Version: 0.33.1
3
+ Version: 0.33.2
4
4
  Summary: A binary splitting tool to assist with decompilation and modding projects
5
5
  Project-URL: Repository, https://github.com/ethteck/splat
6
6
  Project-URL: Issues, https://github.com/ethteck/splat/issues
@@ -76,7 +76,7 @@ The brackets corresponds to the optional dependencies to install while installin
76
76
  If you use a `requirements.txt` file in your repository, then you can add this library with the following line:
77
77
 
78
78
  ```txt
79
- splat64[mips]>=0.33.1,<1.0.0
79
+ splat64[mips]>=0.33.2,<1.0.0
80
80
  ```
81
81
 
82
82
  ### Optional dependencies
@@ -1,4 +1,4 @@
1
- splat/__init__.py,sha256=s0MHlzXtpFFqwUXdK_QTP2zGUxVKBhE7XytlqRTJv_Y,291
1
+ splat/__init__.py,sha256=RsNLR9JOXykmo-1waX9VcDxc1ayMcuHDl38qCnLmJ4E,291
2
2
  splat/__main__.py,sha256=T333dHDgr-2HYYhtARnYMEjdECnYiNIKfcXDD99o22A,732
3
3
  splat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  splat/disassembler/__init__.py,sha256=IubLMnm_F5cZ7WUPBfk1VJ7vdj6i1if5GG6RBvEoBEA,226
@@ -21,12 +21,12 @@ splat/segtypes/linker_entry.py,sha256=e2IzjAWC1B_JCx5pxBdKJrzOCse4SYUBrLHM8l3AR3
21
21
  splat/segtypes/segment.py,sha256=Y8OaNle09VeQ8pghzMQtxu8I2sWKy8fWPdfRH1zkUXU,28820
22
22
  splat/segtypes/common/__init__.py,sha256=mnq0acScilSCCo6q2PvkDk0Or3V8qitA7I8QMVw8haI,631
23
23
  splat/segtypes/common/asm.py,sha256=k3p4vgbQJP40iyTgQkIci1j3CpKkWksqoWBx2Pb2oh8,703
24
- splat/segtypes/common/asmtu.py,sha256=5FOVAXjqhM-kynm-nOuS1k7E9048WAW2eNHdKYtR5m8,2288
24
+ splat/segtypes/common/asmtu.py,sha256=C52kKh-8YeDHu0EucEfQ-tQMtDgfKfwAJ6wwiW6nOBU,354
25
25
  splat/segtypes/common/bin.py,sha256=6rxYRXTdAVEs3AFMgmhelOwOmKMg3bbkl-j4k4wqql4,1229
26
26
  splat/segtypes/common/bss.py,sha256=nktRbKrDivweyLdsUQkL5guSayqpwn7NK5j3gq3arKc,3084
27
- splat/segtypes/common/c.py,sha256=FBcEQ6GB5-F5wZQCahh2FjkqLkWFHBTehql8SuLVQyY,20419
27
+ splat/segtypes/common/c.py,sha256=AZvMW2qiyXYs_n7Yfz58BzwnH2ll7iyBAktkIZlvaCI,20419
28
28
  splat/segtypes/common/code.py,sha256=CFDbn2YCoRIpUT07vTW0rUQtG58X0sxTtp17VPbrZsc,10706
29
- splat/segtypes/common/codesubsegment.py,sha256=_fpQF7O5pq4CBclhqcR4_KbiY8Oo2p7gaMEnkICBfQ4,8558
29
+ splat/segtypes/common/codesubsegment.py,sha256=7iLNf-H076OHcnpRqPgDWZTJJgPkWUMSp0nSCvAfB1Q,10646
30
30
  splat/segtypes/common/cpp.py,sha256=p-duowCt4czrmaWgj1LuFw5LGfdyB_uaeLTKVmH80Cg,180
31
31
  splat/segtypes/common/data.py,sha256=r9G_vYieNlRze-5wGOKFazvFjpuodfSLad6iCNsBOAU,5665
32
32
  splat/segtypes/common/databin.py,sha256=ucbbsc_M1332KifjExuDsf1wqm4-GZAiLqOwwrUwUpQ,1194
@@ -94,8 +94,8 @@ splat/util/n64/find_code_length.py,sha256=uUoPoUORAjsAvH8oGqwnGvw6j8I_NnSrZtA-x9
94
94
  splat/util/n64/rominfo.py,sha256=U6TieblUAmxhZsn7u8nbjOKkbC6ygsC_7IiLLaOWwUE,14646
95
95
  splat/util/psx/__init__.py,sha256=kCCaR-KB1mNlIcXB4OuuSQ2zVLbWg_SnIZIUeyjeBBI,39
96
96
  splat/util/psx/psxexeinfo.py,sha256=MrxY28nes0uzpFmCz0o9JFbF8s1eQRQNOpC_82wsMVI,5725
97
- splat64-0.33.1.dist-info/METADATA,sha256=xym78Asaf2XRy0p1LkMu9m-PMZzjArFAkiBoztPKzgs,3830
98
- splat64-0.33.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
99
- splat64-0.33.1.dist-info/entry_points.txt,sha256=O7Xy-qNOHcI87-OQrWJ-OhRDws74SuwVb_4rtnp0eLo,52
100
- splat64-0.33.1.dist-info/licenses/LICENSE,sha256=97VMVzjG8yQvsf8NG2M9IFSbh7R8cifJnc6QK1cZqj8,1070
101
- splat64-0.33.1.dist-info/RECORD,,
97
+ splat64-0.33.2.dist-info/METADATA,sha256=CFJ6z02JMyJ-uNmy8mBoRrVFXUvxbPnmlmk653LBbd0,3830
98
+ splat64-0.33.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
99
+ splat64-0.33.2.dist-info/entry_points.txt,sha256=O7Xy-qNOHcI87-OQrWJ-OhRDws74SuwVb_4rtnp0eLo,52
100
+ splat64-0.33.2.dist-info/licenses/LICENSE,sha256=97VMVzjG8yQvsf8NG2M9IFSbh7R8cifJnc6QK1cZqj8,1070
101
+ splat64-0.33.2.dist-info/RECORD,,