Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hactoolnet: Add NPDM converter #255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MonsterDruide1
Copy link

Following the command line interface of hactool, npdm files should be convertable to json for easier inspection. As there is no set format on how those json files should look, I just decided to read in the file and dump the whole internal structure into a json file by using .NETs JsonSerializer, beautifying things on the way by adding indentation.

@Thealexbarney
Copy link
Owner

Nice, this is something that should have been added to hactoolnet a while ago since hactool already has it. How does the output compare to that of hactool? I know it's a simple question that I could test myself, but I've had my time taken up by other things over the past few weeks

@ghost
Copy link

ghost commented Oct 17, 2022

Following the command line interface of hactool, npdm files should be convertable to json for easier inspection. As there is no set format on how those json files should look, I just decided to read in the file and dump the whole internal structure into a json file by using .NETs JsonSerializer, beautifying things on the way by adding indentation.

Hactool does have a set format for the json files, and there is at least one tool (npdmtool) which allows for converting them back to npdm that is part of the build process for multiple custom system modules and even Atmosphère.

@MonsterDruide1
Copy link
Author

Alright, I just re-worked the whole output method to result in a file similar to the ones described above. I've annotated the problems I'm having with it (version missing, multiple MMIO and IRQs), but other than that, it's now outputting a file of the exact same format as hactool, so should be able to get parsed by npdmtool as well.

@ghost
Copy link

ghost commented Oct 24, 2022

"Version" is the "ProcessCategory" field. It was incorrectly called the latter in the past, while the former is the correct name. LibHac still uses the latter, incorrect name.

@MonsterDruide1
Copy link
Author

Okay, fixed that - now it's only unknown what to do with multiple MMIOs and IRQs, and what happens with a null value on both.

@MonsterDruide1
Copy link
Author

Why does the CI fail here?

@Thealexbarney
Copy link
Owner

Apparently the CI as it's set up has trouble pulling version information when it's someone other than a repo owner makes a PR

@MonsterDruide1
Copy link
Author

Alright, so I can safely ignore that I guess... could you look over this PR again and annotate stuff you'd want to have changed? I'd love to get this merged ... some time.

@Thealexbarney
Copy link
Owner

Sure, is it ready to go now? It was apparently a WIP last time I looked at it since it wasn't working then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants