d0k3 / GodMode9

GodMode9 Explorer - A full access file browser for the Nintendo 3DS console :godmode:
GNU General Public License v3.0
2.12k stars 191 forks source link

[BUG] Unable to build CDN contents / Show Title Info for titles that have > 1000 contents #703

Closed ZeroSkill1 closed 3 years ago

ZeroSkill1 commented 3 years ago

R00: 00000000 | R01: 20119340 R02: E803C678 | R03: E803C679 R04: 00000000 | R05: 0805BBD8 R06: 0805A57C | R07: 0805A584 R08: 2012C000 | R09: 00000000 R10: 08060DC4 | R11: 00000000 R12: 081559B8 | R13: 227EF7E8 R14: 0803AD01 | R15: 08041CE6 CPSR: 800000FF

Stack: 227EF7E0: 48 93 11 20 73 1C 04 08 00 C0 12 20 88 C6 03 E8 227EF7F0: C4 0D 06 08 40 93 11 20 C8 36 00 00 D8 BB 05 08 227EF800: 7C A5 05 08 7B AA 03 08 00 40 00 00 00 00 00 00 227EF810: 00 00 00 00 01 00 00 00 B0 B6 FF 01 EF BE 03 00 227EF820: 00 00 00 00 C0 36 00 00 01 00 00 00 50 F9 7E 22 227EF830: 40 00 00 00 13 A5 03 08 BC BD 04 20 19 E5 02 08 227EF840: 20 2D 20 44 45 4C 45 54 45 20 2F 20 5B 2B 52 5D 227EF850: 20 52 45 4E 41 4D 45 20 66 69 6C 65 28 73 29 00

Code: 08041CD0: 2301 444A 188F 46BC 6884 4F54 4313 42BC 08041CE0: D100 E07E 68C0 60E0 6084 604B 4663 601A



![20210419_173551](https://user-images.githubusercontent.com/18742654/115452523-36b22180-a227-11eb-8bcf-9febdda9b363.jpg)

* Anything special about your console? (defects, custom modifications,...)
No.
* Bootloader (boot9strap/fastboot3ds)
B9S 1.3
* Did you chainload GodMode9 via Luma?
Yes.
d0k3 commented 3 years ago

@TimmSkiller - could you try this test build? https://f.secretalgorithm.com/Bm7Gg/godmode9.firm

ZeroSkill1 commented 3 years ago

Will try it right now.

ZeroSkill1 commented 3 years ago

Seems to work so far, trying to verify contents now.

ZeroSkill1 commented 3 years ago

Verification passed, trying a CIA build next

ZeroSkill1 commented 3 years ago

@d0k3 okay now this is interesting. The CIA built just fine but it only inserted 256 contents instead of all 1094. Maybe this is because a regular ticket can only hold 256 contents in the content index?

ZeroSkill1 commented 3 years ago

If that is the case, then you'd have to implement larger fake tickets to accommodate for more than 256 contents.

luigoalma commented 3 years ago

Current fake tickets should cover 1024 indexes, but CiaStub struct, ticket handling code on cia building or parsing, and a few things cia.c would need to change to support the variably sized tickets, currently only takes ticket common size, that's one thing I did not implement changes to when giving dynamic size ticket support code.

ZeroSkill1 commented 3 years ago

Well I spoke too soon. When I mount that CIA, and try to access any contents inside it, I will get thrown into an exception loop.

ZeroSkill1 commented 3 years ago
Exception: Data Abort (4)
GodMode9 v2.0.0-10-g236d2dc0
2021-05-01 17:15:53

R00: 20159348 | R01: 20119340
R02: 00040008 | R03: 09A127B0
R04: 00000001 | R05: 0805BCE0
R06: 0805A684 | R07: 00040009
R08: 20174000 | R09: E98B9468
R10: 08060EC4 | R11: 00000000
R12: 09A127B0 | R13: 227FFFB8
R14: 08041E42 | R15: 08041E42
CPSR: 200000F7

Code:
08041E30: D100 E07E 68C0 60E0 6084 604B 4663 601A 
08041E40: E005 685F 4227 D0EB 4314 604C 6002 2380 
ZeroSkill1 commented 3 years ago

It's quite strange, it will crash, but then it will keep on crashing and crashing. Because of that, I had to force shut off my console. There are like 43 exception dumps in my gm9/out folder

d0k3 commented 3 years ago

Some remarks about this 'fix':

So, not so nice. But at least it fails gracefully now in standard mode, and you got a way of building with a special build. And, before I forget it, thanks @luigoalma for additional code.