Skip to content

Commit 09acc43

Browse files
authored
Merge pull request #123 from Decompollaborate/develop
1.14.2
2 parents e368815 + 530142d commit 09acc43

22 files changed

+75
-74
lines changed

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[project]
55
name = "spimdisasm"
66
# Version should be synced with spimdisasm/__init__.py
7-
version = "1.14.1"
7+
version = "1.14.2"
88
description = "MIPS disassembler"
99
# license = "MIT"
1010
readme = "README.md"
@@ -36,5 +36,8 @@ exclude = ["build*"]
3636
[tool.setuptools.dynamic]
3737
dependencies = {file = "requirements.txt"}
3838

39+
[tool.setuptools.package-data]
40+
spimdisasm = ["py.typed"]
41+
3942
[tool.cibuildwheel]
4043
skip = ["cp36-*"]

spimdisasm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from __future__ import annotations
77

8-
__version_info__ = (1, 14, 1)
8+
__version_info__ = (1, 14, 2)
99
__version__ = ".".join(map(str, __version_info__))
1010
__author__ = "Decompollaborate"
1111

spimdisasm/common/Utils.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,17 @@ def eprintVerbose(*args, **kwargs):
4242
def isStdoutRedirected() -> bool:
4343
return not sys.stdout.isatty()
4444

45-
# Returns the md5 hash of a bytearray
46-
def getStrHash(byte_array: bytearray) -> str:
45+
# Returns the md5 hash of a bytes
46+
def getStrHash(byte_array: bytes) -> str:
4747
return str(hashlib.md5(byte_array).hexdigest())
4848

49-
def writeBytearrayToFile(filepath: Path, array_of_bytes: bytearray):
49+
def writeBytesToFile(filepath: Path, array_of_bytes: bytes):
5050
with filepath.open(mode="wb") as f:
5151
f.write(array_of_bytes)
5252

53+
#! deprecated
54+
writeBytearrayToFile = writeBytesToFile
55+
5356
def readFileAsBytearray(filepath: Path) -> bytearray:
5457
if not filepath.exists():
5558
return bytearray(0)
@@ -67,7 +70,7 @@ def readJson(filepath: Path):
6770
def removeExtraWhitespace(line: str) -> str:
6871
return " ".join(line.split())
6972

70-
def endianessBytesToWords(endian: InputEndian, array_of_bytes: bytearray, offset: int=0, offsetEnd: int|None=None) -> list[int]:
73+
def endianessBytesToWords(endian: InputEndian, array_of_bytes: bytes, offset: int=0, offsetEnd: int|None=None) -> list[int]:
7174
totalBytesCount = len(array_of_bytes)
7275
if totalBytesCount == 0:
7376
return list()
@@ -88,33 +91,34 @@ def endianessBytesToWords(endian: InputEndian, array_of_bytes: bytearray, offset
8891
little_byte_format = f"<{halfwords}H"
8992
big_byte_format = f">{halfwords}H"
9093
tmp = struct.unpack_from(little_byte_format, array_of_bytes, offset)
91-
struct.pack_into(big_byte_format, array_of_bytes, offset, *tmp)
94+
newBytes = bytearray(array_of_bytes)
95+
struct.pack_into(big_byte_format, newBytes, offset, *tmp)
96+
array_of_bytes = bytes(newBytes)
9297

9398
words = bytesCount//4
9499
endian_format = f">{words}I"
95100
if endian == InputEndian.LITTLE:
96101
endian_format = f"<{words}I"
97102
return list(struct.unpack_from(endian_format, array_of_bytes, offset))
98103

99-
def bytesToWords(array_of_bytes: bytearray, offset: int=0, offsetEnd: int|None=None) -> list[int]:
104+
def bytesToWords(array_of_bytes: bytes, offset: int=0, offsetEnd: int|None=None) -> list[int]:
100105
return endianessBytesToWords(GlobalConfig.ENDIAN, array_of_bytes, offset, offsetEnd)
101106

102107
#! deprecated
103108
bytesToBEWords = bytesToWords
104109

105-
def endianessWordsToBytes(endian: InputEndian, words_list: list[int], buffer: bytearray) -> bytearray:
110+
def endianessWordsToBytes(endian: InputEndian, words_list: list[int]) -> bytes:
106111
if endian == InputEndian.MIDDLE:
107112
raise BufferError("TODO: wordsToBytesEndianess: GlobalConfig.ENDIAN == InputEndian.MIDDLE")
108113

109114
words = len(words_list)
110115
endian_format = f">{words}I"
111116
if endian == InputEndian.LITTLE:
112117
endian_format = f"<{words}I"
113-
struct.pack_into(endian_format, buffer, 0, *words_list)
114-
return buffer
118+
return struct.pack(endian_format, *words_list)
115119

116-
def wordsToBytes(words_list: list[int], buffer: bytearray) -> bytearray:
117-
return endianessWordsToBytes(GlobalConfig.ENDIAN, words_list, buffer)
120+
def wordsToBytes(words_list: list[int]) -> bytes:
121+
return endianessWordsToBytes(GlobalConfig.ENDIAN, words_list)
118122

119123
#! deprecated
120124
beWordsToBytes = wordsToBytes
@@ -227,7 +231,7 @@ def getMaybeBooleyFromMaybeStr(booley: str|None) -> bool|None:
227231

228232
escapeCharactersSpecialCases = {0x1B, 0x8C, 0x8D}
229233

230-
def decodeString(buf: bytearray, offset: int, stringEncoding: str) -> tuple[list[str], int]:
234+
def decodeString(buf: bytes, offset: int, stringEncoding: str) -> tuple[list[str], int]:
231235
result = []
232236

233237
dst = bytearray()

spimdisasm/elf32/Elf32Dyns.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def ptr(self) -> int:
2929
return self.val
3030

3131
@staticmethod
32-
def fromBytearray(array_of_bytes: bytearray, offset: int = 0) -> Elf32DynEntry:
32+
def fromBytearray(array_of_bytes: bytes, offset: int = 0) -> Elf32DynEntry:
3333
entryFormat = common.GlobalConfig.ENDIAN.toFormatString() + "II"
3434
unpacked = struct.unpack_from(entryFormat, array_of_bytes, offset)
3535

@@ -41,7 +41,7 @@ def structSize() -> int:
4141

4242

4343
class Elf32Dyns:
44-
def __init__(self, array_of_bytes: bytearray, offset: int, rawSize: int):
44+
def __init__(self, array_of_bytes: bytes, offset: int, rawSize: int):
4545
self.dyns: list[Elf32DynEntry] = list()
4646
self.offset: int = offset
4747
self.rawSize: int = rawSize

spimdisasm/elf32/Elf32File.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
class Elf32File:
24-
def __init__(self, array_of_bytes: bytearray):
24+
def __init__(self, array_of_bytes: bytes):
2525
self.header = Elf32Header.fromBytearray(array_of_bytes)
2626
# print(self.header)
2727

@@ -140,10 +140,10 @@ def handleFlags(self) -> None:
140140
common.GlobalConfig.ARCHLEVEL = common.ArchLevel.MIPS64R2
141141

142142

143-
def _processSection_NULL(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
143+
def _processSection_NULL(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
144144
pass
145145

146-
def _processSection_PROGBITS(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
146+
def _processSection_PROGBITS(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
147147
fileSecType = common.FileSectionType.fromStr(sectionEntryName)
148148
smallFileSecType = common.FileSectionType.fromSmallStr(sectionEntryName)
149149

@@ -159,23 +159,23 @@ def _processSection_PROGBITS(self, array_of_bytes: bytearray, entry: Elf32Sectio
159159
self.got = Elf32GlobalOffsetTable(array_of_bytes, entry.offset, entry.size)
160160
elif sectionEntryName == ".interp":
161161
# strings with names of dynamic libraries
162-
common.Utils.printVerbose(f"Unhandled SYMTAB found: '{sectionEntryName}'")
162+
common.Utils.printVerbose(f"Unhandled PROGBITS found: '{sectionEntryName}'")
163163
elif sectionEntryName == ".MIPS.stubs":
164164
# ?
165-
common.Utils.printVerbose(f"Unhandled SYMTAB found: '{sectionEntryName}'")
165+
common.Utils.printVerbose(f"Unhandled PROGBITS found: '{sectionEntryName}'")
166166
elif sectionEntryName == ".init":
167167
# ?
168-
common.Utils.printVerbose(f"Unhandled SYMTAB found: '{sectionEntryName}'")
168+
common.Utils.printVerbose(f"Unhandled PROGBITS found: '{sectionEntryName}'")
169169
elif common.GlobalConfig.VERBOSE:
170170
common.Utils.eprint(f"Unhandled PROGBITS found: '{sectionEntryName}'", entry, "\n")
171171

172-
def _processSection_SYMTAB(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
172+
def _processSection_SYMTAB(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
173173
if sectionEntryName == ".symtab":
174174
self.symtab = Elf32Syms(array_of_bytes, entry.offset, entry.size)
175175
elif common.GlobalConfig.VERBOSE:
176176
common.Utils.eprint("Unhandled SYMTAB found: ", sectionEntryName, entry, "\n")
177177

178-
def _processSection_STRTAB(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
178+
def _processSection_STRTAB(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
179179
if sectionEntryName == ".strtab":
180180
self.strtab = Elf32StringTable(array_of_bytes, entry.offset, entry.size)
181181
elif sectionEntryName == ".dynstr":
@@ -185,33 +185,33 @@ def _processSection_STRTAB(self, array_of_bytes: bytearray, entry: Elf32SectionH
185185
elif common.GlobalConfig.VERBOSE:
186186
common.Utils.eprint("Unhandled STRTAB found: ", sectionEntryName, entry, "\n")
187187

188-
def _processSection_RELA(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
188+
def _processSection_RELA(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
189189
# ?
190190
pass
191191

192-
def _processSection_HASH(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
192+
def _processSection_HASH(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
193193
# ?
194194
pass
195195

196-
def _processSection_DYNAMIC(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
196+
def _processSection_DYNAMIC(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
197197
if sectionEntryName == ".dynamic":
198198
self.dynamic = Elf32Dyns(array_of_bytes, entry.offset, entry.size)
199199
elif common.GlobalConfig.VERBOSE:
200200
common.Utils.eprint("Unhandled DYNAMIC found: ", sectionEntryName, entry, "\n")
201201

202-
def _processSection_NOTE(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
202+
def _processSection_NOTE(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
203203
# ?
204204
pass
205205

206-
def _processSection_NOBITS(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
206+
def _processSection_NOBITS(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
207207
if sectionEntryName == ".bss":
208208
self.nobits = entry
209209
if sectionEntryName == ".sbss":
210210
self.nobitsSmall = entry
211211
elif common.GlobalConfig.VERBOSE:
212212
common.Utils.eprint("Unhandled NOBITS found: ", sectionEntryName, entry, "\n")
213213

214-
def _processSection_REL(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
214+
def _processSection_REL(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
215215
if sectionEntryName.startswith(".rel."):
216216
fileSecType = common.FileSectionType.fromStr(sectionEntryName[4:])
217217
if fileSecType != common.FileSectionType.Invalid:
@@ -221,53 +221,53 @@ def _processSection_REL(self, array_of_bytes: bytearray, entry: Elf32SectionHead
221221
elif common.GlobalConfig.VERBOSE:
222222
common.Utils.eprint("Unhandled REL found: ", sectionEntryName, entry, "\n")
223223

224-
def _processSection_DYNSYM(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
224+
def _processSection_DYNSYM(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
225225
if sectionEntryName == ".dynsym":
226226
self.dynsym = Elf32Syms(array_of_bytes, entry.offset, entry.size)
227227
elif common.GlobalConfig.VERBOSE:
228228
common.Utils.eprint("Unhandled DYNSYM found: ", sectionEntryName, entry, "\n")
229229

230230

231-
def _processSection_MIPS_LIBLIST(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
231+
def _processSection_MIPS_LIBLIST(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
232232
# ?
233233
pass
234234

235-
def _processSection_MIPS_MSYM(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
235+
def _processSection_MIPS_MSYM(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
236236
# ?
237237
pass
238238

239-
def _processSection_MIPS_CONFLICT(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
239+
def _processSection_MIPS_CONFLICT(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
240240
# ?
241241
pass
242242

243-
def _processSection_MIPS_GPTAB(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
243+
def _processSection_MIPS_GPTAB(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
244244
# ?
245245
pass
246246

247-
def _processSection_MIPS_DEBUG(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
247+
def _processSection_MIPS_DEBUG(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
248248
# ?
249249
pass
250250

251-
def _processSection_MIPS_REGINFO(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
251+
def _processSection_MIPS_REGINFO(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
252252
if sectionEntryName == ".reginfo":
253253
self.reginfo = Elf32RegInfo.fromBytearray(array_of_bytes, entry.offset)
254254
elif common.GlobalConfig.VERBOSE:
255255
common.Utils.eprint("Unhandled MIPS_REGINFO found: ", sectionEntryName, entry, "\n")
256256

257-
def _processSection_MIPS_OPTIONS(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
257+
def _processSection_MIPS_OPTIONS(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
258258
# ?
259259
pass
260260

261-
def _processSection_MIPS_SYMBOL_LIB(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
261+
def _processSection_MIPS_SYMBOL_LIB(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
262262
# ?
263263
pass
264264

265-
def _processSection_MIPS_ABIFLAGS(self, array_of_bytes: bytearray, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
265+
def _processSection_MIPS_ABIFLAGS(self, array_of_bytes: bytes, entry: Elf32SectionHeaderEntry, sectionEntryName: str) -> None:
266266
# ?
267267
pass
268268

269269

270-
_sectionProcessorCallbacks: dict[int, Callable[[Elf32File, bytearray, Elf32SectionHeaderEntry, str], None]] = {
270+
_sectionProcessorCallbacks: dict[int, Callable[[Elf32File, bytes, Elf32SectionHeaderEntry, str], None]] = {
271271
Elf32SectionHeaderType.NULL.value: _processSection_NULL,
272272
Elf32SectionHeaderType.PROGBITS.value: _processSection_PROGBITS,
273273
Elf32SectionHeaderType.SYMTAB.value: _processSection_SYMTAB,

spimdisasm/elf32/Elf32GlobalOffsetTable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def getAddress(self) -> int:
2727

2828

2929
class Elf32GlobalOffsetTable:
30-
def __init__(self, array_of_bytes: bytearray, offset: int, rawSize: int):
30+
def __init__(self, array_of_bytes: bytes, offset: int, rawSize: int):
3131
self.entries: list[int] = list()
3232
self.offset: int = offset
3333
self.rawSize: int = rawSize

spimdisasm/elf32/Elf32Header.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def getPad(self) -> int:
4848

4949

5050
@staticmethod
51-
def fromBytearray(array_of_bytes: bytearray, offset: int = 0) -> Elf32Identifier:
51+
def fromBytearray(array_of_bytes: bytes, offset: int = 0) -> Elf32Identifier:
5252
identFormat = "16B"
5353
ident = list(struct.unpack_from(identFormat, array_of_bytes, 0 + offset))
5454

@@ -90,7 +90,7 @@ class Elf32Header:
9090
# 0x34
9191

9292
@staticmethod
93-
def fromBytearray(array_of_bytes: bytearray, offset: int = 0) -> Elf32Header:
93+
def fromBytearray(array_of_bytes: bytes, offset: int = 0) -> Elf32Header:
9494
identifier = Elf32Identifier.fromBytearray(array_of_bytes, offset)
9595

9696
dataEncoding = identifier.getDataEncoding()

spimdisasm/elf32/Elf32RegInfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Elf32RegInfo:
1919
# 0x18
2020

2121
@staticmethod
22-
def fromBytearray(array_of_bytes: bytearray, offset: int = 0) -> Elf32RegInfo:
22+
def fromBytearray(array_of_bytes: bytes, offset: int = 0) -> Elf32RegInfo:
2323
gprFormat = common.GlobalConfig.ENDIAN.toFormatString() + "I"
2424
gpr = struct.unpack_from(gprFormat, array_of_bytes, 0 + offset)[0]
2525
# print(gpr)

spimdisasm/elf32/Elf32Rels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ def rType(self):
2626
return self.info & 0xFF
2727

2828
@staticmethod
29-
def fromBytearray(array_of_bytes: bytearray, offset: int = 0) -> Elf32RelEntry:
29+
def fromBytearray(array_of_bytes: bytes, offset: int = 0) -> Elf32RelEntry:
3030
entryFormat = common.GlobalConfig.ENDIAN.toFormatString() + "II"
3131
unpacked = struct.unpack_from(entryFormat, array_of_bytes, offset)
3232

3333
return Elf32RelEntry(*unpacked)
3434

3535

3636
class Elf32Rels:
37-
def __init__(self, sectionName: str, array_of_bytes: bytearray, offset: int, rawSize: int):
37+
def __init__(self, sectionName: str, array_of_bytes: bytes, offset: int, rawSize: int):
3838
self.sectionName = sectionName
3939
self.relocations: list[Elf32RelEntry] = list()
4040
self.offset: int = offset

spimdisasm/elf32/Elf32SectionHeaders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ class Elf32SectionHeaderEntry:
2929
# 0x28
3030

3131
@staticmethod
32-
def fromBytearray(array_of_bytes: bytearray, offset: int = 0) -> Elf32SectionHeaderEntry:
32+
def fromBytearray(array_of_bytes: bytes, offset: int = 0) -> Elf32SectionHeaderEntry:
3333
headerFormat = common.GlobalConfig.ENDIAN.toFormatString() + "10I"
3434
unpacked = struct.unpack_from(headerFormat, array_of_bytes, offset)
3535

3636
return Elf32SectionHeaderEntry(*unpacked)
3737

3838

3939
class Elf32SectionHeaders:
40-
def __init__(self, array_of_bytes: bytearray, shoff: int, shnum: int):
40+
def __init__(self, array_of_bytes: bytes, shoff: int, shnum: int):
4141
self.sections: list[Elf32SectionHeaderEntry] = list()
4242
self.shoff: int = shoff
4343
self.shnum: int = shnum

spimdisasm/elf32/Elf32StringTable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
# a.k.a. strtab (string table)
1010
class Elf32StringTable:
11-
def __init__(self, array_of_bytes: bytearray, offset: int, rawsize: int):
12-
self.strings: bytearray = array_of_bytes[offset:offset+rawsize]
11+
def __init__(self, array_of_bytes: bytes, offset: int, rawsize: int):
12+
self.strings: bytes = array_of_bytes[offset:offset+rawsize]
1313
self.offset: int = offset
1414
self.rawsize: int = rawsize
1515

spimdisasm/elf32/Elf32Syms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def stType(self):
3131
return self.info & 0xF
3232

3333
@staticmethod
34-
def fromBytearray(array_of_bytes: bytearray, offset: int = 0) -> Elf32SymEntry:
34+
def fromBytearray(array_of_bytes: bytes, offset: int = 0) -> Elf32SymEntry:
3535
entryFormat = common.GlobalConfig.ENDIAN.toFormatString() + "IIIBBH"
3636
unpacked = struct.unpack_from(entryFormat, array_of_bytes, offset)
3737

@@ -43,7 +43,7 @@ def structSize() -> int:
4343

4444

4545
class Elf32Syms:
46-
def __init__(self, array_of_bytes: bytearray, offset: int, rawSize: int):
46+
def __init__(self, array_of_bytes: bytes, offset: int, rawSize: int):
4747
self.symbols: list[Elf32SymEntry] = list()
4848
self.offset: int = offset
4949
self.rawSize: int = rawSize

spimdisasm/elfObjDisasm/ElfObjDisasmInternals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def getOutputPath(inputPath: Path, textOutput: Path, dataOutput: Path, sectionTy
123123

124124
return outputFilePath
125125

126-
def getProcessedSections(context: common.Context, elfFile: elf32.Elf32File, array_of_bytes: bytearray, inputPath: Path, textOutput: Path, dataOutput: Path) -> tuple[dict[common.FileSectionType, list[mips.sections.SectionBase]], dict[common.FileSectionType, list[Path]]]:
126+
def getProcessedSections(context: common.Context, elfFile: elf32.Elf32File, array_of_bytes: bytes, inputPath: Path, textOutput: Path, dataOutput: Path) -> tuple[dict[common.FileSectionType, list[mips.sections.SectionBase]], dict[common.FileSectionType, list[Path]]]:
127127
processedSegments: dict[common.FileSectionType, list[mips.sections.SectionBase]] = dict()
128128
segmentPaths: dict[common.FileSectionType, list[Path]] = dict()
129129

0 commit comments

Comments
 (0)