Skip to content

jonnypaes/blade-of-the-god-of-war

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

战神之刃 (God of War: Blade) - Android RE Study

This repository serves as a technical documentation of the reverse engineering process for a legacy Cocos2d-x (v3.x) mobile game port. The project focuses on bypassing hardcoded network dependencies and resolving JNI-related memory crashes (SIGSEGV) through Dalvik Bytecode modification.

🛠 Technical Overview

The objective was to "de-leash" the game client from a defunct Chinese backend and a cloud-resource SDK (CocosPlayClient) that prevented the engine from initializing local assets.

Key Challenges

  • Hardcoded Telemetry: The engine attempted to POST device data to a non-existent URL before loading the main scene.
  • JNI Bridge Crashes: A MalformedURLException in the Java layer was returning null to the C++ native layer, causing a null-pointer dereference at 0x0.
  • Asset Masking: The game utilized a "Fake Audio Trigger" where SoundPool would fail to load samples if the initial network handshake didn't return a specific "Success" JSON payload.

🏗 Reverse Engineering Workflow

1. Network Layer "Lobotomy"

Modified Cocos2dxHttpURLConnection.smali to implement a Ghost Server logic. Instead of touching the Android net stack, the class now returns synthetic responses immediately.

# Forced 200 OK Response
.method static getResponseCode(Ljava/net/HttpURLConnection;)I
    .locals 1
    const/16 v0, 0xc8
    return v0
.end method

2. SDK Neutralization

The CocosPlayClient middleware was identified as a secondary gatekeeper. By patching Cocos2dxActivity.smali, we bypassed the cloud-init sequence that was wiping local asset paths.

3. JNI Memory Alignment

To resolve Fatal signal 11 (SIGSEGV), the createHttpURLConnection method was forced to return a valid object pointer even upon failure, satisfying the native engine's expectation of a non-null return value.


📁 Repository Structure

  • /smali/: Contains the patched Dalvik bytecode for core engine classes.
  • /docs/: Logcat analysis and crash dump traces.
  • /tools/: Scripts used for APK rebuilding and signing.

🧪 Tools Used

  • Apktool / MT Manager: Bytecode disassembly and reassembly.
  • ADB Logcat: Real-time JNI and Dalvik monitoring.
  • 010 Editor: Hex-patching .so native libraries.

⚖️ Disclaimer

This project is for educational and research purposes only. It demonstrates the interoperability between Java and C++ in Android environments and the methodology of patching legacy software for preservation.

About

Android: 战神之刃 (Zhànshén zhī rèn) - Blade of the God of War [Reverse Engineering]

Resources

Stars

Watchers

Forks

Contributors

Languages