JubeatPlus 3.9.11
Loading...
Searching...
No Matches
LabUtilities.h File Reference

The jubeat Lab URL cipher. More...

import <Foundation/Foundation.h>
Include dependency graph for LabUtilities.h:

Go to the source code of this file.

Functions

NS_ASSUME_NONNULL_BEGIN NSMutableData *_Nullable CreateLabEncryptedData (NSString *_Nullable pszString)
 Blowfish-encrypts a string with the Lab key.
NSData *_Nullable GetBgmCipherKey (void)
 The Blowfish key the packed asset archives are enciphered with.

Detailed Description

The jubeat Lab URL cipher.

Reconstructed from Ghidra program Jubeat (image base 0x100000000). All

Ghidra address:
values are offsets relative to that image base.

The one caller is -[JubeatAppDelegate application:didFinishLaunchingWithOptions:], which uses it once on first launch to obfuscate the Lab URL before storing it in user defaults.

Function Documentation

◆ CreateLabEncryptedData()

NS_ASSUME_NONNULL_BEGIN NSMutableData *_Nullable CreateLabEncryptedData ( NSString *_Nullable pszString)

Blowfish-encrypts a string with the Lab key.

The launch handler calls this once, on first launch only, to turn the plaintext Lab URL into the blob it persists under the "PrefjubeatLabURL" user default.

The returned object is the same buffer that was enciphered, not a copy, so it is mutable and a caller could keep changing it. The key is an MD5 of a 19-character passphrase that this function rebuilds on its own stack rather than calling CreateLabUrlCipherKey at 0x7f9b0, though the passphrase is byte-for-byte the same.

One edge is worth knowing about: -dataUsingEncoding: returns nil for input it cannot encode, and +dataWithData: raises on nil rather than returning it, so a malformed string throws rather than producing the nil this function's nil check implies it handles.

Parameters
pszStringThe plaintext. nil is accepted and yields nil.
Returns
The ciphertext, autoreleased, or nil when the input was nil.
Ghidra address:
0x8011c

◆ GetBgmCipherKey()

NSData *_Nullable GetBgmCipherKey ( void )

The Blowfish key the packed asset archives are enciphered with.

DECLARED ONLY. Despite the name it is not limited to audio: -[ArtworkLoader loadArtwork] uses it to decipher artwork out of the same archives. The name is Ghidra's, already applied to the function in the program database.

Returns
The key material, to be handed to -[BFCodec cipherInit:] .
Ghidra address:
0x7f7a0