ndspy icon indicating copy to clipboard operation
ndspy copied to clipboard

OverflowError when calling loadArm9

Open MathyFurret opened this issue 4 years ago • 2 comments

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

MathyFurret avatar Jun 15 '20 19:06 MathyFurret

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?

RoadrunnerWMC avatar Sep 14 '20 00:09 RoadrunnerWMC

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?

MathyFurret avatar Oct 12 '20 02:10 MathyFurret