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

The bundled-resource texture and image loaders. More...

import <Foundation/Foundation.h>
import <UIKit/UIKit.h>
import "BFCodec.h"
import "Texture2D.h"
Include dependency graph for TextureLoading.h:

Go to the source code of this file.

Functions

NS_ASSUME_NONNULL_BEGIN UIImage *_Nullable CreateImageFromEncryptedData (BFCodec *cipher, NSMutableData *encryptedData)
 Decrypts an encrypted image blob in place and builds a UIImage from it.
BOOL LoadTextureSubImageFromResource (Texture2D *texture, NSString *resourceName, CGPoint point)
 Loads a bundled PNG and blits it into an existing texture atlas at a point.
BOOL LoadTextureSubImageFromEncryptedTex (Texture2D *texture, NSString *resourceName, BFCodec *cipher, CGPoint point)
 Decrypts a bundled .tex asset and blits it into an existing texture atlas at a point.
Texture2D *_Nullable CreateTexture2DFromPngResource (NSString *resourceName)
 Vends a fully-populated Texture2D atlas from a bundled PNG plus its sprite-rect plist.
Texture2D *_Nullable CreateTexture2DFromEncryptedTexResource (NSString *resourceName, BFCodec *cipher)
 Vends a Texture2D atlas from an encrypted .tex asset plus its plaintext plist.

Detailed Description

The bundled-resource texture and image loaders.

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

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

These five routines form one contiguous cluster in the binary (0x124ce8..0x125448) that turns a bundled asset into a Texture2D atlas, a texture sub-image, or a plain UIImage . Each takes its collaborators — the texture, the BFCodec cipher — as explicit arguments and none carries a self / _cmd pair, so they are genuine C free functions rather than methods of Texture2D or BFCodec ; the reconstruction rules' search for an owning class is exhausted (the two CreateTexture2DFrom* factories vend a Texture2D but are not registered in its runtime method table, exactly as LoadScaledPngImage is not a UIImage method). No embedded __FILE__ has been located, so this file's name is this tree's own; it is recorded in TYPES_PENDING.md as unproven.

The encrypted variants all skip a fixed four-byte header that precedes the image payload, and read their sprite-rect .plist unencrypted even when the image itself is enciphered.

Function Documentation

◆ CreateImageFromEncryptedData()

NS_ASSUME_NONNULL_BEGIN UIImage *_Nullable CreateImageFromEncryptedData ( BFCodec * cipher,
NSMutableData * encryptedData )

Decrypts an encrypted image blob in place and builds a UIImage from it.

Deciphers encryptedData through cipher — which rewrites the buffer in place — then builds an image from the payload after a fixed four-byte header. The header skip is unconditional and unvalidated, so a plaintext buffer fed here loses its first four bytes and yields nil .

Parameters
cipherThe Blowfish codec, already keyed.
encryptedDataThe ciphertext. Mutated in place by the decrypt.
Returns
An autoreleased image, or nil when the decrypt failed.
Ghidra address:
0x125448

◆ CreateTexture2DFromEncryptedTexResource()

Texture2D *_Nullable CreateTexture2DFromEncryptedTexResource ( NSString * resourceName,
BFCodec * cipher )

Vends a Texture2D atlas from an encrypted .tex asset plus its plaintext plist.

The encrypted twin of CreateTexture2DFromPngResource . Only the image bytes pass through cipher ; the sprite-rect .plist is read unencrypted.

Parameters
resourceNameThe base name shared by the .tex and .plist , without an extension.
cipherThe Blowfish codec, already keyed.
Returns
An autoreleased atlas with its sprite table set, or nil .
Ghidra address:
0x1251b0

◆ CreateTexture2DFromPngResource()

Texture2D *_Nullable CreateTexture2DFromPngResource ( NSString * resourceName)

Vends a fully-populated Texture2D atlas from a bundled PNG plus its sprite-rect plist.

Loads resourceName as a .png, wraps it in a Texture2D , then sets the sprite table from the matching .plist . A missing .plist fails the whole load even when the PNG decoded; the two files must ship as a pair.

Parameters
resourceNameThe base name shared by both files, without an extension.
Returns
An autoreleased atlas with its sprite table set, or nil .
Ghidra address:
0x124fec

◆ LoadTextureSubImageFromEncryptedTex()

BOOL LoadTextureSubImageFromEncryptedTex ( Texture2D * texture,
NSString * resourceName,
BFCodec * cipher,
CGPoint point )

Decrypts a bundled .tex asset and blits it into an existing texture atlas at a point.

The encrypted twin of LoadTextureSubImageFromResource : reads the .tex, deciphers it through cipher , skips the four-byte header, and blits the decoded image into texture at point .

Parameters
textureThe atlas to patch.
resourceNameThe bundle resource name, without the .tex extension.
cipherThe Blowfish codec, already keyed.
pointThe destination origin in texels.
Returns
YES on success; NO if the resource was missing, the decrypt failed, or the bytes were not a valid image.
Ghidra address:
0x124e00

◆ LoadTextureSubImageFromResource()

BOOL LoadTextureSubImageFromResource ( Texture2D * texture,
NSString * resourceName,
CGPoint point )

Loads a bundled PNG and blits it into an existing texture atlas at a point.

Resolves resourceName as a .png in the main bundle and, if present, draws it into texture at point . A missing resource leaves the atlas untouched and returns NO .

Parameters
textureThe atlas to patch.
resourceNameThe bundle resource name, without the .png extension.
pointThe destination origin in texels.
Returns
YES when the resource existed and was blitted, NO otherwise.
Ghidra address:
0x124ce8