splat64 0.32.1__py3-none-any.whl → 0.32.3__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.32.1"
4
+ __version__ = "0.32.3"
5
5
  __author__ = "ethteck"
6
6
 
7
7
  from . import util as util
@@ -7,7 +7,7 @@ from typing import Set
7
7
 
8
8
  class SpimdisasmDisassembler(disassembler.Disassembler):
9
9
  # This value should be kept in sync with the version listed on requirements.txt and pyproject.toml
10
- SPIMDISASM_MIN = (1, 31, 0)
10
+ SPIMDISASM_MIN = (1, 32, 0)
11
11
 
12
12
  def configure(self):
13
13
  # Configure spimdisasm
@@ -60,7 +60,9 @@ class CommonSegBss(CommonSegData):
60
60
  f"Segment '{self.name}' (type '{self.type}') requires a vram address. Got '{self.vram_start}'"
61
61
  )
62
62
 
63
- next_subsegment = self.parent.get_next_subsegment_for_ram(self.vram_start)
63
+ next_subsegment = self.parent.get_next_subsegment_for_ram(
64
+ self.vram_start, self.index_within_group
65
+ )
64
66
  if next_subsegment is None:
65
67
  bss_end = self.get_most_parent().vram_end
66
68
  else:
@@ -270,6 +270,8 @@ class CommonSegCode(CommonSegGroup):
270
270
  sibling.siblings[segment.get_linker_section_linksection()] = segment
271
271
 
272
272
  ret = self._insert_all_auto_sections(ret, base_segments, readonly_before)
273
+ for i, seg in enumerate(ret):
274
+ seg.index_within_group = i
273
275
 
274
276
  return ret
275
277
 
@@ -122,7 +122,7 @@ class CommonSegCodeSubsegment(Segment):
122
122
  )
123
123
 
124
124
  # Gather symbols found by spimdisasm and create those symbols in splat's side
125
- for referenced_vram in func_spim.instrAnalyzer.referencedVrams:
125
+ for referenced_vram in func_spim.referencedVrams:
126
126
  context_sym = self.spim_section.get_section().getSymbol(
127
127
  referenced_vram, tryPlusOffset=False
128
128
  )
@@ -145,6 +145,16 @@ class CommonSegData(CommonSegCodeSubsegment, CommonSegGroup):
145
145
  self.get_most_parent(), symbol.contextSym
146
146
  )
147
147
 
148
+ # Gather symbols found by spimdisasm and create those symbols in splat's side
149
+ for referenced_vram in symbol.referencedVrams:
150
+ context_sym = self.spim_section.get_section().getSymbol(
151
+ referenced_vram, tryPlusOffset=False
152
+ )
153
+ if context_sym is not None:
154
+ symbols.create_symbol_from_spim_symbol(
155
+ self.get_most_parent(), context_sym
156
+ )
157
+
148
158
  # Hint to the user that we are now in the .rodata section and no longer in the .data section (assuming rodata follows data)
149
159
  if (
150
160
  self.suggestion_rodata_section_start
@@ -110,11 +110,16 @@ class CommonSegGroup(CommonSegment):
110
110
  self.special_vram_segment = True
111
111
  segment.is_auto_segment = is_auto_segment
112
112
 
113
+ segment.index_within_group = len(ret)
114
+
113
115
  ret.append(segment)
114
116
  prev_start = start
115
117
  if end is not None:
116
118
  last_rom_end = end
117
119
 
120
+ for i, seg in enumerate(ret):
121
+ seg.index_within_group = i
122
+
118
123
  return ret
119
124
 
120
125
  @property
@@ -165,13 +170,17 @@ class CommonSegGroup(CommonSegment):
165
170
  return sub
166
171
  return None
167
172
 
168
- def get_next_subsegment_for_ram(self, addr: int) -> Optional[Segment]:
173
+ def get_next_subsegment_for_ram(
174
+ self, addr: int, current_subseg_index: Optional[int]
175
+ ) -> Optional[Segment]:
169
176
  """
170
177
  Returns the first subsegment which comes after the specified address,
171
178
  or None in case this address belongs to the last subsegment of this group
172
179
  """
173
180
 
174
- for sub in self.subsegments:
181
+ start = current_subseg_index if current_subseg_index is not None else 0
182
+
183
+ for sub in self.subsegments[start:]:
175
184
  if sub.vram_start is None:
176
185
  continue
177
186
  assert isinstance(sub.vram_start, int)
@@ -112,6 +112,16 @@ class CommonSegRodata(CommonSegData):
112
112
  )
113
113
  generated_symbol.linker_section = self.get_linker_section_linksection()
114
114
 
115
+ # Gather symbols found by spimdisasm and create those symbols in splat's side
116
+ for referenced_vram in symbol.referencedVrams:
117
+ context_sym = self.spim_section.get_section().getSymbol(
118
+ referenced_vram, tryPlusOffset=False
119
+ )
120
+ if context_sym is not None:
121
+ symbols.create_symbol_from_spim_symbol(
122
+ self.get_most_parent(), context_sym
123
+ )
124
+
115
125
  possible_text = self.get_possible_text_subsegment_for_symbol(symbol)
116
126
  if possible_text is not None:
117
127
  text_segment, refenceeFunction = possible_text
splat/segtypes/segment.py CHANGED
@@ -255,7 +255,7 @@ class Segment:
255
255
 
256
256
  @staticmethod
257
257
  def parse_suggestion_rodata_section_start(
258
- yaml: Union[dict, list]
258
+ yaml: Union[dict, list],
259
259
  ) -> Optional[bool]:
260
260
  if isinstance(yaml, dict):
261
261
  suggestion_rodata_section_start = yaml.get(
@@ -354,6 +354,8 @@ class Segment:
354
354
  # Is an automatic segment, generated automatically or declared on the yaml by the user
355
355
  self.is_auto_segment: bool = False
356
356
 
357
+ self.index_within_group: Optional[int] = None
358
+
357
359
  if self.rom_start is not None and self.rom_end is not None:
358
360
  if self.rom_start > self.rom_end:
359
361
  log.error(
splat/util/options.py CHANGED
@@ -554,10 +554,10 @@ def _parse_yaml(
554
554
  detect_redundant_function_end=p.parse_opt(
555
555
  "detect_redundant_function_end", bool, True
556
556
  ),
557
- # Command line argument takes precedence over yaml option
558
- disassemble_all=(
559
- disasm_all if disasm_all else p.parse_opt("disassemble_all", bool, False)
560
- ),
557
+ # Setting either option will produce a full disassembly,
558
+ # but we still have to check the yaml option first to avoid leaving option unparsed,
559
+ # because splat would complain about an unrecognized yaml option otherwise.
560
+ disassemble_all=p.parse_opt("disassemble_all", bool, False) or disasm_all,
561
561
  global_vram_start=p.parse_optional_opt("global_vram_start", int),
562
562
  global_vram_end=p.parse_optional_opt("global_vram_end", int),
563
563
  use_gp_rel_macro_nonmatching=p.parse_opt(
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: splat64
3
- Version: 0.32.1
3
+ Version: 0.32.3
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
@@ -26,6 +26,7 @@ License: MIT License
26
26
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
27
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
28
  SOFTWARE.
29
+ License-File: LICENSE
29
30
  Classifier: License :: OSI Approved :: MIT License
30
31
  Classifier: Programming Language :: Python :: 3
31
32
  Requires-Python: >=3.9
@@ -41,7 +42,7 @@ Requires-Dist: mypy; extra == 'dev'
41
42
  Requires-Dist: n64img>=0.3.3; extra == 'dev'
42
43
  Requires-Dist: pygfxd; extra == 'dev'
43
44
  Requires-Dist: rabbitizer<2.0.0,>=1.12.0; extra == 'dev'
44
- Requires-Dist: spimdisasm<2.0.0,>=1.31.0; extra == 'dev'
45
+ Requires-Dist: spimdisasm<2.0.0,>=1.32.0; extra == 'dev'
45
46
  Requires-Dist: types-colorama; extra == 'dev'
46
47
  Requires-Dist: types-pyyaml; extra == 'dev'
47
48
  Provides-Extra: mips
@@ -49,7 +50,7 @@ Requires-Dist: crunch64<1.0.0,>=0.5.1; extra == 'mips'
49
50
  Requires-Dist: n64img>=0.3.3; extra == 'mips'
50
51
  Requires-Dist: pygfxd; extra == 'mips'
51
52
  Requires-Dist: rabbitizer<2.0.0,>=1.12.0; extra == 'mips'
52
- Requires-Dist: spimdisasm<2.0.0,>=1.31.0; extra == 'mips'
53
+ Requires-Dist: spimdisasm<2.0.0,>=1.32.0; extra == 'mips'
53
54
  Description-Content-Type: text/markdown
54
55
 
55
56
  # splat
@@ -75,7 +76,7 @@ The brackets corresponds to the optional dependencies to install while installin
75
76
  If you use a `requirements.txt` file in your repository, then you can add this library with the following line:
76
77
 
77
78
  ```txt
78
- splat64[mips]>=0.32.1,<1.0.0
79
+ splat64[mips]>=0.32.3,<1.0.0
79
80
  ```
80
81
 
81
82
  ### Optional dependencies
@@ -1,4 +1,4 @@
1
- splat/__init__.py,sha256=vhwvGGUrsNUqPZCiUaGxalWSlqf2eMG5KAA4DScRaZk,291
1
+ splat/__init__.py,sha256=AVWbICqaSjTvM62olB32zeBhCtNyKbP8PxwBjyVh4dE,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
@@ -6,7 +6,7 @@ splat/disassembler/disassembler.py,sha256=2ynehZRz1P6UnaBk6DWRy4c3ynRnnWApMhf0K9
6
6
  splat/disassembler/disassembler_instance.py,sha256=09GW7QYoNolgE2wnO7ALngw_CxgF-mfyLiXBsyv22jA,916
7
7
  splat/disassembler/disassembler_section.py,sha256=J9jtplQVDVeGBmyEOcMpC3Hv3DyecqaNjlYc7zqEqDI,7459
8
8
  splat/disassembler/null_disassembler.py,sha256=jYuDMtfPiBifwz0H-ZHLMWtpGa19X_iLgy4K-dQhPYY,328
9
- splat/disassembler/spimdisasm_disassembler.py,sha256=WZf2Vtyq2P95Lc_D6TtKXSy8zMWmQLKdSkDyNhyWuEI,5685
9
+ splat/disassembler/spimdisasm_disassembler.py,sha256=Z3eLbmO1Q7uY9zdbFzGJH1zE1LgHSLRQWRwyYpNFuzQ,5685
10
10
  splat/platforms/__init__.py,sha256=qjqKi63k5N3DUdILNfuk6qpJJkVeAWpjAs36L97vvP4,100
11
11
  splat/platforms/n64.py,sha256=kgWr6nesGC0X-qVydmu8tSq48NbqVf9mF6EyqvUuoUM,421
12
12
  splat/platforms/ps2.py,sha256=QI_8Ve43LZeNqpuk8_CFxIqsNJpMTacRHXdZVh3iY6c,336
@@ -18,28 +18,28 @@ splat/scripts/create_config.py,sha256=nFwIt1UWzlWE9C3i-2dGsVyGX2cuXzIqkp2kur2-pd
18
18
  splat/scripts/split.py,sha256=INZ8gwyv9ulSfrNYJuPykkg5BWWsYLnto6JVXXIiHG0,20704
19
19
  splat/segtypes/__init__.py,sha256=-upUw_4JGQtvyp6IfTMzOq_CK3xvVaT_0K0_EipHyOo,208
20
20
  splat/segtypes/linker_entry.py,sha256=m2qrZEZaRqsurUVlgo5rQt-4OZwDywK8hTqY1SoF2D8,24689
21
- splat/segtypes/segment.py,sha256=Ey4d4hxGWL4e8ZsxVRGXafP9GCFXB-3F6loaBFVDU-k,28764
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=_EfIbDOlQdmvAVqPq_Jxgp335zIxEPLnuQc96x9EyOY,1819
24
24
  splat/segtypes/common/asmtu.py,sha256=hrflvDGZ4BcVEA8CRkkIOlqt0tUCC4iNb4oclht2o6s,2274
25
25
  splat/segtypes/common/bin.py,sha256=6rxYRXTdAVEs3AFMgmhelOwOmKMg3bbkl-j4k4wqql4,1229
26
- splat/segtypes/common/bss.py,sha256=EIN8E7CfqwcWRMWb_JIbGBicu6VKREdIbvQZNBM-6sM,3037
26
+ splat/segtypes/common/bss.py,sha256=nktRbKrDivweyLdsUQkL5guSayqpwn7NK5j3gq3arKc,3084
27
27
  splat/segtypes/common/c.py,sha256=NWLc1ArOQ3t2xfIJj8I2AGzm8xNR9DPbb5Wgg9L1VNY,19755
28
- splat/segtypes/common/code.py,sha256=23VZJXNFi3PYq3xH269DlxjCiqasSQnMuxwQkh-1qXU,10629
29
- splat/segtypes/common/codesubsegment.py,sha256=hkwuTBjxhn3IeiEoO-FhSg5lsyj9rxkuOSdsFrj-hME,7029
28
+ splat/segtypes/common/code.py,sha256=CFDbn2YCoRIpUT07vTW0rUQtG58X0sxTtp17VPbrZsc,10706
29
+ splat/segtypes/common/codesubsegment.py,sha256=fRDFUu9RzBSMeHo_vsT0Ko1qoeLDq8kLaIX4asJGMa4,7015
30
30
  splat/segtypes/common/cpp.py,sha256=p-duowCt4czrmaWgj1LuFw5LGfdyB_uaeLTKVmH80Cg,180
31
- splat/segtypes/common/data.py,sha256=EvR2aXnRqIAMOKYZgBFt2WSxEZ5d52IB4gdRGkjLeeA,5513
31
+ splat/segtypes/common/data.py,sha256=ZR6ZVgAOWuKJOMpKAe4nK2ORH9oAjQ8uSszcTJaZ1j8,5997
32
32
  splat/segtypes/common/databin.py,sha256=ucbbsc_M1332KifjExuDsf1wqm4-GZAiLqOwwrUwUpQ,1194
33
33
  splat/segtypes/common/eh_frame.py,sha256=MzL373ej2E38leM47py3T5beLq2IolsYszLZM8PYS2Y,913
34
34
  splat/segtypes/common/gcc_except_table.py,sha256=-ZrQL5dCcRu7EPFFPgL8lIJwWL5FsEeeQoSUVfTkyIg,2112
35
- splat/segtypes/common/group.py,sha256=DIDLeiOlpguIPatw8a9vHmvsQ2LXI-QWbFy_D7PhVgQ,5928
35
+ splat/segtypes/common/group.py,sha256=4g8jrpUjlsvxFuFRauS4rdxTvAAePebc941fQj96qEA,6197
36
36
  splat/segtypes/common/hasm.py,sha256=HW6OADo-2D3Jln0q5KAoE8zUGOUiJAUEHqHOG4dRmw8,1130
37
37
  splat/segtypes/common/header.py,sha256=NspQdk-L69j9dOBzBtDKb7bc11Gwa0WDWIVCd2P4mfE,1257
38
38
  splat/segtypes/common/lib.py,sha256=WaJH0DH0B8iJvhYQWYBjThbNeEXz3Yh7E8ZyONe5JtQ,2349
39
39
  splat/segtypes/common/linker_offset.py,sha256=IaEXMXq62BS2g95I4lS0wax5Ehjfi3O3C-uSDUbMjvI,767
40
40
  splat/segtypes/common/pad.py,sha256=-7SaRgXrmGeOINKVV9v1c3e9jn8aVQknD8EVaEPcPrw,758
41
41
  splat/segtypes/common/rdata.py,sha256=ab2MFZVjlnD2p5nDVNroo3W9blaVJND2jN2PJPy6a_Y,142
42
- splat/segtypes/common/rodata.py,sha256=YLCRkEZB_EyUVU8-f8UNMRN8VDXtkXZdmVr7F-ToUqg,5691
42
+ splat/segtypes/common/rodata.py,sha256=sv-QCqKTQ2RNB5W0-BjiiSQhxB99pU0gEBFbd8e9SZo,6175
43
43
  splat/segtypes/common/rodatabin.py,sha256=uqp60QuwHwvlMwHq0nZrU3y3yYcHbv2twT0PIDp4NzM,1199
44
44
  splat/segtypes/common/sbss.py,sha256=blIEuVYie4qNEOYMmlSdltn5f4MvgJu3AV8vqVD8Nh4,131
45
45
  splat/segtypes/common/sdata.py,sha256=dnLzNSNtSyclLZiNUmFTv0e0BWN8glxB1km1MSRq6xY,136
@@ -80,7 +80,7 @@ splat/util/cache_handler.py,sha256=N0SggmvYwh0k-0fngHXoHG1CosC2rCsnlCTDsG8z5aE,1
80
80
  splat/util/color.py,sha256=FSmy0dAQJ9FzRBc99Yt4kBEyB62MC_YiVkqoWgPMsRU,371
81
81
  splat/util/compiler.py,sha256=g9MjVe6E1kSGRxgDRgWGEd4qdDf2LzGLK1QRtp4znMc,1493
82
82
  splat/util/log.py,sha256=GguW9AolH-EXGBmh-8aZXgUeBFJthqAOb3qKtRYUSj8,999
83
- splat/util/options.py,sha256=XrOq83KPdNU-RjrIMx-G6jZ8-y0wtsnazuuqcSaSWeY,28061
83
+ splat/util/options.py,sha256=evfJntGz7xC3Bhxr9VA7Ib9MSF15E3NzJ0eVUqP2Z8I,28197
84
84
  splat/util/palettes.py,sha256=d3KoZnwt-zunI9eNwb3txysXg4DY3xnF0O5aQRxM4so,2920
85
85
  splat/util/progress_bar.py,sha256=41VehpIFK1cphENaXV_Aq6_3mFx25eQ8V7Z51SKFPeM,166
86
86
  splat/util/relocs.py,sha256=cgQYSaAtNpLlUZQdhEfa7ZpI8i0HqoDhwB88QtFqdJs,4212
@@ -93,8 +93,8 @@ splat/util/n64/find_code_length.py,sha256=uUoPoUORAjsAvH8oGqwnGvw6j8I_NnSrZtA-x9
93
93
  splat/util/n64/rominfo.py,sha256=U6TieblUAmxhZsn7u8nbjOKkbC6ygsC_7IiLLaOWwUE,14646
94
94
  splat/util/psx/__init__.py,sha256=kCCaR-KB1mNlIcXB4OuuSQ2zVLbWg_SnIZIUeyjeBBI,39
95
95
  splat/util/psx/psxexeinfo.py,sha256=MrxY28nes0uzpFmCz0o9JFbF8s1eQRQNOpC_82wsMVI,5725
96
- splat64-0.32.1.dist-info/METADATA,sha256=tC9jazHChnBLhOYe4kciVCAWXHI-iLp9irDtMmeQJH4,3808
97
- splat64-0.32.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
98
- splat64-0.32.1.dist-info/entry_points.txt,sha256=O7Xy-qNOHcI87-OQrWJ-OhRDws74SuwVb_4rtnp0eLo,52
99
- splat64-0.32.1.dist-info/licenses/LICENSE,sha256=97VMVzjG8yQvsf8NG2M9IFSbh7R8cifJnc6QK1cZqj8,1070
100
- splat64-0.32.1.dist-info/RECORD,,
96
+ splat64-0.32.3.dist-info/METADATA,sha256=_6qnWfXwIdhpMVWpoflJDGU8H3_wT7QGLa7InRwrBvM,3830
97
+ splat64-0.32.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
98
+ splat64-0.32.3.dist-info/entry_points.txt,sha256=O7Xy-qNOHcI87-OQrWJ-OhRDws74SuwVb_4rtnp0eLo,52
99
+ splat64-0.32.3.dist-info/licenses/LICENSE,sha256=97VMVzjG8yQvsf8NG2M9IFSbh7R8cifJnc6QK1cZqj8,1070
100
+ splat64-0.32.3.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any