Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Extracting and Analyzing Assets from AstralParty

Tech 1

Target Version: v1.2.3_20240430_123a

Locating Resource Files

To begin the extraction process, locate the game executable, AstralParty.exe. Once found, navigate to the installation directory structure: AstralParty_Data/StreamingAssets/aa/StandaloneWindows64/. This directory contains the game's asset bundles with the .bundle extension.

To preserve the game's integrity, copy these files to a separate working directory (e.g., working_folder) rather than modifying them in place.

Removing File Encryption

The asset files are protected by an 18-byte header that must be removed before analysis. Create a PowerShell script (e.g., process_assets.ps1) in the working_folder with the following logic:

$workspace = $PSScriptRoot
$outputDir = Join-Path $workspace "processed_files"
$headerSize = 18

if (-not (Test-Path $outputDir)) {
    New-Item -ItemType Directory -Path $outputDir | Out-Null
}

Get-ChildItem -LiteralPath $workspace -File | ForEach-Object {
    $file = $_
    if ($file.Extension -eq ".ps1") { return }

    $fileBytes = [System.IO.File]::ReadAllBytes($file.FullName)
    
    if ($fileBytes.Count -gt $headerSize) {
        $trimmedBytes = $fileBytes[$headerSize..($fileBytes.Count - 1)]
        $targetPath = Join-Path $outputDir $file.Name
        [System.IO.File]::WriteAllBytes($targetPath, $trimmedBytes)
        Write-Host "Decrypted: $($file.Name)"
    }
}

Execute this script. It will generate a subdirectory named processed_files containing the decrypted bundles ready for inspection.

Inspecting Assets

Download a compatible build of AssetStudio (specifically the .NET 7.0 release) and launch AssetStudio.GUI.exe.

  1. Configure the desired settings in the options menu if necessary.
  2. Go to File -> Load Folder and select the processed_files directory.
  3. Wait for the loading process to complete, then access the Asset List tab to view the internal resources. Previews may be available for specific asset types.

Exporting Data

Single or Specific Items

Select the target items from the list, right-click, and choose Export selected assets. Specify the destination directory to save the files.

Bulk Export by Type

To export entire categories, use the Filter Type dropdown to select specific classes such as TextAsset, Texture2D, or VideoClip. Navigate to Export -> Filtered assets to save all filtered items to your disk.

Removing Duplicate Resources

When exporting images or other media, duplicate files may appear. The following Python script can be placed in the export directory to identify and remove redundant files based on content comparison:

import os
import filecmp

directory = os.path.dirname(os.path.abspath(__file__))
files = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))]
files.sort()

# Exclude the script itself from processing
script_name = os.path.basename(__file__)
if script_name in files:
    files.remove(script_name)

groups = {}

# Organize files by their base name (handling counters)
for filename in files:
    # Split at extension and parenthesis to get the root name
    base_name = filename.split('.')[0].split('(')[0].strip()
    if base_name not in groups:
        groups[base_name] = []
    groups[base_name].append(filename)

# Process each group to find duplicates
for base_name, file_list in groups.items():
    if len(file_list) < 2:
        continue

    # Sort to prioritize the cleanest filename
    file_list.sort(key=lambda x: len(x))
    
    reference = file_list[0]
    ref_path = os.path.join(directory, reference)

    for duplicate in file_list[1:]:
        dup_path = os.path.join(directory, duplicate)
        if os.path.exists(ref_path) and os.path.exists(dup_path):
            if filecmp.cmp(ref_path, dup_path, shallow=False):
                os.remove(dup_path)
                print(f"Removed duplicate: {duplicate} (Reference: {reference})")
Tags: Game Modding

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.