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

misc fixes on bar docs #25

Merged
merged 1 commit into from
Jul 24, 2019
Merged

misc fixes on bar docs #25

merged 1 commit into from
Jul 24, 2019

Conversation

GovanifY
Copy link
Contributor

Excuse me in advance for this long PR and semi off-topic questions below, I tried to keep this as professional as possible.

  • the type is only a uint16, it can contain a duplicate flag
  • type 0x04 is not composed solely of VIF packets, albeit mostly, refer to my old tools for more details on their inner workings
  • the zero value is a lookup address used at runtime

Keep in mind all of this was done through memory, so someone would have to double check this info i guess.

On another note don't you think something like a kaitai setup would be much more explicit for structures? That would allow you to get a parser for free on top of auto-generated docs ( I will avoid to start an argument about other technologies used by the project and only mention it can output C# )

Also any reason why most documented formats are not documented anywhere in this project? Not enough workforce? I am curious about this point since most formats have been extensively documented in the past.

By the way, unlike what you mentionned on twitter, AI, PAX, ANB and spawn points have been mostly reversed:

  • Spawn points are available in kkdf2 tools from ages ago
  • Several disassemblers have been made privately for KH2 AI. The AI is a small stack-based variable-width ISA with a huge number of "syscalls" if we can call them this way, which are by large the main reason AI reversing is such a pain
  • ANBs has been mostly reversed by kkdf2 ten years ago again, with added information from soraiko and I
  • While I did not worked myself on the PAX format, I remember some old effort about that in the KH groups.

To aid in reversing, RECOM BETA ISO is compiled in debug mode and some of its symbols can be reused. For example, the whole dpd logic basically has not changed at all so this might have helped the reversing effort. Ghidra also has a work-in-progress decompiler, which I would encourage you to look into since it can ease up immensely some reversing time(it is nowhere near perfect, but gets some basic tasks done). Ghidra SLEIGH specification is to keep in mind in cases like this, since you basically get a free decompiler when making a disassembler.

Anyways, sorry about the whole off-topic parts of the PR.
Cheers,
-G

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@Xeeynamo
Copy link
Contributor

Hey Gauvain!

The documentation is not exactly in line with the core libraries (eg. the duplicate flag in BAR files). This is something that we definitively have to fix.

I personally worked for just few hours on both AI and PAX from scratch, as I do not have any base to work with. But I would be glad to not re-invent the wheel and speed-up the development! For ANB (and mostly 3D stuff), it is something that I personally do not want to touch and I want to wait to have other people to get their hands on.

I really would like to use Ghidra, but my attempts to use it with PS2 ELFs were not great. Kaitai seems to be a more production-ready version of BinaryMapper, which is interesting.

Thanks for the suggestions, the PR itself and all the details that comes with it. I am merging to master branch straight away!

@Xeeynamo Xeeynamo merged commit 03c8ade into OpenKH:master Jul 24, 2019
@GovanifY
Copy link
Contributor Author

Hey,

Ghidra wise, while beardypig plugin isn't as polished as IDA if nobody ever does the yak shaving we'll be stuck in such a situation. I understand that currently IDA seems like the easiest choice and it most likely will stay this way since very few people still work on the PS2, nevertheless it is still something to keep in mind if you ever want to learn more about PS2 co-processors operations and improve the plugin.

Kaitai wise, it's waaaay more mature than BinaryMapper. Shameless plug but years ago I created some kaitai definitions which you can see somewhere in this post for KH2. If we really want auto-generated documentation then we could make use of the doc parameters of kaitai flags and have an explaination in proper english. It is really well designed and you can do pretty much whatever you think about with it.

I'm willing to help later for kaitai parsers and documentation but totally unwilling to help with any non-portable WPF-based GUI. You know my thoughts on the technology you're using and I believe that when I am unable to even use the tools that I'd work on, there would be an obvious issue for both you and I.

Oh and simply curious but why aren't you interested about the 3D formats? They're one of the most convoluted and fun formats of KH2 to reverse, you're missing something haha.

While I do not have a discord account anymore(I will contact you in some other way when I am ready to help) your discord invite link in your contribution guide has expired, you might want to fix this :)

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.

None yet

2 participants