ndspy
ndspy copied to clipboard
OverflowError when calling loadArm9
Hi, I am running ndspy 3.0.0 in Python 3.8.1 and I am getting an OverflowError when trying to loadArm9 on a ROM of Pokemon Conquest:
>>> rom.loadArm9()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files (x86)\Python38-32\lib\site-packages\ndspy\rom.py", line 503, in loadArm9
return code.MainCodeFile(self.arm9,
File "C:\Program Files (x86)\Python38-32\lib\site-packages\ndspy\code.py", line 106, in __init__
struct.unpack_from('<3I', data, self.codeSettingsOffs)
OverflowError: Python int too large to convert to C ssize_t
Sorry it took so long for me to get back to you :( . I don't have that game, but I've just added some error-handling code that should hopefully fix it, in commit d42c9326d0c988e7d69a6fe6365677c44a8b1bae. Can you try it and see if it solves your issue?
Likewise on the getting back :P
Now I'm getting a different error:
>>> a = r.loadArm9()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Admin\Documents\GitHub\ndspy\ndspy\rom.py", line 516, in loadArm9
return code.MainCodeFile(self.arm9,
File "C:\Users\Admin\Documents\GitHub\ndspy\ndspy\code.py", line 137, in __init__
struct.unpack_from('<3I', data, copyTablePos)
struct.error: unpack_from requires a buffer of at least 744548 bytes for unpacking 12 bytes at offset 744536 (actual buffer size is 744544)
This issue happens with another game as well, namely Phineas & Ferb Ride Again. Maybe it happens with any DSi Enhanced ROM?