Conversation
Member
Author
This was referenced Jun 1, 2024
since the NAT data fields are also in NAT stream type packets, we can skip the extra checks
while technically still NEX, HokakuCTR is different enough to warrant its own separation imo
…d "gRPC Parameters"
this helps make the UI line up with the real protobufs
this prevents an issue where a session with thousands of packets continues to parse and emit events when a new session is opened. however it still does not clear the packet list right away, unsure why
…gle "serializedMessage" event
this helps reduce slowdowns on dumps with thousands of packets
calls to "this" inside parents still access the child class instance. hard-coding the names is a bit messy, but theres not really a "better" way without digging into the class prototypes, which is far uglier in my opinion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft for now as
PR rewrites all the packet parsing and session handling essentially from scratch, and migrates the app to TypeScript.
The current version of the viewer is extremely hacked together and buggy. This is due to the fact that I originally wanted to just make a CLI tool here, and hacked the UI on top. Additionally at the time we did not have Hokaku so raw RMC messages were handled completely separately from other packets, despite having nearly identical logic
This rewrite builds on what we have learned since then, focussing on a UI-first application (rather than CLI with a hacked UI on top of it), and takes notes from our Go libraries on how to handle certain patterns
Data serialization now makes much more sense and has been standardized, as opposed to the current viewer which handles some serialization differently resulting in a hacky front end
Some key changes:
nex-keys.txthas been deprecated. Since some games use use different key derivation methods it's not reliable to just use the pre-hashed keys anymore. Now all game server accounts are stored in the applicationssettings.jsonfile as an array of objects. The objects fields areplatform- The platform the account is for. Unused currently, will be used in the future to support non-NEX platformsusername- The username. On NEX this is the string representation of thepidvaluepid- Account PIDpassword- Plain-text password. Used to derive the other password, including any non-NEX standard ones in the futurepassword_hash_old- Pre-hashed NEX password using old key derivationpassword_hash_new- Pre-hashed NEX password using new key derivationtitles.jsonhas been restructured and now contains asettingsobject for stream settingsstring_length_sizeis not currently used. It is not possible to use this information at this time, as we need to know which title the packet is for BEFORE parsing it. This is not possible to do as the title is not determined until AFTER the firstSYNpacket arrives. This means Rendez-Vous connections which use non-NEX settings will fail heretitles.jsonentirely in favor of making each title it's own JavaScript class. This way a title may define more complex settings, like a custom compression algorithm, or custom checksum algorithm (such as the custom checksums seen in WATCH_DOGS)toJSONfunction MUST return an object__displayTypeNameand__typeNamefields__displayTypeNameis to be used when displaying the types data in the UI. Some types, such asList,Map, etc. may reference other information about themselves in this value, making it inadequate for type referencing__typeNameis the types original name, and is to be used when the program needs to check what the type of the object isString,Bool, etc. will set their value in the__valuefield. This can be either a primitive value (such as the value of aBool) OR another data type (such as the value of aAnyDataHolder)RVConnectionData, etc.) will set these is a__fieldsobject. The keys of the__fieldsobject are the field names, and the values are the field valuesStructuretypes store the structure version number in a__versionfield__version__displayTypeName__typeName__valueor__fields__parentfield ABOVE the__versionfield__typeNameisMap, this must be handled in a special way. In this case the__valuefield is used, and is set to an array (much likeList) where each element is an object. The objects have two fields,keyandvalueeach being a data type (not a primitive). This is the only case of special handling, as ANY type may be both a key or a value which doesn't play well with JavaScript (or most languages)Sessionhas been introduced. ASessionsimply represents a user's play session. It parses a single packet dump to look forConnectionsConnectionis no longer identified by a string discriminator made from the address. Now it uses a combination of the address, port, and connection stream settings. This allows for titles which reuse connections with multiple streams (such as Rayman Legends) to properly split each stream into it's own connectionRVConnectionDataare a separate server to the main secure server. When the StationURL is populated and the protocol list is not empty, clients will connect to BOTH the main and special stations. When clients make an RMC request, it checks the protocol ID and decides which to send it to. No known NEX titles use this feature, however it is partially checked now (though incomplete)