yes
This commit is contained in:
commit
9c3189cac2
3219 files changed
+1984040
No files matched your search
@@ -0,0 +1,2 @@
|
||||
/__pycache__
|
||||
captures
|
||||
@@ -0,0 +1,154 @@
|
||||
// capture_chacha_key.js - Hook ChaCha20 to capture session encryption key
|
||||
// Hooks the AVX path at RVA 0xc254d4 (the scalar path at 0xc25118 gets 0 calls on modern CPUs)
|
||||
//
|
||||
// ChaCha20 state layout (64 bytes):
|
||||
// [0..15] "expand 32-byte k" (sigma constants: 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574)
|
||||
// [16..47] 32-byte key
|
||||
// [48..51] 32-bit counter
|
||||
// [52..63] 12-byte nonce (or 8-byte nonce + 4-byte extended counter)
|
||||
//
|
||||
// Function signature (from research):
|
||||
// rcx = state pointer (sigma + key)
|
||||
// rdx = output buffer
|
||||
// r8 = nonce/counter
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
var BASE = Process.getModuleByName('Paralogue-Win64-Shipping.exe').base;
|
||||
|
||||
// ChaCha20 AVX path entry (confirmed used on modern CPUs)
|
||||
var CHACHA_AVX_RVA = 0xc254d4;
|
||||
// ChaCha20 scalar path (fallback, rarely used)
|
||||
var CHACHA_SCALAR_RVA = 0xc25118;
|
||||
// Function entry with CPU feature check
|
||||
var CHACHA_ENTRY_RVA = 0xc250e8;
|
||||
|
||||
// "expand 32-byte k" as 4 uint32 LE values
|
||||
var SIGMA = [0x61707865, 0x3320646e, 0x79622d32, 0x6b206574];
|
||||
|
||||
var capturedKeys = {};
|
||||
var callCount = 0;
|
||||
var gameKeyFound = false;
|
||||
|
||||
function readState(ptr) {
|
||||
// Read the full 64-byte ChaCha20 state
|
||||
try {
|
||||
var state = ptr.readByteArray(64);
|
||||
if (!state) return null;
|
||||
return new Uint8Array(state);
|
||||
} catch(e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function toHex(arr, start, len) {
|
||||
var hex = '';
|
||||
for (var i = start; i < start + len && i < arr.length; i++) {
|
||||
hex += ('0' + arr[i].toString(16)).slice(-2);
|
||||
}
|
||||
return hex;
|
||||
}
|
||||
|
||||
function checkSigma(state) {
|
||||
// Check if first 16 bytes match "expand 32-byte k"
|
||||
var dv = new DataView(state.buffer, state.byteOffset, state.byteLength);
|
||||
return dv.getUint32(0, true) === SIGMA[0] &&
|
||||
dv.getUint32(4, true) === SIGMA[1] &&
|
||||
dv.getUint32(8, true) === SIGMA[2] &&
|
||||
dv.getUint32(12, true) === SIGMA[3];
|
||||
}
|
||||
|
||||
function extractKeyInfo(state) {
|
||||
var key = toHex(state, 16, 32);
|
||||
var counter = toHex(state, 48, 4);
|
||||
var nonce = toHex(state, 52, 12);
|
||||
return {key: key, counter: counter, nonce: nonce};
|
||||
}
|
||||
|
||||
// Hook the function entry point (which dispatches to AVX or scalar)
|
||||
var chachaEntry = BASE.add(CHACHA_ENTRY_RVA);
|
||||
send({t: 'info', msg: 'Hooking ChaCha20 entry at ' + chachaEntry});
|
||||
|
||||
Interceptor.attach(chachaEntry, {
|
||||
onEnter: function(args) {
|
||||
callCount++;
|
||||
var statePtr = args[0]; // rcx = state pointer
|
||||
|
||||
var state = readState(statePtr);
|
||||
if (!state) return;
|
||||
|
||||
if (!checkSigma(state)) {
|
||||
// Not a standard ChaCha20 state, might be different calling convention
|
||||
// Try reading from different offsets
|
||||
return;
|
||||
}
|
||||
|
||||
var info = extractKeyInfo(state);
|
||||
var keyHash = info.key;
|
||||
|
||||
// Only report each unique key once
|
||||
if (!capturedKeys[keyHash]) {
|
||||
capturedKeys[keyHash] = true;
|
||||
|
||||
// Read the nonce/counter from r8 as well
|
||||
var r8 = this.context.r8;
|
||||
var r8Data = null;
|
||||
try {
|
||||
r8Data = toHex(new Uint8Array(r8.readByteArray(16)), 0, 16);
|
||||
} catch(e) {}
|
||||
|
||||
send({
|
||||
t: 'chacha_key',
|
||||
key: info.key,
|
||||
counter: info.counter,
|
||||
nonce: info.nonce,
|
||||
r8_data: r8Data,
|
||||
call_num: callCount,
|
||||
state_ptr: statePtr.toString()
|
||||
});
|
||||
|
||||
// Also send the full 64-byte state as binary
|
||||
send({t: 'chacha_state', call_num: callCount}, statePtr.readByteArray(64));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Also try hooking the AVX path directly as backup
|
||||
var chachaAVX = BASE.add(CHACHA_AVX_RVA);
|
||||
send({t: 'info', msg: 'Hooking ChaCha20 AVX at ' + chachaAVX});
|
||||
|
||||
Interceptor.attach(chachaAVX, {
|
||||
onEnter: function(args) {
|
||||
// At the AVX path entry, args might be different since we're mid-function
|
||||
// The state pointer should still be in rcx or on the stack
|
||||
// Try rcx first
|
||||
var statePtr = this.context.rcx;
|
||||
var state = readState(statePtr);
|
||||
if (!state || !checkSigma(state)) {
|
||||
// Try the stack - the entry function may have saved rcx
|
||||
return;
|
||||
}
|
||||
|
||||
var info = extractKeyInfo(state);
|
||||
if (!capturedKeys[info.key + '_avx']) {
|
||||
capturedKeys[info.key + '_avx'] = true;
|
||||
send({
|
||||
t: 'chacha_key_avx',
|
||||
key: info.key,
|
||||
counter: info.counter,
|
||||
nonce: info.nonce,
|
||||
call_num: callCount
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
send({t: 'ready', msg: 'ChaCha20 key capture hooks installed. Waiting for encryption calls...'});
|
||||
|
||||
// Periodic status report
|
||||
var statusInterval = setInterval(function() {
|
||||
var numKeys = Object.keys(capturedKeys).length;
|
||||
send({t: 'status', calls: callCount, unique_keys: numKeys});
|
||||
}, 10000);
|
||||
})();
|
||||
@@ -0,0 +1,96 @@
|
||||
// capture_handshake.js - Captures the KEY_A/KEY_B handshake and all subsequent packets
|
||||
// Must be attached BEFORE the game connects to port 11001
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
var TARGET_PORT = 11001;
|
||||
var gameFd = null;
|
||||
var pktNum = 0;
|
||||
var recvAccum = []; // accumulate recv fragments for current message
|
||||
var handshakeDone = false;
|
||||
|
||||
var ws2 = Process.getModuleByName('ws2_32.dll');
|
||||
var exp = {};
|
||||
ws2.enumerateExports().forEach(function(e) { exp[e.name] = e.address; });
|
||||
var getpeername_fn = new NativeFunction(exp['getpeername'], 'int', ['uint', 'pointer', 'pointer']);
|
||||
|
||||
function getPeerPort(fd) {
|
||||
var buf = Memory.alloc(32);
|
||||
var lenp = Memory.alloc(4);
|
||||
lenp.writeU32(32);
|
||||
if (getpeername_fn(fd, buf, lenp) === 0 && buf.readU16() === 2)
|
||||
return (buf.add(2).readU8() << 8) | buf.add(3).readU8();
|
||||
return 0;
|
||||
}
|
||||
|
||||
function toHex(arr, maxLen) {
|
||||
var hex = '';
|
||||
var n = maxLen ? Math.min(arr.length, maxLen) : arr.length;
|
||||
for (var i = 0; i < n; i++) hex += ('0' + arr[i].toString(16)).slice(-2);
|
||||
if (maxLen && arr.length > maxLen) hex += '...';
|
||||
return hex;
|
||||
}
|
||||
|
||||
// Hook connect to detect game server connection
|
||||
Interceptor.attach(exp['connect'], {
|
||||
onEnter: function(args) {
|
||||
this.fd = args[0].toInt32();
|
||||
this.addr = args[1];
|
||||
},
|
||||
onLeave: function(retval) {
|
||||
if (retval.toInt32() !== 0 && retval.toInt32() !== -1) return;
|
||||
try {
|
||||
var family = this.addr.readU16();
|
||||
if (family !== 2) return;
|
||||
var port = (this.addr.add(2).readU8() << 8) | this.addr.add(3).readU8();
|
||||
var ip = this.addr.add(4).readU8() + '.' + this.addr.add(5).readU8() + '.' +
|
||||
this.addr.add(6).readU8() + '.' + this.addr.add(7).readU8();
|
||||
if (port === TARGET_PORT) {
|
||||
gameFd = this.fd;
|
||||
send({t: 'connect', fd: gameFd, ip: ip, port: port});
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
});
|
||||
|
||||
// Hook recv - capture ALL data from game socket
|
||||
Interceptor.attach(exp['recv'], {
|
||||
onEnter: function(args) {
|
||||
this.fd = args[0].toInt32();
|
||||
this.buf = args[1];
|
||||
this.reqLen = args[2].toInt32();
|
||||
// Auto-discover if we missed the connect
|
||||
if (!gameFd && getPeerPort(this.fd) === TARGET_PORT) {
|
||||
gameFd = this.fd;
|
||||
send({t: 'discovered', fd: gameFd});
|
||||
}
|
||||
},
|
||||
onLeave: function(retval) {
|
||||
if (this.fd !== gameFd) return;
|
||||
var n = retval.toInt32();
|
||||
if (n <= 0) return;
|
||||
var data = new Uint8Array(this.buf.readByteArray(n));
|
||||
pktNum++;
|
||||
send({t: 'recv', n: pktNum, sz: n, req: this.reqLen}, this.buf.readByteArray(n));
|
||||
}
|
||||
});
|
||||
|
||||
// Hook send - capture ALL data sent to game socket
|
||||
Interceptor.attach(exp['send'], {
|
||||
onEnter: function(args) {
|
||||
this.fd = args[0].toInt32();
|
||||
this.buf = args[1];
|
||||
this.len = args[2].toInt32();
|
||||
},
|
||||
onLeave: function(retval) {
|
||||
if (this.fd !== gameFd) return;
|
||||
var n = retval.toInt32();
|
||||
if (n <= 0) return;
|
||||
pktNum++;
|
||||
send({t: 'send', n: pktNum, sz: n}, this.buf.readByteArray(n));
|
||||
}
|
||||
});
|
||||
|
||||
send({t: 'ready', msg: 'Handshake capture ready. Waiting for connection to port ' + TARGET_PORT});
|
||||
})();
|
||||
@@ -0,0 +1,180 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
capture_handshake.py - Capture the full KEY_A/KEY_B handshake
|
||||
Run this, then start/restart the game. It will attach once the process appears.
|
||||
"""
|
||||
|
||||
import frida
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import struct
|
||||
import json
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
JS_PATH = os.path.join(SCRIPT_DIR, 'capture_handshake.js')
|
||||
PROCESS_NAME = 'Paralogue-Win64-Shipping.exe'
|
||||
OUTPUT_DIR = os.path.join(SCRIPT_DIR, 'captures')
|
||||
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
||||
|
||||
packets = []
|
||||
session = None
|
||||
|
||||
|
||||
def on_message(message, data):
|
||||
if message['type'] == 'error':
|
||||
print(f'[!] {message["description"]}')
|
||||
return
|
||||
|
||||
p = message.get('payload', {})
|
||||
if not isinstance(p, dict):
|
||||
return
|
||||
|
||||
t = p.get('t', '')
|
||||
|
||||
if t == 'ready':
|
||||
print(f'[*] {p["msg"]}')
|
||||
return
|
||||
|
||||
if t in ('connect', 'discovered'):
|
||||
fd = p.get('fd', '?')
|
||||
ip = p.get('ip', '?')
|
||||
port = p.get('port', '?')
|
||||
print(f'[+] Game socket fd={fd} -> {ip}:{port}')
|
||||
return
|
||||
|
||||
if t in ('recv', 'send') and data:
|
||||
raw = bytes(data)
|
||||
n = p.get('n', 0)
|
||||
direction = 'S->C' if t == 'recv' else 'C->S'
|
||||
ts = time.time()
|
||||
packets.append({'ts': ts, 'dir': direction, 'data': raw, 'n': n, 'req': p.get('req', 0)})
|
||||
|
||||
# Decode if it looks like a handshake packet (starts with 00 08)
|
||||
label = ''
|
||||
if len(raw) >= 10 and raw[0] == 0x00 and raw[1] == 0x08:
|
||||
# Protobuf envelope
|
||||
hdr = raw[2:10]
|
||||
fields = {}
|
||||
pos = 0
|
||||
while pos < len(hdr):
|
||||
byte = hdr[pos]
|
||||
fn = byte >> 3
|
||||
wt = byte & 7
|
||||
pos += 1
|
||||
if wt == 0:
|
||||
val = 0; shift = 0
|
||||
while pos < len(hdr):
|
||||
b = hdr[pos]; val |= (b & 0x7f) << shift; shift += 7; pos += 1
|
||||
if (b & 0x80) == 0: break
|
||||
fields[fn] = val
|
||||
msg_type = fields.get(2, 0)
|
||||
names = {1001: 'KEY_A', 1002: 'KEY_B'}
|
||||
label = f' [{names.get(msg_type, f"type_{msg_type}")} route={fields.get(1,0)} f4={fields.get(4,0)}]'
|
||||
|
||||
# Check for protobuf-like content (might be decrypted)
|
||||
if not label and len(raw) > 4:
|
||||
# Check if first byte is a valid protobuf field tag
|
||||
tag = raw[0]
|
||||
fn = tag >> 3
|
||||
wt = tag & 7
|
||||
if fn > 0 and fn < 100 and wt in (0, 2):
|
||||
label = f' [maybe protobuf: field{fn} wire{wt}]'
|
||||
|
||||
sz = len(raw)
|
||||
hex_preview = raw[:32].hex()
|
||||
if sz > 32:
|
||||
hex_preview += '...'
|
||||
print(f'[#{n:04d}] {direction} {sz:5d}B{label}')
|
||||
print(f' {hex_preview}')
|
||||
|
||||
# Save incrementally
|
||||
capfile = os.path.join(OUTPUT_DIR, f'handshake_{int(ts)}.jsonl')
|
||||
with open(capfile, 'a') as f:
|
||||
entry = {'n': n, 'dir': direction, 'ts': ts, 'sz': sz, 'hex': raw.hex()}
|
||||
if label:
|
||||
entry['label'] = label.strip(' []')
|
||||
f.write(json.dumps(entry) + '\n')
|
||||
|
||||
|
||||
def wait_for_process():
|
||||
print(f'[*] Waiting for {PROCESS_NAME}...')
|
||||
while True:
|
||||
try:
|
||||
device = frida.get_local_device()
|
||||
for proc in device.enumerate_processes():
|
||||
if proc.name == PROCESS_NAME:
|
||||
return proc.pid
|
||||
except:
|
||||
pass
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def main():
|
||||
global session
|
||||
|
||||
print('=' * 60)
|
||||
print(' Handshake Capture Tool')
|
||||
print(' Close the game, then start it. This tool will auto-attach.')
|
||||
print('=' * 60)
|
||||
|
||||
with open(JS_PATH, 'r') as f:
|
||||
js_code = f.read()
|
||||
|
||||
# Check if already running
|
||||
try:
|
||||
device = frida.get_local_device()
|
||||
for proc in device.enumerate_processes():
|
||||
if proc.name == PROCESS_NAME:
|
||||
print(f'[!] Game already running (PID {proc.pid}). Attaching...')
|
||||
print(f'[!] Note: handshake may already be done. Restart game for full capture.')
|
||||
session = frida.attach(proc.pid)
|
||||
break
|
||||
except:
|
||||
pass
|
||||
|
||||
if not session:
|
||||
pid = wait_for_process()
|
||||
print(f'[*] Found {PROCESS_NAME} (PID {pid}), attaching...')
|
||||
# Small delay to let the process initialize
|
||||
time.sleep(2)
|
||||
session = frida.attach(pid)
|
||||
|
||||
print(f'[*] Attached. Installing hooks...')
|
||||
script = session.create_script(js_code)
|
||||
script.on('message', on_message)
|
||||
script.load()
|
||||
|
||||
print('[*] Press Ctrl+C to stop.\n')
|
||||
|
||||
try:
|
||||
while True:
|
||||
time.sleep(0.5)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
print(f'\n[*] Captured {len(packets)} packets.')
|
||||
|
||||
# Save summary
|
||||
if packets:
|
||||
summary_path = os.path.join(OUTPUT_DIR, 'handshake_summary.txt')
|
||||
with open(summary_path, 'w') as f:
|
||||
for pkt in packets:
|
||||
f.write(f'{pkt["dir"]} {pkt["n"]:4d} {len(pkt["data"]):5d}B {pkt["data"][:32].hex()}\n')
|
||||
print(f'[*] Summary saved to {summary_path}')
|
||||
|
||||
# Save raw binary capture
|
||||
bin_path = os.path.join(OUTPUT_DIR, 'handshake.bin')
|
||||
with open(bin_path, 'wb') as f:
|
||||
for pkt in packets:
|
||||
d = 0 if pkt['dir'] == 'C->S' else 1
|
||||
f.write(struct.pack('<dBI', pkt['ts'], d, len(pkt['data'])))
|
||||
f.write(pkt['data'])
|
||||
print(f'[*] Binary capture saved to {bin_path}')
|
||||
|
||||
session.detach()
|
||||
print('[*] Done.')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,96 @@
|
||||
// capture_session_key.js - Capture keystream by XORing ciphertext with plaintext
|
||||
// Write keystream blocks to file so the proxy can use them.
|
||||
// Also capture the plaintext for analysis.
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
var BASE = Process.getModuleByName('Paralogue-Win64-Shipping.exe').base;
|
||||
var GAME_WRAPPER = BASE.add(0x49A2EB0);
|
||||
|
||||
var callCount = 0;
|
||||
// Track keystream per direction (we need to figure out which calls are recv vs send)
|
||||
var totalOffset = 0;
|
||||
|
||||
function toHex(ptr, len) {
|
||||
try {
|
||||
var arr = new Uint8Array(ptr.readByteArray(len));
|
||||
var hex = '';
|
||||
for (var i = 0; i < arr.length; i++)
|
||||
hex += ('0' + arr[i].toString(16)).slice(-2);
|
||||
return hex;
|
||||
} catch(e) { return 'ERR'; }
|
||||
}
|
||||
|
||||
Interceptor.attach(GAME_WRAPPER, {
|
||||
onEnter: function(args) {
|
||||
callCount++;
|
||||
var thisPtr = this.context.rcx;
|
||||
var dataPtr = this.context.r9;
|
||||
var dataLen = this.context.r8.toInt32();
|
||||
|
||||
if (dataLen <= 0) return;
|
||||
|
||||
var streamOff = 0;
|
||||
try { streamOff = Number(thisPtr.add(0xA0).readU64()); } catch(e) {}
|
||||
|
||||
// Determine direction: check [this+0x60] byte (encrypt flag?)
|
||||
var encFlag = 0;
|
||||
try { encFlag = thisPtr.add(0x60).readU8(); } catch(e) {}
|
||||
|
||||
this._n = callCount;
|
||||
this._dataPtr = dataPtr;
|
||||
this._dataLen = dataLen;
|
||||
this._offset = streamOff;
|
||||
this._encFlag = encFlag;
|
||||
|
||||
// Read input (before processing)
|
||||
try {
|
||||
this._inputData = dataPtr.readByteArray(dataLen);
|
||||
} catch(e) {
|
||||
this._inputData = null;
|
||||
}
|
||||
},
|
||||
onLeave: function(retval) {
|
||||
if (!this._inputData || !this._dataLen) return;
|
||||
|
||||
// Read output (after processing)
|
||||
var outputData = null;
|
||||
try {
|
||||
outputData = this._dataPtr.readByteArray(this._dataLen);
|
||||
} catch(e) { return; }
|
||||
|
||||
var input = new Uint8Array(this._inputData);
|
||||
var output = new Uint8Array(outputData);
|
||||
|
||||
// Compute keystream = input XOR output
|
||||
var keystream = new Uint8Array(this._dataLen);
|
||||
for (var i = 0; i < this._dataLen; i++) {
|
||||
keystream[i] = input[i] ^ output[i];
|
||||
}
|
||||
|
||||
// Send plaintext + keystream + metadata
|
||||
send({
|
||||
t: 'packet',
|
||||
n: callCount,
|
||||
offset: this._offset,
|
||||
len: this._dataLen,
|
||||
enc: this._encFlag,
|
||||
input: toHex(ptr(0), 0), // placeholder
|
||||
}, outputData); // send plaintext as binary
|
||||
|
||||
// Also send keystream
|
||||
send({
|
||||
t: 'keystream',
|
||||
offset: this._offset,
|
||||
len: this._dataLen,
|
||||
}, keystream.buffer);
|
||||
}
|
||||
});
|
||||
|
||||
setInterval(function() {
|
||||
send({t: 'status', calls: callCount});
|
||||
}, 5000);
|
||||
|
||||
send({t: 'ready', msg: 'Capturing plaintext + keystream from game wrapper.'});
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 20000, 20001, 20002, 20003, 20004, 20005, 20006, 20007, 20008, 20009, 20010, 20011, 20012, 20013, 20014, 20015,Line truncated
|
||||
@@ -0,0 +1,171 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
decrypt_capture.py - Offline decryption of captured proxy traffic.
|
||||
Reads a proxy_*.jsonl capture file and tries to decrypt with a given key.
|
||||
Useful for testing keys against captured data.
|
||||
|
||||
Usage:
|
||||
python decrypt_capture.py [capture_file] [key_file]
|
||||
Defaults: latest proxy_*.jsonl and captures/chacha_session_key.json
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import json
|
||||
import glob
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from Crypto.Cipher import ChaCha20
|
||||
import paralogue_net_full_pb2 as pb
|
||||
|
||||
CAPTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'captures')
|
||||
|
||||
|
||||
def find_latest_capture():
|
||||
files = glob.glob(os.path.join(CAPTURES_DIR, 'proxy_*.jsonl'))
|
||||
if not files:
|
||||
files = glob.glob(os.path.join(CAPTURES_DIR, 'decproxy_*.jsonl'))
|
||||
if not files:
|
||||
return None
|
||||
return max(files, key=os.path.getmtime)
|
||||
|
||||
|
||||
def load_key(key_file):
|
||||
with open(key_file, 'r') as f:
|
||||
data = json.load(f)
|
||||
if isinstance(data, list):
|
||||
data = data[0]
|
||||
key = bytes.fromhex(data['key_hex'])
|
||||
nonce = bytes.fromhex(data['nonce_hex'])
|
||||
return key, nonce
|
||||
|
||||
|
||||
def try_parse_packet_head(data):
|
||||
"""Try to parse decrypted data as PacketHead."""
|
||||
try:
|
||||
ph = pb.PacketHead()
|
||||
ph.ParseFromString(data)
|
||||
if ph.msg_id > 0 and ph.body_len >= 0:
|
||||
return ph
|
||||
except:
|
||||
pass
|
||||
return None
|
||||
|
||||
|
||||
def try_decrypt_stream(packets, key, nonce):
|
||||
"""Try decrypting a sequence of packets as a continuous stream."""
|
||||
c2s_cipher = ChaCha20.new(key=key, nonce=nonce)
|
||||
s2c_cipher = ChaCha20.new(key=key, nonce=nonce)
|
||||
|
||||
results = []
|
||||
for pkt in packets:
|
||||
direction = pkt['d']
|
||||
raw = bytes.fromhex(pkt['hex'])
|
||||
cipher = c2s_cipher if direction == 'C->S' else s2c_cipher
|
||||
|
||||
dec = cipher.encrypt(raw) # XOR = same for enc/dec
|
||||
ph = try_parse_packet_head(dec)
|
||||
|
||||
result = {
|
||||
'n': pkt['n'],
|
||||
'd': direction,
|
||||
'sz': pkt['sz'],
|
||||
'dec_hex': dec[:64].hex(),
|
||||
}
|
||||
|
||||
if ph and ph.msg_id > 0:
|
||||
result['packet_head'] = {
|
||||
'packet_id': ph.packet_id,
|
||||
'msg_id': ph.msg_id,
|
||||
'flag': ph.flag,
|
||||
'body_len': ph.body_len,
|
||||
'total_pack_count': ph.total_pack_count,
|
||||
'seq_id': ph.seq_id,
|
||||
}
|
||||
# Try to parse body
|
||||
head_size = ph.ByteSize()
|
||||
body = dec[head_size:head_size + ph.body_len]
|
||||
if body:
|
||||
result['body_hex'] = body[:64].hex()
|
||||
result['body_len_actual'] = len(body)
|
||||
|
||||
results.append(result)
|
||||
return results
|
||||
|
||||
|
||||
def main():
|
||||
cap_file = sys.argv[1] if len(sys.argv) > 1 else find_latest_capture()
|
||||
key_file = sys.argv[2] if len(sys.argv) > 2 else os.path.join(
|
||||
CAPTURES_DIR, 'chacha_session_key.json')
|
||||
|
||||
if not cap_file:
|
||||
print('[!] No capture file found')
|
||||
sys.exit(1)
|
||||
if not os.path.exists(key_file):
|
||||
print(f'[!] Key file not found: {key_file}')
|
||||
sys.exit(1)
|
||||
|
||||
print(f'Capture: {cap_file}')
|
||||
print(f'Key: {key_file}')
|
||||
|
||||
key, nonce = load_key(key_file)
|
||||
print(f'Key: {key.hex()}')
|
||||
print(f'Nonce: {nonce.hex()} ({len(nonce)} bytes)')
|
||||
print()
|
||||
|
||||
# Load packets, skip handshake (KEY_A/KEY_B)
|
||||
packets = []
|
||||
with open(cap_file, 'r') as f:
|
||||
for line in f:
|
||||
pkt = json.loads(line.strip())
|
||||
label = pkt.get('label', '')
|
||||
# Skip handshake packets
|
||||
if 'KEY_A' in label or 'KEY_B' in label or 'type_100' in label:
|
||||
print(f' Skip handshake: #{pkt["n"]} {label}')
|
||||
continue
|
||||
packets.append(pkt)
|
||||
|
||||
print(f'\n{len(packets)} encrypted packets to decrypt\n')
|
||||
|
||||
# Try with 12-byte nonce
|
||||
results = try_decrypt_stream(packets, key, nonce)
|
||||
|
||||
# Check if decryption looks valid
|
||||
valid = 0
|
||||
for r in results:
|
||||
if 'packet_head' in r:
|
||||
valid += 1
|
||||
|
||||
print(f'Valid PacketHead parses: {valid}/{len(results)}')
|
||||
print()
|
||||
|
||||
if valid == 0 and len(nonce) == 12:
|
||||
# Try 8-byte nonce
|
||||
print('Trying 8-byte nonce...')
|
||||
results = try_decrypt_stream(packets, key, nonce[:8])
|
||||
valid = sum(1 for r in results if 'packet_head' in r)
|
||||
print(f'Valid with 8B nonce: {valid}/{len(results)}')
|
||||
|
||||
# Print results
|
||||
for r in results[:20]:
|
||||
ph = r.get('packet_head')
|
||||
if ph:
|
||||
print(f' #{r["n"]:04d} {r["d"]} {r["sz"]:5d}B -> '
|
||||
f'msg_id={ph["msg_id"]} pkt={ph["packet_id"]} '
|
||||
f'body={ph["body_len"]}B flag={ph["flag"]}')
|
||||
else:
|
||||
print(f' #{r["n"]:04d} {r["d"]} {r["sz"]:5d}B -> '
|
||||
f'[no valid header] {r["dec_hex"][:32]}...')
|
||||
|
||||
if len(results) > 20:
|
||||
print(f' ... and {len(results)-20} more')
|
||||
|
||||
# Save full results
|
||||
out_file = cap_file.replace('.jsonl', '_decrypted.json')
|
||||
with open(out_file, 'w') as f:
|
||||
json.dump(results, f, indent=2)
|
||||
print(f'\nFull results saved to {out_file}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,104 @@
|
||||
// dispatch_dump.js - walks the game's msg_id -> protobuf-factory hash table
|
||||
// and emits every (msg_id, factory_ptr) pair to Python.
|
||||
//
|
||||
// Reverse-engineered from sub_1449BD0F0 (packet reader). Lookup code:
|
||||
//
|
||||
// v16 = &unk_1498F2D88; // inline fallback slots
|
||||
// if (qword_1498F2D90) v16 = qword_1498F2D90; // or heap index array
|
||||
// idx = v16[msg_id & (dword_1498F2D98 - 1)]; // hash to bucket head
|
||||
// while (idx != -1) {
|
||||
// entry = qword_1498F2D50 + 32 * idx; // 32B per entry
|
||||
// if (*(uint32_t*)entry == msg_id) break; // matched
|
||||
// idx = *(int32_t*)(entry + 24); // chain next
|
||||
// }
|
||||
// factory = *(void**)(entry + 8);
|
||||
// msg = (*(void**)(*factory + 16))(factory, 0); // New()
|
||||
//
|
||||
// Table is populated at app startup; we walk once ~2s after attach.
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
var MOD = 'Paralogue-Win64-Shipping.exe';
|
||||
var mod = Process.getModuleByName(MOD);
|
||||
if (!mod) { send({t:'error', msg:'module not found'}); return; }
|
||||
|
||||
// Image base in IDA = 0x140000000; global addresses shown are absolute.
|
||||
// Subtract that to get module-relative offsets.
|
||||
var OFF = {
|
||||
buckets_ptr: 0x98F2D50, // qword: &entries[0]
|
||||
used_count: 0x98F2D58, // dword
|
||||
empty_marker: 0x98F2D84, // dword
|
||||
index_inline: 0x98F2D88, // dword[]: inline index array (small-map)
|
||||
index_heap: 0x98F2D90, // qword: &heap-index-array (if grown)
|
||||
hash_size: 0x98F2D98, // dword: size of index array (pow2)
|
||||
};
|
||||
|
||||
function dump() {
|
||||
try {
|
||||
var bucketsBase = mod.base.add(OFF.buckets_ptr).readPointer();
|
||||
var used = mod.base.add(OFF.used_count).readU32();
|
||||
var empty = mod.base.add(OFF.empty_marker).readU32();
|
||||
var size = mod.base.add(OFF.hash_size).readU32();
|
||||
var heap = mod.base.add(OFF.index_heap).readPointer();
|
||||
var indexArr = heap.isNull() ? mod.base.add(OFF.index_inline) : heap;
|
||||
|
||||
send({
|
||||
t: 'dispatch_info',
|
||||
module_base: mod.base.toString(),
|
||||
module_size: mod.size,
|
||||
buckets: bucketsBase.toString(),
|
||||
index_arr: indexArr.toString(),
|
||||
used: used, empty_marker: empty, hash_size: size,
|
||||
inline: heap.isNull(),
|
||||
});
|
||||
|
||||
if (size === 0 || size > 0x10000) {
|
||||
send({t:'error', msg:'implausible hash_size=' + size});
|
||||
return;
|
||||
}
|
||||
|
||||
var seen = {};
|
||||
var count = 0;
|
||||
for (var i = 0; i < size; i++) {
|
||||
var idx = indexArr.add(i * 4).readS32();
|
||||
var hops = 0;
|
||||
while (idx !== -1 && !seen[idx] && hops < 10000) {
|
||||
seen[idx] = true;
|
||||
var entry = bucketsBase.add(idx * 32);
|
||||
var mid = entry.readU32();
|
||||
var factory = entry.add(8).readPointer();
|
||||
var nextIdx = entry.add(24).readS32();
|
||||
// Try dereferencing factory->vtbl to confirm it's a real
|
||||
// pointer. If it faults, we misunderstood the layout.
|
||||
var vtbl = null, firstVtblEntry = null, rawEntry = null;
|
||||
try { vtbl = factory.readPointer(); } catch (e) {}
|
||||
try { firstVtblEntry = vtbl ? vtbl.readPointer() : null; }
|
||||
catch (e) {}
|
||||
try { rawEntry = entry.readByteArray(32); } catch (e) {}
|
||||
send({
|
||||
t: 'dispatch_entry',
|
||||
msg_id: mid,
|
||||
factory: factory.toString(),
|
||||
factory_rel_base: factory.sub(mod.base).toString(),
|
||||
vtbl: vtbl ? vtbl.toString() : null,
|
||||
first_vtbl_entry: firstVtblEntry ? firstVtblEntry.toString() : null,
|
||||
slot: idx,
|
||||
bucket: i,
|
||||
}, rawEntry);
|
||||
count++;
|
||||
idx = nextIdx;
|
||||
hops++;
|
||||
}
|
||||
}
|
||||
send({t: 'dispatch_done', total: count});
|
||||
} catch (e) {
|
||||
send({t:'error', msg: 'dispatch walk failed: ' + e.message + '\n' + e.stack});
|
||||
}
|
||||
}
|
||||
|
||||
// Table fills during startup; 2s delay covers dynamic registration.
|
||||
setTimeout(dump, 2000);
|
||||
|
||||
// Also expose a manual re-dump via rpc in case we want to re-check later.
|
||||
rpc.exports = { dump: dump };
|
||||
})();
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"0x148106f48": "VerifyLoginTokenExtS2C",
|
||||
"0x148108f30": "ClothesModifyColorReq",
|
||||
"0x148109078": "CardBagOpenRsp",
|
||||
"0x148109458": "RoleClothesColorUpdateS2C",
|
||||
"0x148109a08": "UeGetRoomReq",
|
||||
"0x14810a610": "RoleListFullS2C",
|
||||
"0x14810a960": "BagItemFullS2C",
|
||||
"0x14810d440": "CommonShopBuyReq",
|
||||
"0x14810e5f0": "ClaimBattlePassRewardRsp",
|
||||
"0x14810ed38": "SetRoleAppearanceReq",
|
||||
"0x14810edc8": "BattlePassFullS2C",
|
||||
"0x148113570": "PlayerLoginReq",
|
||||
"0x1481136a0": "RoleAppearanceUpdateS2C",
|
||||
"0x148113920": "PlayerLoginRsp",
|
||||
"0x148113ed0": "PlayerMainDataRsp",
|
||||
"0x1481141f0": "OrgasmsHResultS2C",
|
||||
"0x148114280": "ClothesEquipReq",
|
||||
"0x148114330": "PlayerTimeOffsetS2C",
|
||||
"0x148114830": "ShopUpdateFullS2C"
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,61 @@
|
||||
// item_table_dump.js - dump every valid item id from the client's
|
||||
// BagItemSubsystem local ItemTable.
|
||||
//
|
||||
// Technique: hook sub_1449639C0 (LookupItemRecordById), grab `rcx` =
|
||||
// subsystem pointer on first natural call during login, then walk its
|
||||
// internal table in-place.
|
||||
//
|
||||
// Layout recovered from IDA:
|
||||
// subsystem + 56..168 -> 7 block descriptors, 16 bytes each:
|
||||
// [0] qword ptr to items[0]
|
||||
// [8] int32 item count
|
||||
// [12] int32 padding
|
||||
// each item record = 120 bytes; first 4 bytes = itemId (uint32).
|
||||
// The table's effective size = sum of counts across the 7 blocks.
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
var MOD = 'Paralogue-Win64-Shipping.exe';
|
||||
var mod = Process.getModuleByName(MOD);
|
||||
if (!mod) { send({t:'error', msg:'module not found'}); return; }
|
||||
|
||||
var LOOKUP = mod.base.add(0x49639C0);
|
||||
var dumped = false;
|
||||
|
||||
function walk(subsystem) {
|
||||
try {
|
||||
var base = subsystem.add(56);
|
||||
var end = subsystem.add(168);
|
||||
var total = 0;
|
||||
var emitted = 0;
|
||||
for (var slot = base; !slot.equals(end); slot = slot.add(16)) {
|
||||
var ptr = slot.readPointer();
|
||||
var count = slot.add(8).readS32();
|
||||
if (ptr.isNull() || count <= 0 || count > 200000) continue;
|
||||
send({t:'item_block', ptr: ptr.toString(), count: count});
|
||||
total += count;
|
||||
for (var i = 0; i < count; i++) {
|
||||
var rec = ptr.add(i * 120);
|
||||
var id = rec.readU32();
|
||||
send({t:'item_id', id: id});
|
||||
emitted++;
|
||||
}
|
||||
}
|
||||
send({t:'item_dump_done', total: total, emitted: emitted});
|
||||
} catch (e) {
|
||||
send({t:'error', msg:'walk failed: '+e.message});
|
||||
}
|
||||
}
|
||||
|
||||
Interceptor.attach(LOOKUP, {
|
||||
onEnter: function (args) {
|
||||
if (dumped) return;
|
||||
dumped = true;
|
||||
var subsystem = this.context.rcx;
|
||||
send({t:'item_subsystem', addr: subsystem.toString()});
|
||||
walk(subsystem);
|
||||
}
|
||||
});
|
||||
|
||||
send({t:'ready', msg:'item_table_dump hook installed at '+LOOKUP.toString()});
|
||||
})();
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"1003": "PlayerLoginReq",
|
||||
"1004": "PlayerLoginRsp",
|
||||
"1006": "PlayerMainDataRsp",
|
||||
"1007": "KickPlayerS2C",
|
||||
"1008": "PlayerTimeOffsetS2C",
|
||||
"1017": "AchievementEntry",
|
||||
"1018": "AchievementEntry",
|
||||
"1031": "UeGetRoomReq",
|
||||
"1032": "RoleDilationUpdateS2C",
|
||||
"1036": "BagItemFullS2C",
|
||||
"1038": "AchievementFullS2C",
|
||||
"1040": "AchievementFullS2C",
|
||||
"1044": "BattlePassInfo",
|
||||
"1080": "BpExpChangeS2C",
|
||||
"1089": "AchievementProgress",
|
||||
"1090": "ClaimBattlePassRewardRsp",
|
||||
"1094": "BattlePassFullS2C",
|
||||
"1105": "AchievementProgress",
|
||||
"1106": "AchievementEntry",
|
||||
"1119": "ClothesEquipReq",
|
||||
"1120": "AchievementEntry",
|
||||
"1139": "ClothesEquipReq",
|
||||
"1140": "AchievementProgress",
|
||||
"1153": "AchievementEntry",
|
||||
"1154": "AchievementEntry",
|
||||
"1159": "CommonShopBuyReq",
|
||||
"1160": "AchievementEntry",
|
||||
"1161": "AchievementEntry",
|
||||
"1162": "ClothesColorCell",
|
||||
"1181": "AddPlayerS2C",
|
||||
"1182": "ShopUpdateFullS2C",
|
||||
"1192": "CardBagOpenReq",
|
||||
"1193": "CardBagOpenRsp",
|
||||
"1194": "AchievementEntry",
|
||||
"1198": "BattlePassInfo",
|
||||
"1200": "ClothesPresetUpdateS2C",
|
||||
"1202": "RoleListFullS2C",
|
||||
"1206": "BattlePassInfo",
|
||||
"1208": "AchievementFullS2C",
|
||||
"1209": "RoleDilationUpdateS2C",
|
||||
"1210": "PlayerBriefInfo",
|
||||
"1215": "CachePlayerData",
|
||||
"1216": "AchievementEntry",
|
||||
"1221": "ClothesPresetUpdateS2C",
|
||||
"1223": "SetRoleAppearanceReq",
|
||||
"1224": "AchievementEntry",
|
||||
"1225": "RoleAppearanceUpdateS2C",
|
||||
"1230": "OrgasmsHResultS2C",
|
||||
"1231": "BpExpChangeS2C",
|
||||
"1234": "AchievementEntry",
|
||||
"1238": "VerifyLoginTokenExtS2C",
|
||||
"1239": "CachePlayerData",
|
||||
"1240": "AchievementEntry",
|
||||
"1243": "CachePlayerData",
|
||||
"1244": "AchievementEntry",
|
||||
"1248": "AchievementFullS2C",
|
||||
"1250": "AchievementStepUpdateS2C",
|
||||
"1253": "ClothesModifyColorReq",
|
||||
"1254": "AchievementEntry",
|
||||
"1255": "RoleClothesColorUpdateS2C",
|
||||
"2500": "AchievementFullS2C"
|
||||
}
|
||||
@@ -0,0 +1,359 @@
|
||||
"""paralogue_decoder.py - shared protocol-decoding primitives.
|
||||
|
||||
This module concentrates the framing, PacketHead parsing, and msg_id ->
|
||||
protobuf-type identification used by both the Frida in-process decoder
|
||||
(run_decoder.py) and the MITM proxy (tcp_proxy_decrypt.py).
|
||||
|
||||
Wire format (confirmed against live plaintext):
|
||||
[2B BE prefix N][N-byte PacketHead protobuf][body_len bytes body]
|
||||
|
||||
`PacketHead.body_len` is body-only (not total).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Optional
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
if SCRIPT_DIR not in sys.path:
|
||||
sys.path.insert(0, SCRIPT_DIR)
|
||||
|
||||
import paralogue_net_full_pb2 as pb_mod # noqa: E402
|
||||
from google.protobuf.message import DecodeError # noqa: E402
|
||||
|
||||
KNOWN_IDS_PATH = os.path.join(SCRIPT_DIR, "known_msg_ids.json")
|
||||
PACKET_HEAD_CLS = pb_mod.PacketHead
|
||||
|
||||
|
||||
def build_catalog():
|
||||
fd = pb_mod.DESCRIPTOR
|
||||
out = []
|
||||
for name, desc in fd.message_types_by_name.items():
|
||||
cls = getattr(pb_mod, name, None)
|
||||
if cls is None:
|
||||
continue
|
||||
out.append((name, desc, cls))
|
||||
return out
|
||||
|
||||
|
||||
CATALOG = build_catalog()
|
||||
|
||||
|
||||
def load_known_ids() -> dict[int, str]:
|
||||
if not os.path.isfile(KNOWN_IDS_PATH):
|
||||
return {}
|
||||
try:
|
||||
with open(KNOWN_IDS_PATH, "r", encoding="utf-8") as f:
|
||||
return {int(k): v for k, v in json.load(f).items()}
|
||||
except Exception:
|
||||
return {}
|
||||
|
||||
|
||||
def save_known_ids(m: dict[int, str]) -> None:
|
||||
try:
|
||||
with open(KNOWN_IDS_PATH, "w", encoding="utf-8") as f:
|
||||
json.dump({str(k): v for k, v in sorted(m.items())}, f, indent=2)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# msg_id identification
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
_TYPE_STRING = 9
|
||||
_NUMERIC_TYPES = {1, 2, 3, 4, 5, 6, 7, 13, 14, 15, 16, 17, 18}
|
||||
_LABEL_REPEATED = 3
|
||||
|
||||
|
||||
def _score_fit(msg, body: bytes) -> int:
|
||||
try:
|
||||
set_fields = msg.ListFields()
|
||||
except Exception:
|
||||
return 0
|
||||
if not set_fields:
|
||||
return 0
|
||||
|
||||
score = len(set_fields) * 2
|
||||
try:
|
||||
rt = msg.SerializeToString()
|
||||
except Exception:
|
||||
rt = b""
|
||||
if rt == body:
|
||||
score += 100
|
||||
elif rt and len(rt) == len(body):
|
||||
score += 20
|
||||
elif rt:
|
||||
score += int(min(len(rt), len(body)) / max(len(rt), len(body)) * 10)
|
||||
|
||||
if rt:
|
||||
missing = max(0, len(body) - len(rt))
|
||||
score -= missing // 4
|
||||
|
||||
for f, v in set_fields:
|
||||
if f.type == _TYPE_STRING:
|
||||
vals = v if f.label == _LABEL_REPEATED else [v]
|
||||
for s in vals:
|
||||
if not isinstance(s, str):
|
||||
continue
|
||||
try:
|
||||
s.encode("utf-8")
|
||||
except Exception:
|
||||
score -= 50
|
||||
continue
|
||||
if s and sum(1 for c in s if c.isprintable()) / len(s) >= 0.8:
|
||||
score += 5
|
||||
elif s and sum(1 for c in s if c.isprintable()) / len(s) < 0.5:
|
||||
score -= 10
|
||||
|
||||
if (f.label == _LABEL_REPEATED
|
||||
and f.type in _NUMERIC_TYPES
|
||||
and isinstance(v, (list, tuple)) and v):
|
||||
try:
|
||||
ints = [int(x) for x in v]
|
||||
except Exception:
|
||||
ints = []
|
||||
if ints and all(32 <= x <= 126 for x in ints) and len(ints) >= 3:
|
||||
score -= 40
|
||||
|
||||
return score
|
||||
|
||||
|
||||
def identify_body(body: bytes, preferred_name: Optional[str] = None):
|
||||
"""Return (name, parsed, score, candidates, top3)."""
|
||||
if not body:
|
||||
return None, None, 0, 0, []
|
||||
|
||||
scored = []
|
||||
for name, _desc, cls in CATALOG:
|
||||
try:
|
||||
m = cls()
|
||||
m.MergeFromString(body)
|
||||
except (DecodeError, ValueError, Exception):
|
||||
continue
|
||||
s = _score_fit(m, body)
|
||||
if s > 0:
|
||||
scored.append((s, name, m))
|
||||
if not scored:
|
||||
return None, None, 0, 0, []
|
||||
|
||||
scored.sort(key=lambda t: (-t[0], 0 if t[1] == preferred_name else 1, t[1]))
|
||||
if preferred_name:
|
||||
for s, n, m in scored:
|
||||
if n == preferred_name:
|
||||
top = [(nn, ss) for ss, nn, _ in scored[:3]]
|
||||
return n, m, s, len(scored), top
|
||||
|
||||
best_score, best_name, best_msg = scored[0]
|
||||
top = [(nn, ss) for ss, nn, _ in scored[:3]]
|
||||
return best_name, best_msg, best_score, len(scored), top
|
||||
|
||||
|
||||
def _has_packed_ascii_string(msg) -> bool:
|
||||
"""True if a repeated-numeric field contains a run of printable
|
||||
ASCII bytes long enough to look like a string. Misidentified string
|
||||
fields decode as `repeated int32` where the varints are the UTF-8
|
||||
byte values, preceded by tag+length bytes (often small non-printable
|
||||
numbers like 10, 7). We scan for any consecutive run of >= 5
|
||||
printable ASCII values anywhere in the list.
|
||||
|
||||
Note: protobuf-python returns `RepeatedScalarFieldContainer` for
|
||||
repeated fields; it's iterable and supports len() but is NOT a list
|
||||
or tuple, so don't use isinstance for the type check.
|
||||
"""
|
||||
try:
|
||||
for f, v in msg.ListFields():
|
||||
if f.label != _LABEL_REPEATED or f.type not in _NUMERIC_TYPES:
|
||||
continue
|
||||
try:
|
||||
n = len(v)
|
||||
except TypeError:
|
||||
continue
|
||||
if n < 5:
|
||||
continue
|
||||
try:
|
||||
ints = [int(x) for x in v]
|
||||
except Exception:
|
||||
continue
|
||||
run = 0
|
||||
for x in ints:
|
||||
if 32 <= x <= 126:
|
||||
run += 1
|
||||
if run >= 5:
|
||||
return True
|
||||
else:
|
||||
run = 0
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
def identify_body_strict(body: bytes):
|
||||
"""Strict identification: return list of candidate type names whose
|
||||
protobuf parse consumes the entire body with zero unknown fields.
|
||||
|
||||
A type T is strict-valid for body B if:
|
||||
* T().MergeFromString(B) succeeds, AND
|
||||
* SerializeToString() before DiscardUnknownFields equals after.
|
||||
|
||||
Empty bodies return []. Types that parse but leave unknown fields
|
||||
are excluded: they "absorbed" bytes they can't structurally account
|
||||
for, which means they're the wrong type.
|
||||
"""
|
||||
if not body:
|
||||
return []
|
||||
out = []
|
||||
for name, _desc, cls in CATALOG:
|
||||
try:
|
||||
m = cls()
|
||||
m.MergeFromString(body)
|
||||
except (DecodeError, ValueError, Exception):
|
||||
continue
|
||||
try:
|
||||
before = m.SerializeToString()
|
||||
m.DiscardUnknownFields()
|
||||
after = m.SerializeToString()
|
||||
except Exception:
|
||||
continue
|
||||
if before != after:
|
||||
continue # had unknown fields -> wrong type
|
||||
if _has_packed_ascii_string(m):
|
||||
continue # misread string as packed-int repeated -> wrong type
|
||||
# Demand the serialized form is byte-identical to the input.
|
||||
# Protobuf fields are unordered on the wire but generated code
|
||||
# emits in a stable order; for the correct type, MergeFromString
|
||||
# + SerializeToString round-trips to the canonical form of the
|
||||
# same content. We accept equal-LENGTH as a weaker match because
|
||||
# the server may have emitted fields in a different order.
|
||||
if before == body or len(before) == len(body):
|
||||
out.append((name, m, before == body))
|
||||
return out
|
||||
|
||||
|
||||
def msg_to_dict(msg) -> dict:
|
||||
from google.protobuf import json_format
|
||||
try:
|
||||
return json_format.MessageToDict(
|
||||
msg,
|
||||
preserving_proto_field_name=True,
|
||||
including_default_value_fields=False,
|
||||
)
|
||||
except Exception:
|
||||
out = {}
|
||||
for f, v in msg.ListFields():
|
||||
out[f.name] = v.hex() if isinstance(v, bytes) else repr(v)
|
||||
return out
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# stream reassembly
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@dataclass
|
||||
class Stream:
|
||||
"""One reassembled byte stream."""
|
||||
label: str # e.g. "C->S" or "S->C"
|
||||
chunks: dict = field(default_factory=dict)
|
||||
consumed: int = 0
|
||||
frontier: int = 0
|
||||
_cache_bytes: bytearray = field(default_factory=bytearray)
|
||||
|
||||
def add(self, off: int, data: bytes) -> None:
|
||||
if not self.chunks:
|
||||
self.consumed = off
|
||||
self.frontier = off
|
||||
end = off + len(data)
|
||||
if end > len(self._cache_bytes):
|
||||
self._cache_bytes.extend(b"\x00" * (end - len(self._cache_bytes)))
|
||||
self._cache_bytes[off:end] = data
|
||||
self.chunks[off] = len(data)
|
||||
f = self.frontier
|
||||
while True:
|
||||
advanced = False
|
||||
for co, cl in self.chunks.items():
|
||||
if co <= f < co + cl:
|
||||
f = co + cl
|
||||
advanced = True
|
||||
break
|
||||
if not advanced:
|
||||
break
|
||||
self.frontier = f
|
||||
|
||||
def available(self) -> int:
|
||||
return self.frontier - self.consumed
|
||||
|
||||
def peek(self, n: int) -> bytes:
|
||||
return bytes(self._cache_bytes[self.consumed:self.consumed + n])
|
||||
|
||||
def consume(self, n: int) -> bytes:
|
||||
out = bytes(self._cache_bytes[self.consumed:self.consumed + n])
|
||||
self.consumed += n
|
||||
return out
|
||||
|
||||
|
||||
def drain_stream(stream: Stream):
|
||||
"""Yield (head, body, skipped) for each complete message.
|
||||
|
||||
`head` is a parsed PacketHead, `body` is bytes, `skipped` is the number
|
||||
of junk bytes the framing recovered from before this packet (usually 0).
|
||||
"""
|
||||
while True:
|
||||
avail = stream.available()
|
||||
if avail < 2:
|
||||
return
|
||||
prefix = stream.peek(2)
|
||||
hlen = (prefix[0] << 8) | prefix[1]
|
||||
if hlen == 0 or hlen > 32:
|
||||
stream.consume(1)
|
||||
continue
|
||||
if avail < 2 + hlen:
|
||||
return
|
||||
head_bytes = bytes(
|
||||
stream._cache_bytes[stream.consumed + 2:
|
||||
stream.consumed + 2 + hlen]
|
||||
)
|
||||
head = PACKET_HEAD_CLS()
|
||||
try:
|
||||
head.MergeFromString(head_bytes)
|
||||
except DecodeError:
|
||||
stream.consume(1)
|
||||
continue
|
||||
try:
|
||||
rt = head.SerializeToString()
|
||||
except Exception:
|
||||
stream.consume(1)
|
||||
continue
|
||||
if len(rt) != hlen:
|
||||
stream.consume(1)
|
||||
continue
|
||||
mid = int(head.msg_id)
|
||||
blen = int(head.body_len)
|
||||
if mid <= 0 or mid > 100000 or blen < 0 or blen > (1 << 20):
|
||||
stream.consume(1)
|
||||
continue
|
||||
if avail < 2 + hlen + blen:
|
||||
return
|
||||
|
||||
stream.consume(2 + hlen)
|
||||
body = stream.consume(blen)
|
||||
yield head, body, 0
|
||||
|
||||
|
||||
def short_repr(d) -> str:
|
||||
if isinstance(d, dict):
|
||||
parts = []
|
||||
for k, v in list(d.items())[:4]:
|
||||
if isinstance(v, (dict, list)):
|
||||
parts.append(f"{k}=<{type(v).__name__}>")
|
||||
else:
|
||||
s = str(v)
|
||||
if len(s) > 40:
|
||||
s = s[:37] + "..."
|
||||
parts.append(f"{k}={s}")
|
||||
extra = "" if len(d) <= 4 else f" (+{len(d)-4} more)"
|
||||
return "{" + ", ".join(parts) + "}" + extra
|
||||
return str(d)
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,470 @@
|
||||
syntax = "proto3";
|
||||
package ParalogueNet;
|
||||
|
||||
enum MsgType {
|
||||
MsgType_NONE = 0;
|
||||
MsgType_KEY_A = 1;
|
||||
MsgType_KEY_B = 2;
|
||||
MsgType_PROTO_CONTROL = 3;
|
||||
MsgType_SYNC = 4;
|
||||
}
|
||||
|
||||
enum MsgRoute {
|
||||
MsgRoute_GAME = 0;
|
||||
MsgRoute_ROOM = 1;
|
||||
}
|
||||
|
||||
enum StatusCode {
|
||||
StatusCode_NONE = 0;
|
||||
StatusCode_OK = 1;
|
||||
StatusCode_FAIL = 2;
|
||||
StatusCode_BAD_REQ = 3;
|
||||
StatusCode_SYS_ERR = 4;
|
||||
StatusCode_ACCOUNT_UNAUTH = 5;
|
||||
StatusCode_ILLEGAL_LEN = 6;
|
||||
StatusCode_ILLEGAL_CHAR = 7;
|
||||
StatusCode_BAD_WORD = 8;
|
||||
StatusCode_DUPLICATED_NAME = 9;
|
||||
StatusCode_SERVER_IS_FULL = 10;
|
||||
StatusCode_PLAYER_NOT_FOUND = 11;
|
||||
StatusCode_CFG_NOT_FOUND = 12;
|
||||
StatusCode_ITEM_NOT_ENOUGH = 13;
|
||||
StatusCode_ACCOUNT_BANNED = 14;
|
||||
StatusCode_REGISTER_LIMIT = 15;
|
||||
StatusCode_PLAYER_NOT_IN_CHANNEL_WAIT = 16;
|
||||
StatusCode_PLAYER_NOT_IN_CHANNEL = 17;
|
||||
StatusCode_QUICK_CHECK_FAIL = 20;
|
||||
StatusCode_INVALID_TOKEN = 21;
|
||||
StatusCode_ACCOUNT_NAME_NOT_BIND = 22;
|
||||
StatusCode_ACCOUNT_NAME_REPEAT_BIND = 23;
|
||||
StatusCode_ACCOUNT_NAME_BIND_FAIL = 24;
|
||||
StatusCode_IGNORE = 25;
|
||||
StatusCode_MODULE_CLOSE = 30;
|
||||
StatusCode_CLIENT_VERSION_ERR = 31;
|
||||
StatusCode_REPEAT_REWARD = 32;
|
||||
StatusCode_GIVE_LIKE_WEEK_LIMIT = 33;
|
||||
StatusCode_SERVERUNDERMAINTENANCE = 205;
|
||||
StatusCode_MUTED_PLAYER_CHAT_FAIL = 210;
|
||||
StatusCode_FRIEND_SEARCH_FAIL = 211;
|
||||
StatusCode_FRIEND_ADD_FAIL = 212;
|
||||
StatusCode_PLAYER_LEVEL_LIMIT = 220;
|
||||
StatusCode_MAIL_NO_REWARD = 421;
|
||||
StatusCode_MAIL_NOT_EXIST = 422;
|
||||
StatusCode_MAIL_COLLECT_NUM_LIMIT = 423;
|
||||
StatusCode_CharNotExist = 430;
|
||||
StatusCode_NotMatchRoom = 431;
|
||||
StatusCode_CREATE_ORDER_SPEED_ERROR = 1490;
|
||||
StatusCode_ALREADY_SIGNIN = 1491;
|
||||
StatusCode_NAME_SENSITIVE = 1492;
|
||||
StatusCode_GET_REWARD_NOT_CONDITION = 1493;
|
||||
}
|
||||
|
||||
enum AccountType {
|
||||
AccountType_NONE = 0;
|
||||
AccountType_STEAM = 3;
|
||||
AccountType_PROBE = 4;
|
||||
}
|
||||
|
||||
enum AccountOSType {
|
||||
Windows = 0;
|
||||
Android = 1;
|
||||
}
|
||||
|
||||
enum PlayerOfflineReason {
|
||||
PlayerOfflineReason_NONE = 0;
|
||||
PlayerOfflineReason_DISCONNECT = 1000001;
|
||||
PlayerOfflineReason_SERVER_SHUTDOWN = 1000002;
|
||||
PlayerOfflineReason_KICK = 1000003;
|
||||
PlayerOfflineReason_ANOTHER_LOGIN = 1000004;
|
||||
PlayerOfflineReason_ANTI_ADDICTION = 1000005;
|
||||
PlayerOfflineReason_LOGOUT = 1000006;
|
||||
PlayerOfflineReason_ACCOUNT_CANCEL_BIND = 1000007;
|
||||
PlayerOfflineReason_MSG_RATE_LIMIT = 1000008;
|
||||
PlayerOfflineReason_RECONNECT_LOGIN = 1000009;
|
||||
}
|
||||
|
||||
enum OperateTargetType {
|
||||
OperateTargetType_NONE = 0;
|
||||
OperateTargetType_GLOBAL = 1;
|
||||
OperateTargetType_PLAYER = 2;
|
||||
OperateTargetType_SYSTEM = 3;
|
||||
}
|
||||
|
||||
enum OperateCmdType {
|
||||
OperateCmdType_NONE = 0;
|
||||
OperateCmdType_GM_CODE = 1;
|
||||
OperateCmdType_ACTION = 4;
|
||||
}
|
||||
|
||||
enum MailState {
|
||||
MailState_UNREAD = 0;
|
||||
MailState_READED = 1;
|
||||
MailState_UNCLAIM = 2;
|
||||
MailState_CLAIMED = 3;
|
||||
}
|
||||
|
||||
enum MailType {
|
||||
MailType_NONE = 0;
|
||||
MailType_GLOBAL = 1;
|
||||
MailType_PLAYER = 2;
|
||||
}
|
||||
|
||||
enum MailContentType {
|
||||
MailContentType_NONE = 0;
|
||||
MailContentType_TEXT = 1;
|
||||
MailContentType_TEXT_ID = 2;
|
||||
}
|
||||
|
||||
message CachePlayerData {
|
||||
string curr_role_name = 1;
|
||||
uint32 today_favor = 3;
|
||||
repeated CacheRoleData roles = 15;
|
||||
}
|
||||
|
||||
message CacheRoleData {
|
||||
uint32 cur_stamina = 2;
|
||||
uint32 vaginal_dilation_exp = 6;
|
||||
uint32 vaginal_dilation_lv = 7;
|
||||
uint32 anal_dilation_exp = 8;
|
||||
uint32 anal_dilation_lv = 9;
|
||||
int64 vaginal_dilation_last_calc_at = 10;
|
||||
int64 anal_dilation_last_calc_at = 11;
|
||||
bool is_h_card = 13;
|
||||
map<uint32, uint32> attrs = 20;
|
||||
}
|
||||
|
||||
message PacketHead {
|
||||
uint32 packet_id = 1;
|
||||
uint32 msg_id = 2;
|
||||
uint32 flag = 3;
|
||||
uint32 body_len = 4;
|
||||
uint32 total_pack_count = 5;
|
||||
uint32 seq_id = 6;
|
||||
}
|
||||
|
||||
message GenericParam {
|
||||
repeated int32 int32s = 1;
|
||||
repeated uint32 uint32s = 2;
|
||||
repeated int64 int64s = 3;
|
||||
repeated uint64 uint64s = 4;
|
||||
repeated string strings = 5;
|
||||
repeated float floats = 6;
|
||||
repeated double doubles = 7;
|
||||
}
|
||||
|
||||
message ClientInfo {
|
||||
string lang = 1;
|
||||
string client_version = 2;
|
||||
string resource_version = 3;
|
||||
string device_uuid = 4;
|
||||
string device_model = 5;
|
||||
string analysis_distinct_id = 6;
|
||||
string network = 7;
|
||||
string ip = 8;
|
||||
string ipv6 = 9;
|
||||
string os_name = 10;
|
||||
string os_ver = 11;
|
||||
}
|
||||
|
||||
message OperateCmdData {
|
||||
string trace_id = 1;
|
||||
OperateCmdType cmd_type = 2;
|
||||
string gm_code = 3;
|
||||
bytes data = 6;
|
||||
}
|
||||
|
||||
message MailAttachment {
|
||||
repeated BaseItem items = 2;
|
||||
}
|
||||
|
||||
message MailData {
|
||||
uint32 mail_id = 1;
|
||||
MailState state = 2;
|
||||
MailType mail_type = 3;
|
||||
map<string, string> sender = 4;
|
||||
MailContentType content_type = 5;
|
||||
uint32 sys_id = 6;
|
||||
map<string, string> title = 7;
|
||||
map<string, string> content = 8;
|
||||
repeated string content_params = 9;
|
||||
MailAttachment attachment = 10;
|
||||
int64 send_time = 11;
|
||||
int64 expire_time = 12;
|
||||
uint32 keep_days = 13;
|
||||
int64 start_time = 14;
|
||||
int64 end_time = 15;
|
||||
uint32 condition_create_time = 16;
|
||||
repeated uint32 target_ids = 18;
|
||||
bool patreon_item = 19;
|
||||
repeated string target_steam_ids = 20;
|
||||
string mail_tag = 21;
|
||||
string traceId = 22;
|
||||
}
|
||||
|
||||
message BaseItem {
|
||||
uint32 itemId = 1;
|
||||
int64 num = 2;
|
||||
}
|
||||
|
||||
message PayDeliverData {
|
||||
uint32 seq = 1;
|
||||
string orderId = 2;
|
||||
string sourceOrderId = 3;
|
||||
uint32 amount = 4;
|
||||
string goods_id = 5;
|
||||
string pay_time = 6;
|
||||
uint32 source = 7;
|
||||
uint32 create_time = 8;
|
||||
string pay_type = 9;
|
||||
string currency_type = 10;
|
||||
}
|
||||
|
||||
message PlayerBriefInfo {
|
||||
uint32 player_id = 1;
|
||||
string nick_name = 2;
|
||||
uint32 level = 3;
|
||||
int64 last_login_time = 5;
|
||||
bool is_online = 9;
|
||||
uint32 create_time = 13;
|
||||
}
|
||||
|
||||
message PlayerWelfareInfo {
|
||||
bool day_sign_in = 2;
|
||||
}
|
||||
|
||||
message BattlePassInfo {
|
||||
uint32 id = 1;
|
||||
uint32 lv = 2;
|
||||
uint32 exp = 3;
|
||||
map<uint32, int64> claimLv = 4;
|
||||
map<uint32, int64> premium_claim_lv = 5;
|
||||
int64 buy_premium_time = 7;
|
||||
bool premium = 8;
|
||||
}
|
||||
|
||||
message BattlePassList {
|
||||
uint32 defaultBpId = 3;
|
||||
repeated BattlePassInfo battlePassInfos = 10;
|
||||
}
|
||||
|
||||
message Color {
|
||||
float r = 1;
|
||||
float g = 2;
|
||||
float b = 3;
|
||||
float a = 4;
|
||||
}
|
||||
|
||||
message FemaleAppearance {
|
||||
map<uint32, float> float_config = 1;
|
||||
map<uint32, bool> bool_config = 2;
|
||||
map<uint32, Color> color_config = 3;
|
||||
map<int32, float> socks_custom = 4;
|
||||
}
|
||||
|
||||
message RoleCell {
|
||||
string name = 1;
|
||||
uint32 cur_stamina = 2;
|
||||
uint32 favor_exp = 4;
|
||||
uint32 favor_lv = 5;
|
||||
uint32 vaginal_dilation_exp = 6;
|
||||
uint32 vaginal_dilation_lv = 7;
|
||||
uint32 anal_dilation_exp = 8;
|
||||
uint32 anal_dilation_lv = 9;
|
||||
bool is_unlock = 10;
|
||||
int64 vaginal_dilation_last_calc_at = 11;
|
||||
int64 anal_dilation_last_calc_at = 12;
|
||||
bool is_h_card = 13;
|
||||
map<uint32, uint32> attrs = 20;
|
||||
repeated ClothesCell worn_clothes = 21;
|
||||
repeated ClothesPreset preset_clothes = 22;
|
||||
FemaleAppearance appearance = 23;
|
||||
ClothesColors clothes_colors = 24;
|
||||
int64 last_stamina_recovered_at = 30;
|
||||
}
|
||||
|
||||
message ClothesCell {
|
||||
uint32 id = 1;
|
||||
ClothesType type = 2;
|
||||
uint32 stat = 3;
|
||||
}
|
||||
|
||||
message ClothesColorCell {
|
||||
ClothesType type = 1;
|
||||
repeated uint32 index = 2;
|
||||
repeated Color color = 3;
|
||||
repeated float roughness = 4;
|
||||
}
|
||||
|
||||
message ClothesColors {
|
||||
repeated ClothesColorCell colors = 1;
|
||||
bool apply_color_to_all = 2;
|
||||
bool apply_glossiness_to_all = 3;
|
||||
bool custom_cloth_color = 4;
|
||||
}
|
||||
|
||||
message PlayerRoles {
|
||||
string curr_role_name = 1;
|
||||
uint32 today_favor = 3;
|
||||
uint32 week_ext_like_exp = 4;
|
||||
string curr_action_role_name = 5;
|
||||
uint32 today_dance = 6;
|
||||
repeated string today_role_skill_use = 9;
|
||||
uint32 week_cloth_dessert = 10;
|
||||
bool is_preset_fixed = 11;
|
||||
repeated RoleCell roles = 15;
|
||||
}
|
||||
|
||||
message ClothesPreset {
|
||||
uint32 index = 1;
|
||||
repeated ClothesCell worn_clothes = 2;
|
||||
FemaleAppearance appearance = 3;
|
||||
ClothesColors clothes_colors = 4;
|
||||
}
|
||||
|
||||
message OneCustomSuitItems {
|
||||
repeated uint32 suits = 1;
|
||||
repeated uint32 cloth_stat = 2;
|
||||
}
|
||||
|
||||
message CardInventoryInfo {
|
||||
map<uint32, BorrowedCardInfo> borrowed_cards = 3;
|
||||
}
|
||||
|
||||
message BorrowedCardInfo {
|
||||
uint32 card_id = 1;
|
||||
uint32 card_owner_id = 2;
|
||||
int64 out_time = 3;
|
||||
}
|
||||
|
||||
message PlayerBagInfo {
|
||||
map<uint32, BaseItem> items = 1;
|
||||
repeated uint32 unreaded_items = 2;
|
||||
repeated uint32 clothes_converted_ids = 14;
|
||||
map<uint32, uint32> pack_guarantee_cnt = 15;
|
||||
map<uint32, uint32> total_guarantee = 16;
|
||||
}
|
||||
|
||||
message NoConfirmUnComposeCard {
|
||||
repeated uint32 card_ids = 1;
|
||||
}
|
||||
|
||||
message NewbieCardInfo {
|
||||
bool is_newbie_card = 1;
|
||||
map<uint32, uint32> open_packs = 2;
|
||||
repeated uint32 card_records = 3;
|
||||
}
|
||||
|
||||
message TaskCell {
|
||||
uint32 task_id = 1;
|
||||
uint32 show_index = 3;
|
||||
uint32 curr_step = 5;
|
||||
string notes = 8;
|
||||
bool is_reward = 10;
|
||||
string target_role_name = 12;
|
||||
}
|
||||
|
||||
message PlayerTaskList {
|
||||
repeated TaskCell taskList = 1;
|
||||
repeated uint32 history_task = 2;
|
||||
uint32 re_roll_count = 3;
|
||||
int64 last_refresh_time = 4;
|
||||
}
|
||||
|
||||
message PlayerShop {
|
||||
repeated CommonShopItem parts_shop = 1;
|
||||
repeated uint32 read_shops = 10;
|
||||
repeated uint32 outfit_shop_read_items = 11;
|
||||
repeated CostPrice parts_shop_refresh_cost = 12;
|
||||
repeated CostPrice like_shop_refresh_cost = 13;
|
||||
uint32 likes_shop_refresh_count = 16;
|
||||
repeated uint32 not_interesting_items = 17;
|
||||
repeated PlayerShopBuyList shop_buy_lists = 18;
|
||||
}
|
||||
|
||||
message CostPrice {
|
||||
uint32 item_id = 1;
|
||||
uint32 price = 2;
|
||||
uint32 discount = 3;
|
||||
uint32 discounted_price = 4;
|
||||
}
|
||||
|
||||
message CommonShopItem {
|
||||
uint32 goods_id = 1;
|
||||
uint32 item_id = 2;
|
||||
uint32 item_count = 3;
|
||||
uint32 purchasable_count = 5;
|
||||
repeated CostPrice cost_prices = 6;
|
||||
uint32 first_count = 7;
|
||||
}
|
||||
|
||||
message PlayerShopBuyList {
|
||||
uint32 shop = 1;
|
||||
map<uint32, PlayerShopBuyInfo> buy_infos = 2;
|
||||
}
|
||||
|
||||
message PlayerShopBuyInfo {
|
||||
uint32 goods_id = 1;
|
||||
uint32 purchased_count = 4;
|
||||
}
|
||||
|
||||
message CharacterShoot {
|
||||
uint32 player_id = 1;
|
||||
bool isAfk = 2;
|
||||
bool is_man = 3;
|
||||
uint32 card_id = 4;
|
||||
OrgasmsType orgasms_type = 6;
|
||||
uint32 added_tokenCount = 11;
|
||||
uint32 added_process = 12;
|
||||
uint32 added_likeCount = 13;
|
||||
uint32 today_afk_usedTime = 14;
|
||||
bool erika_skill_is_triggered = 15;
|
||||
}
|
||||
|
||||
message RolePropertyChange {
|
||||
string role_name = 1;
|
||||
map<uint32, uint32> attrs = 2;
|
||||
uint32 add_favor_exp = 3;
|
||||
uint32 sub_stamina = 4;
|
||||
}
|
||||
|
||||
message TaskEntry {
|
||||
uint32 task_id = 1;
|
||||
uint32 current_progress = 2;
|
||||
string target_role_name = 3;
|
||||
string notes = 4;
|
||||
}
|
||||
|
||||
message TaskUpdateEntry {
|
||||
uint32 task_id = 1;
|
||||
uint32 progress = 2;
|
||||
string notes = 3;
|
||||
}
|
||||
|
||||
message GmRewardInfo {
|
||||
uint32 total_count = 1;
|
||||
uint32 guarantee_count = 2;
|
||||
bool is_guarantee_triggered = 3;
|
||||
map<string, uint32> rank_distribution = 4;
|
||||
uint32 player_id = 5;
|
||||
string player_name = 6;
|
||||
uint32 bag_id = 7;
|
||||
uint32 pool_id = 8;
|
||||
int32 rank = 9;
|
||||
map<uint32, int32> item_count = 10;
|
||||
}
|
||||
|
||||
message AchievementEntry {
|
||||
uint32 achievement_id = 1;
|
||||
repeated uint32 rewardIds = 3;
|
||||
}
|
||||
|
||||
message AchievementProgress {
|
||||
AchievementRewardType type = 1;
|
||||
uint32 progress = 2;
|
||||
}
|
||||
|
||||
message PlayerAchievement {
|
||||
repeated AchievementProgress progress = 1;
|
||||
repeated AchievementEntry achievements = 2;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,720 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# NO CHECKED-IN PROTOBUF GENCODE
|
||||
# source: paralogue_net_full.proto
|
||||
# Protobuf Python Version: 6.31.1
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import runtime_version as _runtime_version
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
from google.protobuf.internal import builder as _builder
|
||||
_runtime_version.ValidateProtobufRuntimeVersion(
|
||||
_runtime_version.Domain.PUBLIC,
|
||||
6,
|
||||
31,
|
||||
1,
|
||||
'',
|
||||
'paralogue_net_full.proto'
|
||||
)
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18paralogue_net_full.proto\x12\x0cParalogueNet\"=\n\x10\x41\x63hievementEntry\x12\x16\n\x0e\x61\x63hievement_id\x18\x01 \x01(\r\x12\x11\n\trewardIds\x18\x03 \x03(\r\"u\n\x12\x41\x63hievementFullS2C\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\x12\x35\n\x0c\x61\x63hievements\x18\x02 \x01(\x0b\x32\x1f.ParalogueNet.PlayerAchievement\"Z\n\x13\x41\x63hievementProgress\x12\x31\n\x04type\x18\x01 \x01(\x0e\x32#.ParalogueNet.AchievementRewardType\x12\x10\n\x08progress\x18\x02 \x01(\r\"y\n\x18\x41\x63hievementStepUpdateS2C\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\x12\x33\n\x08progress\x18\x02 \x01(\x0b\x32!.ParalogueNet.AchievementProgress\"\xc1\x01\n\x0c\x41\x64\x64PlayerS2C\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\x12\x11\n\tplayer_id\x18\x02 \x01(\r\x12@\n\x0brecognition\x18\x03 \x03(\x0b\x32+.ParalogueNet.AddPlayerS2C.RecognitionEntry\x1a\x32\n\x10RecognitionEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"V\n\x0e\x41\x64\x64TaskStepC2S\x12\x11\n\tplayer_id\x18\x01 \x01(\r\x12\x31\n\ntask_steps\x18\x02 \x03(\x0b\x32\x1d.ParalogueNet.TaskUpdateEntry\"\x11\n\x0f\x41ncheatFoundReq\";\n\x0f\x41ncheatFoundRsp\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\"\x84\x03\n\x0e\x42\x61gItemFullS2C\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\x12%\n\x05items\x18\x02 \x03(\x0b\x32\x16.ParalogueNet.BaseItem\x12\x16\n\x0eunread_item_id\x18\x03 \x03(\r\x12N\n\x12pack_guarantee_cnt\x18\x04 \x03(\x0b\x32\x32.ParalogueNet.BagItemFullS2C.PackGuaranteeCntEntry\x12I\n\x0ftotal_guarantee\x18\x05 \x03(\x0b\x32\x30.ParalogueNet.BagItemFullS2C.TotalGuaranteeEntry\x1a\x37\n\x15PackGuaranteeCntEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a\x35\n\x13TotalGuaranteeEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\"c\n\x10\x42\x61gItemUpdateS2C\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\x12%\n\x05items\x18\x02 \x03(\x0b\x32\x16.ParalogueNet.BaseItem\"\'\n\x08\x42\x61seItem\x12\x0e\n\x06itemId\x18\x01 \x01(\r\x12\x0b\n\x03num\x18\x02 \x01(\x03\"\x85\x01\n\x11\x42\x61ttlePassFullS2C\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\x12\x13\n\x0b\x64\x65\x66\x61ultBpId\x18\x02 \x01(\r\x12\x31\n\x0b\x62\x61ttle_pass\x18\x03 \x03(\x0b\x32\x1c.ParalogueNet.BattlePassInfo\"\xcf\x02\n\x0e\x42\x61ttlePassInfo\x12\n\n\x02id\x18\x01 \x01(\r\x12\n\n\x02lv\x18\x02 \x01(\r\x12\x0b\n\x03\x65xp\x18\x03 \x01(\r\x12:\n\x07\x63laimLv\x18\x04 \x03(\x0b\x32).ParalogueNet.BattlePassInfo.ClaimLvEntry\x12J\n\x10premium_claim_lv\x18\x05 \x03(\x0b\x32\x30.ParalogueNet.BattlePassInfo.PremiumClaimLvEntry\x12\x18\n\x10\x62uy_premium_time\x18\x07 \x01(\x03\x12\x0f\n\x07premium\x18\x08 \x01(\x08\x1a.\n\x0c\x43laimLvEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x35\n\x13PremiumClaimLvEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"\\\n\x0e\x42\x61ttlePassList\x12\x13\n\x0b\x64\x65\x66\x61ultBpId\x18\x03 \x01(\r\x12\x35\n\x0f\x62\x61ttlePassInfos\x18\n \x03(\x0b\x32\x1c.ParalogueNet.BattlePassInfo\"L\n\x10\x42orrowedCardInfo\x12\x0f\n\x07\x63\x61rd_id\x18\x01 \x01(\r\x12\x15\n\rcard_owner_id\x18\x02 \x01(\r\x12\x10\n\x08out_time\x18\x03 \x01(\x03\"a\n\x0e\x42pExpChangeS2C\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\x12\x0c\n\x04\x62pId\x18\x02 \x01(\r\x12\x0b\n\x03\x65xp\x18\x03 \x01(\r\x12\n\n\x02lv\x18\x04 \x01(\r\",\n\x12\x42uyBattlePassLvReq\x12\n\n\x02id\x18\x01 \x01(\r\x12\n\n\x02lv\x18\x02 \x01(\r\">\n\x12\x42uyBattlePassLvRsp\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\"\x1e\n\x10\x42uyBattlePassReq\x12\n\n\x02id\x18\x01 \x01(\r\"<\n\x10\x42uyBattlePassRsp\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.ParalogueNet.StatusCode\"j\n\x0f\x43\x61\x63hePlayerData\x12\x16\n\x0e\x63urr_role_name\x18\x01 \x01(\t\x12\x13\n\x0btoday_favor\x18\x03 \x01(\r\x12*\n\x05roles\x18\x0f \x03(\x0b\x32\x1b.ParalogueNet.CacheRoleData\"\xd7\x02\n\rCacheRoleData\x12\x13\n\x0b\x63ur_stamina\x18\x02 \x01(\r\x12\x1c\n\x14vaginal_dilation_exp\x18\x06 \x01(\r\x12\x1b\n\x13vaginal_dilation_lv\x18\x07 \x01(\r\x12\x19\n\x11\x61nal_dilation_exp\x18\x08 \x01(\r\x12\x18\n\x10\x61nal_dilation_lv\x18\t \x01(\r\x12%\n\x1dvaginal_dilation_last_calc_at\x18\n \x01(\x03\x12\"\n\x1a\x61nal_dilation_last_calc_at\x18\x0b \x01(\x03\x12\x11\n\tis_h_card\x18\r \x01(\x08\x12\x35\n\x05\x61ttrs\x18\x14 \x03(\x0b\x32&.ParalogueNet.CacheRoleData.AttrsEntry\x1a,\n\nAttrsEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\"!\n\x0e\x43\x61rdBagOpenReq\x12\x0f\n\x07\x62\x61g_ids\x18\x01 \x03(\r\"\x8f\x02\n\x11\x43\x61rdBagOpenResult\x12\x0f\n\x07\x63\x61rd_id\x18\x01 \x01(\r\x12\x42\n\nrole_favor\x18\x02 \x03(\x0b\x32..ParalogueNet.CardLine truncated
|
||||
|
||||
_globals = globals()
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'paralogue_net_full_pb2', _globals)
|
||||
if not _descriptor._USE_C_DESCRIPTORS:
|
||||
DESCRIPTOR._loaded_options = None
|
||||
_globals['_ADDPLAYERS2C_RECOGNITIONENTRY']._loaded_options = None
|
||||
_globals['_ADDPLAYERS2C_RECOGNITIONENTRY']._serialized_options = b'8\001'
|
||||
_globals['_BAGITEMFULLS2C_PACKGUARANTEECNTENTRY']._loaded_options = None
|
||||
_globals['_BAGITEMFULLS2C_PACKGUARANTEECNTENTRY']._serialized_options = b'8\001'
|
||||
_globals['_BAGITEMFULLS2C_TOTALGUARANTEEENTRY']._loaded_options = None
|
||||
_globals['_BAGITEMFULLS2C_TOTALGUARANTEEENTRY']._serialized_options = b'8\001'
|
||||
_globals['_BATTLEPASSINFO_CLAIMLVENTRY']._loaded_options = None
|
||||
_globals['_BATTLEPASSINFO_CLAIMLVENTRY']._serialized_options = b'8\001'
|
||||
_globals['_BATTLEPASSINFO_PREMIUMCLAIMLVENTRY']._loaded_options = None
|
||||
_globals['_BATTLEPASSINFO_PREMIUMCLAIMLVENTRY']._serialized_options = b'8\001'
|
||||
_globals['_CACHEROLEDATA_ATTRSENTRY']._loaded_options = None
|
||||
_globals['_CACHEROLEDATA_ATTRSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_CARDBAGOPENRESULT_ROLEFAVORENTRY']._loaded_options = None
|
||||
_globals['_CARDBAGOPENRESULT_ROLEFAVORENTRY']._serialized_options = b'8\001'
|
||||
_globals['_CARDBAGOPENRESULT_DECOMPOSEENTRY']._loaded_options = None
|
||||
_globals['_CARDBAGOPENRESULT_DECOMPOSEENTRY']._serialized_options = b'8\001'
|
||||
_globals['_CARDBAGOPENRSP_PACKGUARANTEEENTRY']._loaded_options = None
|
||||
_globals['_CARDBAGOPENRSP_PACKGUARANTEEENTRY']._serialized_options = b'8\001'
|
||||
_globals['_CARDBAGOPENRSP_TOTALGUARANTEEENTRY']._loaded_options = None
|
||||
_globals['_CARDBAGOPENRSP_TOTALGUARANTEEENTRY']._serialized_options = b'8\001'
|
||||
_globals['_CARDINVENTORYINFO_BORROWEDCARDSENTRY']._loaded_options = None
|
||||
_globals['_CARDINVENTORYINFO_BORROWEDCARDSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_CHOOSESEXTAGRSP_REWARDITEMSENTRY']._loaded_options = None
|
||||
_globals['_CHOOSESEXTAGRSP_REWARDITEMSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_CLAIMBATTLEPASSREWARDRSP_REWARDSENTRY']._loaded_options = None
|
||||
_globals['_CLAIMBATTLEPASSREWARDRSP_REWARDSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_CLIENTSETTINGREQ_CLIENTSETTINGSENTRY']._loaded_options = None
|
||||
_globals['_CLIENTSETTINGREQ_CLIENTSETTINGSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_COMMONSHOPBUYRSP_EXTRAITEMSENTRY']._loaded_options = None
|
||||
_globals['_COMMONSHOPBUYRSP_EXTRAITEMSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_FEMALEAPPEARANCE_FLOATCONFIGENTRY']._loaded_options = None
|
||||
_globals['_FEMALEAPPEARANCE_FLOATCONFIGENTRY']._serialized_options = b'8\001'
|
||||
_globals['_FEMALEAPPEARANCE_BOOLCONFIGENTRY']._loaded_options = None
|
||||
_globals['_FEMALEAPPEARANCE_BOOLCONFIGENTRY']._serialized_options = b'8\001'
|
||||
_globals['_FEMALEAPPEARANCE_COLORCONFIGENTRY']._loaded_options = None
|
||||
_globals['_FEMALEAPPEARANCE_COLORCONFIGENTRY']._serialized_options = b'8\001'
|
||||
_globals['_FEMALEAPPEARANCE_SOCKSCUSTOMENTRY']._loaded_options = None
|
||||
_globals['_FEMALEAPPEARANCE_SOCKSCUSTOMENTRY']._serialized_options = b'8\001'
|
||||
_globals['_GIVEROLEGIFTREQ_GIFTSENTRY']._loaded_options = None
|
||||
_globals['_GIVEROLEGIFTREQ_GIFTSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_GMREWARDINFO_RANKDISTRIBUTIONENTRY']._loaded_options = None
|
||||
_globals['_GMREWARDINFO_RANKDISTRIBUTIONENTRY']._serialized_options = b'8\001'
|
||||
_globals['_GMREWARDINFO_ITEMCOUNTENTRY']._loaded_options = None
|
||||
_globals['_GMREWARDINFO_ITEMCOUNTENTRY']._serialized_options = b'8\001'
|
||||
_globals['_LEARNCARDINFOFULLS2C_LEARNCARDSENTRY']._loaded_options = None
|
||||
_globals['_LEARNCARDINFOFULLS2C_LEARNCARDSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_MAILBRIEFDATA_SENDERENTRY']._loaded_options = None
|
||||
_globals['_MAILBRIEFDATA_SENDERENTRY']._serialized_options = b'8\001'
|
||||
_globals['_MAILBRIEFDATA_TITLEENTRY']._loaded_options = None
|
||||
_globals['_MAILBRIEFDATA_TITLEENTRY']._serialized_options = b'8\001'
|
||||
_globals['_MAILBRIEFDATA_CONTENTENTRY']._loaded_options = None
|
||||
_globals['_MAILBRIEFDATA_CONTENTENTRY']._serialized_options = b'8\001'
|
||||
_globals['_MAILDATA_SENDERENTRY']._loaded_options = None
|
||||
_globals['_MAILDATA_SENDERENTRY']._serialized_options = b'8\001'
|
||||
_globals['_MAILDATA_TITLEENTRY']._loaded_options = None
|
||||
_globals['_MAILDATA_TITLEENTRY']._serialized_options = b'8\001'
|
||||
_globals['_MAILDATA_CONTENTENTRY']._loaded_options = None
|
||||
_globals['_MAILDATA_CONTENTENTRY']._serialized_options = b'8\001'
|
||||
_globals['_NEWBIECARDINFO_OPENPACKSENTRY']._loaded_options = None
|
||||
_globals['_NEWBIECARDINFO_OPENPACKSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_PLAYERBAGINFO_ITEMSENTRY']._loaded_options = None
|
||||
_globals['_PLAYERBAGINFO_ITEMSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_PLAYERBAGINFO_PACKGUARANTEECNTENTRY']._loaded_options = None
|
||||
_globals['_PLAYERBAGINFO_PACKGUARANTEECNTENTRY']._serialized_options = b'8\001'
|
||||
_globals['_PLAYERBAGINFO_TOTALGUARANTEEENTRY']._loaded_options = None
|
||||
_globals['_PLAYERBAGINFO_TOTALGUARANTEEENTRY']._serialized_options = b'8\001'
|
||||
_globals['_PLAYERSHOPBUYLIST_BUYINFOSENTRY']._loaded_options = None
|
||||
_globals['_PLAYERSHOPBUYLIST_BUYINFOSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_ROLEATTRUPDATES2C_ATTRSENTRY']._loaded_options = None
|
||||
_globals['_ROLEATTRUPDATES2C_ATTRSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_ROLECELL_ATTRSENTRY']._loaded_options = None
|
||||
_globals['_ROLECELL_ATTRSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_ROLEPROPERTYCHANGE_ATTRSENTRY']._loaded_options = None
|
||||
_globals['_ROLEPROPERTYCHANGE_ATTRSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_ROOMPLAYERMAINDATARSP_DAYCARDGCRECORDENTRY']._loaded_options = None
|
||||
_globals['_ROOMPLAYERMAINDATARSP_DAYCARDGCRECORDENTRY']._serialized_options = b'8\001'
|
||||
_globals['_ROOMROLEATTRUPDATES2C_ATTRSENTRY']._loaded_options = None
|
||||
_globals['_ROOMROLEATTRUPDATES2C_ATTRSENTRY']._serialized_options = b'8\001'
|
||||
_globals['_UEPLAYERLOGINRSP_RECOGNITIONENTRY']._loaded_options = None
|
||||
_globals['_UEPLAYERLOGINRSP_RECOGNITIONENTRY']._serialized_options = b'8\001'
|
||||
_globals['_ACCOUNTOSTYPE']._serialized_start=29056
|
||||
_globals['_ACCOUNTOSTYPE']._serialized_end=29097
|
||||
_globals['_ACCOUNTTYPE']._serialized_start=29099
|
||||
_globals['_ACCOUNTTYPE']._serialized_end=29180
|
||||
_globals['_ACHIEVEMENTREWARDTYPE']._serialized_start=29182
|
||||
_globals['_ACHIEVEMENTREWARDTYPE']._serialized_end=29290
|
||||
_globals['_CLOTHESTYPE']._serialized_start=29293
|
||||
_globals['_CLOTHESTYPE']._serialized_end=29716
|
||||
_globals['_EROLEATTR']._serialized_start=29719
|
||||
_globals['_EROLEATTR']._serialized_end=30303
|
||||
_globals['_FEMALEAPPEARANCETYPE']._serialized_start=30306
|
||||
_globals['_FEMALEAPPEARANCETYPE']._serialized_end=31573
|
||||
_globals['_HTYPE']._serialized_start=31575
|
||||
_globals['_HTYPE']._serialized_end=31603
|
||||
_globals['_MAILCONTENTTYPE']._serialized_start=31605
|
||||
_globals['_MAILCONTENTTYPE']._serialized_end=31703
|
||||
_globals['_MAILOPERATETYPE']._serialized_start=31706
|
||||
_globals['_MAILOPERATETYPE']._serialized_end=31872
|
||||
_globals['_MAILSTATE']._serialized_start=31874
|
||||
_globals['_MAILSTATE']._serialized_end=31975
|
||||
_globals['_MAILTYPE']._serialized_start=31977
|
||||
_globals['_MAILTYPE']._serialized_end=32048
|
||||
_globals['_MSGROUTE']._serialized_start=32050
|
||||
_globals['_MSGROUTE']._serialized_end=32098
|
||||
_globals['_MSGTYPE']._serialized_start=32100
|
||||
_globals['_MSGTYPE']._serialized_end=32210
|
||||
_globals['_NETWORKONLINESTATE']._serialized_start=32213
|
||||
_globals['_NETWORKONLINESTATE']._serialized_end=32355
|
||||
_globals['_OPERATECMDTYPE']._serialized_start=32357
|
||||
_globals['_OPERATECMDTYPE']._serialized_end=32453
|
||||
_globals['_OPERATETARGETTYPE']._serialized_start=32456
|
||||
_globals['_OPERATETARGETTYPE']._serialized_end=32593
|
||||
_globals['_ORGASMSTYPE']._serialized_start=32595
|
||||
_globals['_ORGASMSTYPE']._serialized_end=32680
|
||||
_globals['_PLAYEROFFLINEREASON']._serialized_start=32683
|
||||
_globals['_PLAYEROFFLINEREASON']._serialized_end=33096
|
||||
_globals['_ROLEACTION']._serialized_start=33099
|
||||
_globals['_ROLEACTION']._serialized_end=33239
|
||||
_globals['_ROOMBUSYSTATUS']._serialized_start=33241
|
||||
_globals['_ROOMBUSYSTATUS']._serialized_end=33336
|
||||
_globals['_SERVERTYPE']._serialized_start=33338
|
||||
_globals['_SERVERTYPE']._serialized_end=33435
|
||||
_globals['_SHOOTACTIONTYPE']._serialized_start=33437
|
||||
_globals['_SHOOTACTIONTYPE']._serialized_end=33487
|
||||
_globals['_SHOOTPOSITIONTYPE']._serialized_start=33489
|
||||
_globals['_SHOOTPOSITIONTYPE']._serialized_end=33551
|
||||
_globals['_STATUSCODE']._serialized_start=33554
|
||||
_globals['_STATUSCODE']._serialized_end=34921
|
||||
_globals['_ACHIEVEMENTENTRY']._serialized_start=42
|
||||
_globals['_ACHIEVEMENTENTRY']._serialized_end=103
|
||||
_globals['_ACHIEVEMENTFULLS2C']._serialized_start=105
|
||||
_globals['_ACHIEVEMENTFULLS2C']._serialized_end=222
|
||||
_globals['_ACHIEVEMENTPROGRESS']._serialized_start=224
|
||||
_globals['_ACHIEVEMENTPROGRESS']._serialized_end=314
|
||||
_globals['_ACHIEVEMENTSTEPUPDATES2C']._serialized_start=316
|
||||
_globals['_ACHIEVEMENTSTEPUPDATES2C']._serialized_end=437
|
||||
_globals['_ADDPLAYERS2C']._serialized_start=440
|
||||
_globals['_ADDPLAYERS2C']._serialized_end=633
|
||||
_globals['_ADDPLAYERS2C_RECOGNITIONENTRY']._serialized_start=583
|
||||
_globals['_ADDPLAYERS2C_RECOGNITIONENTRY']._serialized_end=633
|
||||
_globals['_ADDTASKSTEPC2S']._serialized_start=635
|
||||
_globals['_ADDTASKSTEPC2S']._serialized_end=721
|
||||
_globals['_ANCHEATFOUNDREQ']._serialized_start=723
|
||||
_globals['_ANCHEATFOUNDREQ']._serialized_end=740
|
||||
_globals['_ANCHEATFOUNDRSP']._serialized_start=742
|
||||
_globals['_ANCHEATFOUNDRSP']._serialized_end=801
|
||||
_globals['_BAGITEMFULLS2C']._serialized_start=804
|
||||
_globals['_BAGITEMFULLS2C']._serialized_end=1192
|
||||
_globals['_BAGITEMFULLS2C_PACKGUARANTEECNTENTRY']._serialized_start=1082
|
||||
_globals['_BAGITEMFULLS2C_PACKGUARANTEECNTENTRY']._serialized_end=1137
|
||||
_globals['_BAGITEMFULLS2C_TOTALGUARANTEEENTRY']._serialized_start=1139
|
||||
_globals['_BAGITEMFULLS2C_TOTALGUARANTEEENTRY']._serialized_end=1192
|
||||
_globals['_BAGITEMUPDATES2C']._serialized_start=1194
|
||||
_globals['_BAGITEMUPDATES2C']._serialized_end=1293
|
||||
_globals['_BASEITEM']._serialized_start=1295
|
||||
_globals['_BASEITEM']._serialized_end=1334
|
||||
_globals['_BATTLEPASSFULLS2C']._serialized_start=1337
|
||||
_globals['_BATTLEPASSFULLS2C']._serialized_end=1470
|
||||
_globals['_BATTLEPASSINFO']._serialized_start=1473
|
||||
_globals['_BATTLEPASSINFO']._serialized_end=1808
|
||||
_globals['_BATTLEPASSINFO_CLAIMLVENTRY']._serialized_start=1707
|
||||
_globals['_BATTLEPASSINFO_CLAIMLVENTRY']._serialized_end=1753
|
||||
_globals['_BATTLEPASSINFO_PREMIUMCLAIMLVENTRY']._serialized_start=1755
|
||||
_globals['_BATTLEPASSINFO_PREMIUMCLAIMLVENTRY']._serialized_end=1808
|
||||
_globals['_BATTLEPASSLIST']._serialized_start=1810
|
||||
_globals['_BATTLEPASSLIST']._serialized_end=1902
|
||||
_globals['_BORROWEDCARDINFO']._serialized_start=1904
|
||||
_globals['_BORROWEDCARDINFO']._serialized_end=1980
|
||||
_globals['_BPEXPCHANGES2C']._serialized_start=1982
|
||||
_globals['_BPEXPCHANGES2C']._serialized_end=2079
|
||||
_globals['_BUYBATTLEPASSLVREQ']._serialized_start=2081
|
||||
_globals['_BUYBATTLEPASSLVREQ']._serialized_end=2125
|
||||
_globals['_BUYBATTLEPASSLVRSP']._serialized_start=2127
|
||||
_globals['_BUYBATTLEPASSLVRSP']._serialized_end=2189
|
||||
_globals['_BUYBATTLEPASSREQ']._serialized_start=2191
|
||||
_globals['_BUYBATTLEPASSREQ']._serialized_end=2221
|
||||
_globals['_BUYBATTLEPASSRSP']._serialized_start=2223
|
||||
_globals['_BUYBATTLEPASSRSP']._serialized_end=2283
|
||||
_globals['_CACHEPLAYERDATA']._serialized_start=2285
|
||||
_globals['_CACHEPLAYERDATA']._serialized_end=2391
|
||||
_globals['_CACHEROLEDATA']._serialized_start=2394
|
||||
_globals['_CACHEROLEDATA']._serialized_end=2737
|
||||
_globals['_CACHEROLEDATA_ATTRSENTRY']._serialized_start=2693
|
||||
_globals['_CACHEROLEDATA_ATTRSENTRY']._serialized_end=2737
|
||||
_globals['_CARDBAGOPENREQ']._serialized_start=2739
|
||||
_globals['_CARDBAGOPENREQ']._serialized_end=2772
|
||||
_globals['_CARDBAGOPENRESULT']._serialized_start=2775
|
||||
_globals['_CARDBAGOPENRESULT']._serialized_end=3046
|
||||
_globals['_CARDBAGOPENRESULT_ROLEFAVORENTRY']._serialized_start=2948
|
||||
_globals['_CARDBAGOPENRESULT_ROLEFAVORENTRY']._serialized_end=2996
|
||||
_globals['_CARDBAGOPENRESULT_DECOMPOSEENTRY']._serialized_start=2998
|
||||
_globals['_CARDBAGOPENRESULT_DECOMPOSEENTRY']._serialized_end=3046
|
||||
_globals['_CARDBAGOPENRSP']._serialized_start=3049
|
||||
_globals['_CARDBAGOPENRSP']._serialized_end=3411
|
||||
_globals['_CARDBAGOPENRSP_PACKGUARANTEEENTRY']._serialized_start=3304
|
||||
_globals['_CARDBAGOPENRSP_PACKGUARANTEEENTRY']._serialized_end=3356
|
||||
_globals['_CARDBAGOPENRSP_TOTALGUARANTEEENTRY']._serialized_start=1139
|
||||
_globals['_CARDBAGOPENRSP_TOTALGUARANTEEENTRY']._serialized_end=1192
|
||||
_globals['_CARDCOMPOSEREQ']._serialized_start=3413
|
||||
_globals['_CARDCOMPOSEREQ']._serialized_end=3446
|
||||
_globals['_CARDCOMPOSERSP']._serialized_start=3448
|
||||
_globals['_CARDCOMPOSERSP']._serialized_end=3506
|
||||
_globals['_CARDINVENTORYINFO']._serialized_start=3509
|
||||
_globals['_CARDINVENTORYINFO']._serialized_end=3690
|
||||
_globals['_CARDINVENTORYINFO_BORROWEDCARDSENTRY']._serialized_start=3606
|
||||
_globals['_CARDINVENTORYINFO_BORROWEDCARDSENTRY']._serialized_end=3690
|
||||
_globals['_CARDLEARNREQ']._serialized_start=3692
|
||||
_globals['_CARDLEARNREQ']._serialized_end=3747
|
||||
_globals['_CARDLEARNRSP']._serialized_start=3749
|
||||
_globals['_CARDLEARNRSP']._serialized_end=3825
|
||||
_globals['_CARDLEARNS2C']._serialized_start=3827
|
||||
_globals['_CARDLEARNS2C']._serialized_end=3951
|
||||
_globals['_CHARACTERSHOOT']._serialized_start=3954
|
||||
_globals['_CHARACTERSHOOT']._serialized_end=4222
|
||||
_globals['_CHOOSESEXTAGREQ']._serialized_start=4224
|
||||
_globals['_CHOOSESEXTAGREQ']._serialized_end=4273
|
||||
_globals['_CHOOSESEXTAGRSP']._serialized_start=4276
|
||||
_globals['_CHOOSESEXTAGRSP']._serialized_end=4457
|
||||
_globals['_CHOOSESEXTAGRSP_REWARDITEMSENTRY']._serialized_start=4407
|
||||
_globals['_CHOOSESEXTAGRSP_REWARDITEMSENTRY']._serialized_end=4457
|
||||
_globals['_CLAIMBATTLEPASSREWARDREQ']._serialized_start=4459
|
||||
_globals['_CLAIMBATTLEPASSREWARDREQ']._serialized_end=4542
|
||||
_globals['_CLAIMBATTLEPASSREWARDRSP']._serialized_start=4545
|
||||
_globals['_CLAIMBATTLEPASSREWARDRSP']._serialized_end=4809
|
||||
_globals['_CLAIMBATTLEPASSREWARDRSP_REWARDSENTRY']._serialized_start=4763
|
||||
_globals['_CLAIMBATTLEPASSREWARDRSP_REWARDSENTRY']._serialized_end=4809
|
||||
_globals['_CLEARROLECURRENTSEMENREQ']._serialized_start=4811
|
||||
_globals['_CLEARROLECURRENTSEMENREQ']._serialized_end=4856
|
||||
_globals['_CLEARROLECURRENTSEMENRSP']._serialized_start=4858
|
||||
_globals['_CLEARROLECURRENTSEMENRSP']._serialized_end=4926
|
||||
_globals['_CLIENTINFO']._serialized_start=4929
|
||||
_globals['_CLIENTINFO']._serialized_end=5154
|
||||
_globals['_CLIENTSETTINGREQ']._serialized_start=5157
|
||||
_globals['_CLIENTSETTINGREQ']._serialized_end=5307
|
||||
_globals['_CLIENTSETTINGREQ_CLIENTSETTINGSENTRY']._serialized_start=5254
|
||||
_globals['_CLIENTSETTINGREQ_CLIENTSETTINGSENTRY']._serialized_end=5307
|
||||
_globals['_CLIENTSETTINGRSP']._serialized_start=5309
|
||||
_globals['_CLIENTSETTINGRSP']._serialized_end=5369
|
||||
_globals['_CLOTHESCELL']._serialized_start=5371
|
||||
_globals['_CLOTHESCELL']._serialized_end=5451
|
||||
_globals['_CLOTHESCOLORCELL']._serialized_start=5454
|
||||
_globals['_CLOTHESCOLORCELL']._serialized_end=5583
|
||||
_globals['_CLOTHESCOLORS']._serialized_start=5586
|
||||
_globals['_CLOTHESCOLORS']._serialized_end=5738
|
||||
_globals['_CLOTHESEQUIPPRESETREQ']._serialized_start=5740
|
||||
_globals['_CLOTHESEQUIPPRESETREQ']._serialized_end=5802
|
||||
_globals['_CLOTHESEQUIPPRESETRSP']._serialized_start=5804
|
||||
_globals['_CLOTHESEQUIPPRESETRSP']._serialized_end=5869
|
||||
_globals['_CLOTHESEQUIPREQ']._serialized_start=5871
|
||||
_globals['_CLOTHESEQUIPREQ']._serialized_end=5956
|
||||
_globals['_CLOTHESEQUIPRSP']._serialized_start=5958
|
||||
_globals['_CLOTHESEQUIPRSP']._serialized_end=6017
|
||||
_globals['_CLOTHESMODIFYCOLORREQ']._serialized_start=6019
|
||||
_globals['_CLOTHESMODIFYCOLORREQ']._serialized_end=6114
|
||||
_globals['_CLOTHESMODIFYCOLORRSP']._serialized_start=6116
|
||||
_globals['_CLOTHESMODIFYCOLORRSP']._serialized_end=6181
|
||||
_globals['_CLOTHESPRESET']._serialized_start=6184
|
||||
_globals['_CLOTHESPRESET']._serialized_end=6368
|
||||
_globals['_CLOTHESPRESETUPDATES2C']._serialized_start=6371
|
||||
_globals['_CLOTHESPRESETUPDATES2C']._serialized_end=6509
|
||||
_globals['_CLOTHESSAVEPRESETREQ']._serialized_start=6512
|
||||
_globals['_CLOTHESSAVEPRESETREQ']._serialized_end=6727
|
||||
_globals['_CLOTHESSAVEPRESETRSP']._serialized_start=6729
|
||||
_globals['_CLOTHESSAVEPRESETRSP']._serialized_end=6793
|
||||
_globals['_COLOR']._serialized_start=6795
|
||||
_globals['_COLOR']._serialized_end=6846
|
||||
_globals['_COMMONSHOPBUYREQ']._serialized_start=6848
|
||||
_globals['_COMMONSHOPBUYREQ']._serialized_end=6936
|
||||
_globals['_COMMONSHOPBUYRSP']._serialized_start=6939
|
||||
_globals['_COMMONSHOPBUYRSP']._serialized_end=7144
|
||||
_globals['_COMMONSHOPBUYRSP_EXTRAITEMSENTRY']._serialized_start=7095
|
||||
_globals['_COMMONSHOPBUYRSP_EXTRAITEMSENTRY']._serialized_end=7144
|
||||
_globals['_COMMONSHOPITEM']._serialized_start=7147
|
||||
_globals['_COMMONSHOPITEM']._serialized_end=7312
|
||||
_globals['_COSTPRICE']._serialized_start=7314
|
||||
_globals['_COSTPRICE']._serialized_end=7401
|
||||
_globals['_CREATEPAYORDERREQ']._serialized_start=7403
|
||||
_globals['_CREATEPAYORDERREQ']._serialized_end=7503
|
||||
_globals['_CREATEPAYORDERRSP']._serialized_start=7505
|
||||
_globals['_CREATEPAYORDERRSP']._serialized_end=7602
|
||||
_globals['_DANCEC2S']._serialized_start=7604
|
||||
_globals['_DANCEC2S']._serialized_end=7633
|
||||
_globals['_DRINKREQ']._serialized_start=7635
|
||||
_globals['_DRINKREQ']._serialized_end=7664
|
||||
_globals['_DRINKRSP']._serialized_start=7666
|
||||
_globals['_DRINKRSP']._serialized_end=7754
|
||||
_globals['_ERRORLOGREQ']._serialized_start=7756
|
||||
_globals['_ERRORLOGREQ']._serialized_end=7804
|
||||
_globals['_ERRORLOGRSP']._serialized_start=7806
|
||||
_globals['_ERRORLOGRSP']._serialized_end=7861
|
||||
_globals['_FEMALEAPPEARANCE']._serialized_start=7864
|
||||
_globals['_FEMALEAPPEARANCE']._serialized_end=8392
|
||||
_globals['_FEMALEAPPEARANCE_FLOATCONFIGENTRY']._serialized_start=8166
|
||||
_globals['_FEMALEAPPEARANCE_FLOATCONFIGENTRY']._serialized_end=8216
|
||||
_globals['_FEMALEAPPEARANCE_BOOLCONFIGENTRY']._serialized_start=8218
|
||||
_globals['_FEMALEAPPEARANCE_BOOLCONFIGENTRY']._serialized_end=8267
|
||||
_globals['_FEMALEAPPEARANCE_COLORCONFIGENTRY']._serialized_start=8269
|
||||
_globals['_FEMALEAPPEARANCE_COLORCONFIGENTRY']._serialized_end=8340
|
||||
_globals['_FEMALEAPPEARANCE_SOCKSCUSTOMENTRY']._serialized_start=8342
|
||||
_globals['_FEMALEAPPEARANCE_SOCKSCUSTOMENTRY']._serialized_end=8392
|
||||
_globals['_GENERICPARAM']._serialized_start=8395
|
||||
_globals['_GENERICPARAM']._serialized_end=8525
|
||||
_globals['_GETACHIEVEMENTREWARDREQ']._serialized_start=8527
|
||||
_globals['_GETACHIEVEMENTREWARDREQ']._serialized_end=8595
|
||||
_globals['_GETACHIEVEMENTREWARDRSP']._serialized_start=8597
|
||||
_globals['_GETACHIEVEMENTREWARDRSP']._serialized_end=8683
|
||||
_globals['_GETCURDILATIONLEVELREQ']._serialized_start=8685
|
||||
_globals['_GETCURDILATIONLEVELREQ']._serialized_end=8709
|
||||
_globals['_GETCURDILATIONLEVELRSP']._serialized_start=8711
|
||||
_globals['_GETCURDILATIONLEVELRSP']._serialized_end=8826
|
||||
_globals['_GETMAILSREQ']._serialized_start=8828
|
||||
_globals['_GETMAILSREQ']._serialized_end=8855
|
||||
_globals['_GETMAILSRSP']._serialized_start=8857
|
||||
_globals['_GETMAILSRSP']._serialized_end=8956
|
||||
_globals['_GETOFFLINEREWARDREQ']._serialized_start=8958
|
||||
_globals['_GETOFFLINEREWARDREQ']._serialized_end=8979
|
||||
_globals['_GETOFFLINEREWARDRSP']._serialized_start=8981
|
||||
_globals['_GETOFFLINEREWARDRSP']._serialized_end=9044
|
||||
_globals['_GETROLESINFOREQ']._serialized_start=9046
|
||||
_globals['_GETROLESINFOREQ']._serialized_end=9083
|
||||
_globals['_GETROLESINFORSP']._serialized_start=9085
|
||||
_globals['_GETROLESINFORSP']._serialized_end=9188
|
||||
_globals['_GETROOMBUSYSTATUSREQ']._serialized_start=9190
|
||||
_globals['_GETROOMBUSYSTATUSREQ']._serialized_end=9230
|
||||
_globals['_GETROOMBUSYSTATUSRSP']._serialized_start=9233
|
||||
_globals['_GETROOMBUSYSTATUSRSP']._serialized_end=9367
|
||||
_globals['_GETTASKREWARDREQ']._serialized_start=9369
|
||||
_globals['_GETTASKREWARDREQ']._serialized_end=9404
|
||||
_globals['_GETTASKREWARDRSP']._serialized_start=9406
|
||||
_globals['_GETTASKREWARDRSP']._serialized_end=9466
|
||||
_globals['_GIVEROLEGIFTREQ']._serialized_start=9469
|
||||
_globals['_GIVEROLEGIFTREQ']._serialized_end=9608
|
||||
_globals['_GIVEROLEGIFTREQ_GIFTSENTRY']._serialized_start=9564
|
||||
_globals['_GIVEROLEGIFTREQ_GIFTSENTRY']._serialized_end=9608
|
||||
_globals['_GIVEROLEGIFTRSP']._serialized_start=9610
|
||||
_globals['_GIVEROLEGIFTRSP']._serialized_end=9684
|
||||
_globals['_GMCODEREQ']._serialized_start=9686
|
||||
_globals['_GMCODEREQ']._serialized_end=9712
|
||||
_globals['_GMCODERSP']._serialized_start=9715
|
||||
_globals['_GMCODERSP']._serialized_end=9857
|
||||
_globals['_GMREWARDINFO']._serialized_start=9860
|
||||
_globals['_GMREWARDINFO']._serialized_end=10286
|
||||
_globals['_GMREWARDINFO_RANKDISTRIBUTIONENTRY']._serialized_start=10181
|
||||
_globals['_GMREWARDINFO_RANKDISTRIBUTIONENTRY']._serialized_end=10236
|
||||
_globals['_GMREWARDINFO_ITEMCOUNTENTRY']._serialized_start=10238
|
||||
_globals['_GMREWARDINFO_ITEMCOUNTENTRY']._serialized_end=10286
|
||||
_globals['_KICKPLAYERS2C']._serialized_start=10288
|
||||
_globals['_KICKPLAYERS2C']._serialized_end=10344
|
||||
_globals['_LEARNCARDINFOFULLS2C']._serialized_start=10347
|
||||
_globals['_LEARNCARDINFOFULLS2C']._serialized_end=10567
|
||||
_globals['_LEARNCARDINFOFULLS2C_LEARNCARDSENTRY']._serialized_start=10486
|
||||
_globals['_LEARNCARDINFOFULLS2C_LEARNCARDSENTRY']._serialized_end=10567
|
||||
_globals['_LIKEGIVEDNOTICES2C']._serialized_start=10570
|
||||
_globals['_LIKEGIVEDNOTICES2C']._serialized_end=10698
|
||||
_globals['_LIKEGIVEDREQ']._serialized_start=10700
|
||||
_globals['_LIKEGIVEDREQ']._serialized_end=10760
|
||||
_globals['_LIKEGIVEDRSP']._serialized_start=10763
|
||||
_globals['_LIKEGIVEDRSP']._serialized_end=10897
|
||||
_globals['_LIKEGIVEDS2C']._serialized_start=10900
|
||||
_globals['_LIKEGIVEDS2C']._serialized_end=11047
|
||||
_globals['_MAILATTACHMENT']._serialized_start=11049
|
||||
_globals['_MAILATTACHMENT']._serialized_end=11104
|
||||
_globals['_MAILBRIEFDATA']._serialized_start=11107
|
||||
_globals['_MAILBRIEFDATA']._serialized_end=11643
|
||||
_globals['_MAILBRIEFDATA_SENDERENTRY']._serialized_start=11504
|
||||
_globals['_MAILBRIEFDATA_SENDERENTRY']._serialized_end=11549
|
||||
_globals['_MAILBRIEFDATA_TITLEENTRY']._serialized_start=11551
|
||||
_globals['_MAILBRIEFDATA_TITLEENTRY']._serialized_end=11595
|
||||
_globals['_MAILBRIEFDATA_CONTENTENTRY']._serialized_start=11597
|
||||
_globals['_MAILBRIEFDATA_CONTENTENTRY']._serialized_end=11643
|
||||
_globals['_MAILDATA']._serialized_start=11646
|
||||
_globals['_MAILDATA']._serialized_end=12427
|
||||
_globals['_MAILDATA_SENDERENTRY']._serialized_start=11504
|
||||
_globals['_MAILDATA_SENDERENTRY']._serialized_end=11549
|
||||
_globals['_MAILDATA_TITLEENTRY']._serialized_start=11551
|
||||
_globals['_MAILDATA_TITLEENTRY']._serialized_end=11595
|
||||
_globals['_MAILDATA_CONTENTENTRY']._serialized_start=11597
|
||||
_globals['_MAILDATA_CONTENTENTRY']._serialized_end=11643
|
||||
_globals['_NEEDLOGINNOTICE']._serialized_start=12429
|
||||
_globals['_NEEDLOGINNOTICE']._serialized_end=12488
|
||||
_globals['_NEWBIECARDINFO']._serialized_start=12491
|
||||
_globals['_NEWBIECARDINFO']._serialized_end=12668
|
||||
_globals['_NEWBIECARDINFO_OPENPACKSENTRY']._serialized_start=12620
|
||||
_globals['_NEWBIECARDINFO_OPENPACKSENTRY']._serialized_end=12668
|
||||
_globals['_NOCONFIRMUNCOMPOSECARD']._serialized_start=12670
|
||||
_globals['_NOCONFIRMUNCOMPOSECARD']._serialized_end=12712
|
||||
_globals['_ONECUSTOMSUITITEMS']._serialized_start=12714
|
||||
_globals['_ONECUSTOMSUITITEMS']._serialized_end=12769
|
||||
_globals['_OPERATECMDDATA']._serialized_start=12771
|
||||
_globals['_OPERATECMDDATA']._serialized_end=12884
|
||||
_globals['_OPERATEMAILSREQ']._serialized_start=12886
|
||||
_globals['_OPERATEMAILSREQ']._serialized_end=12973
|
||||
_globals['_OPERATEMAILSRSP']._serialized_start=12976
|
||||
_globals['_OPERATEMAILSRSP']._serialized_end=13182
|
||||
_globals['_ORGASMINBEDC2S']._serialized_start=13184
|
||||
_globals['_ORGASMINBEDC2S']._serialized_end=13219
|
||||
_globals['_ORGASMSC2S']._serialized_start=13221
|
||||
_globals['_ORGASMSC2S']._serialized_end=13288
|
||||
_globals['_ORGASMSHRESULTS2C']._serialized_start=13291
|
||||
_globals['_ORGASMSHRESULTS2C']._serialized_end=13483
|
||||
_globals['_PACKETHEAD']._serialized_start=13485
|
||||
_globals['_PACKETHEAD']._serialized_end=13606
|
||||
_globals['_PATREONBOUNDRESULTS2C']._serialized_start=13609
|
||||
_globals['_PATREONBOUNDRESULTS2C']._serialized_end=13760
|
||||
_globals['_PAYDELIVERDATA']._serialized_start=13763
|
||||
_globals['_PAYDELIVERDATA']._serialized_end=13962
|
||||
_globals['_PLAYERACHIEVEMENT']._serialized_start=13964
|
||||
_globals['_PLAYERACHIEVEMENT']._serialized_end=14090
|
||||
_globals['_PLAYERBAGINFO']._serialized_start=14093
|
||||
_globals['_PLAYERBAGINFO']._serialized_end=14553
|
||||
_globals['_PLAYERBAGINFO_ITEMSENTRY']._serialized_start=14373
|
||||
_globals['_PLAYERBAGINFO_ITEMSENTRY']._serialized_end=14441
|
||||
_globals['_PLAYERBAGINFO_PACKGUARANTEECNTENTRY']._serialized_start=1082
|
||||
_globals['_PLAYERBAGINFO_PACKGUARANTEECNTENTRY']._serialized_end=1137
|
||||
_globals['_PLAYERBAGINFO_TOTALGUARANTEEENTRY']._serialized_start=1139
|
||||
_globals['_PLAYERBAGINFO_TOTALGUARANTEEENTRY']._serialized_end=1192
|
||||
_globals['_PLAYERBRIEFINFO']._serialized_start=14556
|
||||
_globals['_PLAYERBRIEFINFO']._serialized_end=14691
|
||||
_globals['_PLAYEREXPFULLS2C']._serialized_start=14693
|
||||
_globals['_PLAYEREXPFULLS2C']._serialized_end=14813
|
||||
_globals['_PLAYEREXPLEVELFULLS2C']._serialized_start=14815
|
||||
_globals['_PLAYEREXPLEVELFULLS2C']._serialized_end=14908
|
||||
_globals['_PLAYERLOGINREQ']._serialized_start=14911
|
||||
_globals['_PLAYERLOGINREQ']._serialized_end=15130
|
||||
_globals['_PLAYERLOGINRSP']._serialized_start=15133
|
||||
_globals['_PLAYERLOGINRSP']._serialized_end=15414
|
||||
_globals['_PLAYERMAINDATAREQ']._serialized_start=15416
|
||||
_globals['_PLAYERMAINDATAREQ']._serialized_end=15435
|
||||
_globals['_PLAYERMAINDATARSP']._serialized_start=15438
|
||||
_globals['_PLAYERMAINDATARSP']._serialized_end=15800
|
||||
_globals['_PLAYEROFFLINEREQ']._serialized_start=15802
|
||||
_globals['_PLAYEROFFLINEREQ']._serialized_end=15820
|
||||
_globals['_PLAYEROFFLINERSP']._serialized_start=15823
|
||||
_globals['_PLAYEROFFLINERSP']._serialized_end=15965
|
||||
_globals['_PLAYERPINGREQ']._serialized_start=15967
|
||||
_globals['_PLAYERPINGREQ']._serialized_end=16006
|
||||
_globals['_PLAYERPINGRSP']._serialized_start=16008
|
||||
_globals['_PLAYERPINGRSP']._serialized_end=16113
|
||||
_globals['_PLAYERROLES']._serialized_start=16116
|
||||
_globals['_PLAYERROLES']._serialized_end=16375
|
||||
_globals['_PLAYERSHOP']._serialized_start=16378
|
||||
_globals['_PLAYERSHOP']._serialized_end=16729
|
||||
_globals['_PLAYERSHOPBUYINFO']._serialized_start=16731
|
||||
_globals['_PLAYERSHOPBUYINFO']._serialized_end=16793
|
||||
_globals['_PLAYERSHOPBUYLIST']._serialized_start=16796
|
||||
_globals['_PLAYERSHOPBUYLIST']._serialized_end=16977
|
||||
_globals['_PLAYERSHOPBUYLIST_BUYINFOSENTRY']._serialized_start=16897
|
||||
_globals['_PLAYERSHOPBUYLIST_BUYINFOSENTRY']._serialized_end=16977
|
||||
_globals['_PLAYERTASKLIST']._serialized_start=16980
|
||||
_globals['_PLAYERTASKLIST']._serialized_end=17110
|
||||
_globals['_PLAYERTESTREQ']._serialized_start=17112
|
||||
_globals['_PLAYERTESTREQ']._serialized_end=17141
|
||||
_globals['_PLAYERTESTRSP']._serialized_start=17143
|
||||
_globals['_PLAYERTESTRSP']._serialized_end=17214
|
||||
_globals['_PLAYERTIMEOFFSETS2C']._serialized_start=17216
|
||||
_globals['_PLAYERTIMEOFFSETS2C']._serialized_end=17333
|
||||
_globals['_PLAYERWELFAREINFO']._serialized_start=17335
|
||||
_globals['_PLAYERWELFAREINFO']._serialized_end=17375
|
||||
_globals['_REROLLTASKREQ']._serialized_start=17377
|
||||
_globals['_REROLLTASKREQ']._serialized_end=17409
|
||||
_globals['_REROLLTASKRSP']._serialized_start=17411
|
||||
_globals['_REROLLTASKRSP']._serialized_end=17531
|
||||
_globals['_READITEMREQ']._serialized_start=17533
|
||||
_globals['_READITEMREQ']._serialized_end=17563
|
||||
_globals['_READITEMRSP']._serialized_start=17565
|
||||
_globals['_READITEMRSP']._serialized_end=17620
|
||||
_globals['_READOUTFITSHOPITEMREQ']._serialized_start=17622
|
||||
_globals['_READOUTFITSHOPITEMREQ']._serialized_end=17662
|
||||
_globals['_READOUTFITSHOPITEMRSP']._serialized_start=17664
|
||||
_globals['_READOUTFITSHOPITEMRSP']._serialized_end=17761
|
||||
_globals['_READSHOPREQ']._serialized_start=17763
|
||||
_globals['_READSHOPREQ']._serialized_end=17790
|
||||
_globals['_READSHOPRSP']._serialized_start=17792
|
||||
_globals['_READSHOPRSP']._serialized_end=17867
|
||||
_globals['_REALNAMEREQ']._serialized_start=17869
|
||||
_globals['_REALNAMEREQ']._serialized_end=17901
|
||||
_globals['_REALNAMERSP']._serialized_start=17903
|
||||
_globals['_REALNAMERSP']._serialized_end=17958
|
||||
_globals['_RECEIVEMAILS2C']._serialized_start=17960
|
||||
_globals['_RECEIVEMAILS2C']._serialized_end=18086
|
||||
_globals['_REFRESHSHOPREQ']._serialized_start=18088
|
||||
_globals['_REFRESHSHOPREQ']._serialized_end=18146
|
||||
_globals['_REFRESHSHOPRSP']._serialized_start=18148
|
||||
_globals['_REFRESHSHOPRSP']._serialized_end=18256
|
||||
_globals['_ROLEANALEXPANDVAGINALEXPINFO']._serialized_start=18258
|
||||
_globals['_ROLEANALEXPANDVAGINALEXPINFO']._serialized_end=18346
|
||||
_globals['_ROLEANALEXPANDVAGINALEXPINFOSREQ']._serialized_start=18348
|
||||
_globals['_ROLEANALEXPANDVAGINALEXPINFOSREQ']._serialized_end=18382
|
||||
_globals['_ROLEANALEXPANDVAGINALEXPINFOSRSP']._serialized_start=18385
|
||||
_globals['_ROLEANALEXPANDVAGINALEXPINFOSRSP']._serialized_end=18523
|
||||
_globals['_ROLEAPPEARANCECLOTHESUPDATES2C']._serialized_start=18526
|
||||
_globals['_ROLEAPPEARANCECLOTHESUPDATES2C']._serialized_end=18720
|
||||
_globals['_ROLEAPPEARANCEUPDATES2C']._serialized_start=18723
|
||||
_globals['_ROLEAPPEARANCEUPDATES2C']._serialized_end=18861
|
||||
_globals['_ROLEATTRUPDATES2C']._serialized_start=18864
|
||||
_globals['_ROLEATTRUPDATES2C']._serialized_end=19049
|
||||
_globals['_ROLEATTRUPDATES2C_ATTRSENTRY']._serialized_start=2693
|
||||
_globals['_ROLEATTRUPDATES2C_ATTRSENTRY']._serialized_end=2737
|
||||
_globals['_ROLECELL']._serialized_start=19052
|
||||
_globals['_ROLECELL']._serialized_end=19697
|
||||
_globals['_ROLECELL_ATTRSENTRY']._serialized_start=2693
|
||||
_globals['_ROLECELL_ATTRSENTRY']._serialized_end=2737
|
||||
_globals['_ROLECLOTHESCOLORUPDATES2C']._serialized_start=19700
|
||||
_globals['_ROLECLOTHESCOLORUPDATES2C']._serialized_end=19841
|
||||
_globals['_ROLEDILATIONUPDATES2C']._serialized_start=19844
|
||||
_globals['_ROLEDILATIONUPDATES2C']._serialized_end=20040
|
||||
_globals['_ROLEFAVORUPDATES2C']._serialized_start=20043
|
||||
_globals['_ROLEFAVORUPDATES2C']._serialized_end=20182
|
||||
_globals['_ROLELISTFULLS2C']._serialized_start=20184
|
||||
_globals['_ROLELISTFULLS2C']._serialized_end=20289
|
||||
_globals['_ROLEPROPERTYCHANGE']._serialized_start=20292
|
||||
_globals['_ROLEPROPERTYCHANGE']._serialized_end=20481
|
||||
_globals['_ROLEPROPERTYCHANGE_ATTRSENTRY']._serialized_start=2693
|
||||
_globals['_ROLEPROPERTYCHANGE_ATTRSENTRY']._serialized_end=2737
|
||||
_globals['_ROLEPROPERTYCHANGEC2S']._serialized_start=20483
|
||||
_globals['_ROLEPROPERTYCHANGEC2S']._serialized_end=20579
|
||||
_globals['_ROLESTAMINAAUTORECOVERYEXREQ']._serialized_start=20581
|
||||
_globals['_ROLESTAMINAAUTORECOVERYEXREQ']._serialized_end=20645
|
||||
_globals['_ROLESTAMINAAUTORECOVERYEXRSP']._serialized_start=20647
|
||||
_globals['_ROLESTAMINAAUTORECOVERYEXRSP']._serialized_end=20719
|
||||
_globals['_ROLESTAMINAAUTORECOVERYREQ']._serialized_start=20721
|
||||
_globals['_ROLESTAMINAAUTORECOVERYREQ']._serialized_end=20782
|
||||
_globals['_ROLESTAMINAAUTORECOVERYRSP']._serialized_start=20784
|
||||
_globals['_ROLESTAMINAAUTORECOVERYRSP']._serialized_end=20854
|
||||
_globals['_ROLESTAMINAUPDATES2C']._serialized_start=20856
|
||||
_globals['_ROLESTAMINAUPDATES2C']._serialized_end=20960
|
||||
_globals['_ROLETODAYDANCEUPDATES2C']._serialized_start=20962
|
||||
_globals['_ROLETODAYDANCEUPDATES2C']._serialized_end=21050
|
||||
_globals['_ROOMCHECKCARDREQ']._serialized_start=21052
|
||||
_globals['_ROOMCHECKCARDREQ']._serialized_end=21106
|
||||
_globals['_ROOMCHECKCARDRSP']._serialized_start=21108
|
||||
_globals['_ROOMCHECKCARDRSP']._serialized_end=21186
|
||||
_globals['_ROOMCURRENTROLEUPDATES2C']._serialized_start=21188
|
||||
_globals['_ROOMCURRENTROLEUPDATES2C']._serialized_end=21299
|
||||
_globals['_ROOMDAYCARDHCOUNTS2C']._serialized_start=21301
|
||||
_globals['_ROOMDAYCARDHCOUNTS2C']._serialized_end=21422
|
||||
_globals['_ROOMKICKPLAYERS2C']._serialized_start=21424
|
||||
_globals['_ROOMKICKPLAYERS2C']._serialized_end=21504
|
||||
_globals['_ROOMPLAYERLEVELS2C']._serialized_start=21506
|
||||
_globals['_ROOMPLAYERLEVELS2C']._serialized_end=21601
|
||||
_globals['_ROOMPLAYERLIKES2C']._serialized_start=21603
|
||||
_globals['_ROOMPLAYERLIKES2C']._serialized_end=21701
|
||||
_globals['_ROOMPLAYERMAINDATAREQ']._serialized_start=21703
|
||||
_globals['_ROOMPLAYERMAINDATAREQ']._serialized_end=21745
|
||||
_globals['_ROOMPLAYERMAINDATARSP']._serialized_start=21748
|
||||
_globals['_ROOMPLAYERMAINDATARSP']._serialized_end=22135
|
||||
_globals['_ROOMPLAYERMAINDATARSP_DAYCARDGCRECORDENTRY']._serialized_start=22081
|
||||
_globals['_ROOMPLAYERMAINDATARSP_DAYCARDGCRECORDENTRY']._serialized_end=22135
|
||||
_globals['_ROOMROLEACTIONCHANGEC2S']._serialized_start=22138
|
||||
_globals['_ROOMROLEACTIONCHANGEC2S']._serialized_end=22267
|
||||
_globals['_ROOMROLEAPPEARANCECLOTHESUPDATES2C']._serialized_start=22270
|
||||
_globals['_ROOMROLEAPPEARANCECLOTHESUPDATES2C']._serialized_end=22487
|
||||
_globals['_ROOMROLEAPPEARANCEUPDATES2C']._serialized_start=22490
|
||||
_globals['_ROOMROLEAPPEARANCEUPDATES2C']._serialized_end=22651
|
||||
_globals['_ROOMROLEATTRUPDATES2C']._serialized_start=22654
|
||||
_globals['_ROOMROLEATTRUPDATES2C']._serialized_end=22866
|
||||
_globals['_ROOMROLEATTRUPDATES2C_ATTRSENTRY']._serialized_start=2693
|
||||
_globals['_ROOMROLEATTRUPDATES2C_ATTRSENTRY']._serialized_end=2737
|
||||
_globals['_ROOMROLECLOTHESCOLORUPDATES2C']._serialized_start=22869
|
||||
_globals['_ROOMROLECLOTHESCOLORUPDATES2C']._serialized_end=23033
|
||||
_globals['_ROOMROLEDILATION']._serialized_start=23036
|
||||
_globals['_ROOMROLEDILATION']._serialized_end=23260
|
||||
_globals['_ROOMROLEDILATIONUPDATES2C']._serialized_start=23263
|
||||
_globals['_ROOMROLEDILATIONUPDATES2C']._serialized_end=23406
|
||||
_globals['_ROOMROLEFAVORUPDATES2C']._serialized_start=23409
|
||||
_globals['_ROOMROLEFAVORUPDATES2C']._serialized_end=23549
|
||||
_globals['_ROOMROLESTAMINAUPDATES2C']._serialized_start=23551
|
||||
_globals['_ROOMROLESTAMINAUPDATES2C']._serialized_end=23678
|
||||
_globals['_ROOMROLETODAYDANCEUPDATES2C']._serialized_start=23680
|
||||
_globals['_ROOMROLETODAYDANCEUPDATES2C']._serialized_end=23791
|
||||
_globals['_ROOMSETDILATIONC2S']._serialized_start=23793
|
||||
_globals['_ROOMSETDILATIONC2S']._serialized_end=23887
|
||||
_globals['_ROOMTASKSTEPUPDATES2C']._serialized_start=23890
|
||||
_globals['_ROOMTASKSTEPUPDATES2C']._serialized_end=24025
|
||||
_globals['_ROOMTASKUPDATEFULLS2C']._serialized_start=24028
|
||||
_globals['_ROOMTASKUPDATEFULLS2C']._serialized_end=24156
|
||||
_globals['_ROOMTODAYFAVORUPDATES2C']._serialized_start=24158
|
||||
_globals['_ROOMTODAYFAVORUPDATES2C']._serialized_end=24265
|
||||
_globals['_ROOMUSEITEMS2C']._serialized_start=24267
|
||||
_globals['_ROOMUSEITEMS2C']._serialized_end=24380
|
||||
_globals['_ROOMWORNCLOTHESUPDATES2C']._serialized_start=24383
|
||||
_globals['_ROOMWORNCLOTHESUPDATES2C']._serialized_end=24538
|
||||
_globals['_SANITYFULLS2C']._serialized_start=24541
|
||||
_globals['_SANITYFULLS2C']._serialized_end=24681
|
||||
_globals['_SANITYREWARDREQ']._serialized_start=24683
|
||||
_globals['_SANITYREWARDREQ']._serialized_end=24700
|
||||
_globals['_SANITYREWARDRSP']._serialized_start=24702
|
||||
_globals['_SANITYREWARDRSP']._serialized_end=24811
|
||||
_globals['_SETCLIENTLANGUAGEREQ']._serialized_start=24813
|
||||
_globals['_SETCLIENTLANGUAGEREQ']._serialized_end=24853
|
||||
_globals['_SETCLIENTLANGUAGERSP']._serialized_start=24855
|
||||
_globals['_SETCLIENTLANGUAGERSP']._serialized_end=24919
|
||||
_globals['_SETCURDILATIONLEVELREQ']._serialized_start=24921
|
||||
_globals['_SETCURDILATIONLEVELREQ']._serialized_end=24945
|
||||
_globals['_SETCURDILATIONLEVELRSP']._serialized_start=24947
|
||||
_globals['_SETCURDILATIONLEVELRSP']._serialized_end=25013
|
||||
_globals['_SETCURHEADREQ']._serialized_start=25015
|
||||
_globals['_SETCURHEADREQ']._serialized_end=25051
|
||||
_globals['_SETCURHEADRSP']._serialized_start=25053
|
||||
_globals['_SETCURHEADRSP']._serialized_end=25110
|
||||
_globals['_SETCURROLEREQ']._serialized_start=25112
|
||||
_globals['_SETCURROLEREQ']._serialized_end=25146
|
||||
_globals['_SETCURROLERSP']._serialized_start=25148
|
||||
_globals['_SETCURROLERSP']._serialized_end=25205
|
||||
_globals['_SETCURTITLEREQUESTREQ']._serialized_start=25207
|
||||
_globals['_SETCURTITLEREQUESTREQ']._serialized_end=25277
|
||||
_globals['_SETCURTITLEREQUESTRSP']._serialized_start=25279
|
||||
_globals['_SETCURTITLEREQUESTRSP']._serialized_end=25344
|
||||
_globals['_SETDEFAULTBATTLEPASSREQ']._serialized_start=25346
|
||||
_globals['_SETDEFAULTBATTLEPASSREQ']._serialized_end=25383
|
||||
_globals['_SETDEFAULTBATTLEPASSRSP']._serialized_start=25385
|
||||
_globals['_SETDEFAULTBATTLEPASSRSP']._serialized_end=25452
|
||||
_globals['_SETINTERESTFORPARTSSHOPITEMREQ']._serialized_start=25454
|
||||
_globals['_SETINTERESTFORPARTSSHOPITEMREQ']._serialized_end=25525
|
||||
_globals['_SETINTERESTFORPARTSSHOPITEMRSP']._serialized_start=25527
|
||||
_globals['_SETINTERESTFORPARTSSHOPITEMRSP']._serialized_end=25643
|
||||
_globals['_SETROLEAPPEARANCEREQ']._serialized_start=25645
|
||||
_globals['_SETROLEAPPEARANCEREQ']._serialized_end=25738
|
||||
_globals['_SETROLEAPPEARANCERSP']._serialized_start=25740
|
||||
_globals['_SETROLEAPPEARANCERSP']._serialized_end=25804
|
||||
_globals['_SHOPUPDATEFULLS2C']._serialized_start=25806
|
||||
_globals['_SHOPUPDATEFULLS2C']._serialized_end=25907
|
||||
_globals['_SIGNINREWARDREQ']._serialized_start=25909
|
||||
_globals['_SIGNINREWARDREQ']._serialized_end=25926
|
||||
_globals['_SIGNINREWARDRSP']._serialized_start=25928
|
||||
_globals['_SIGNINREWARDRSP']._serialized_end=26026
|
||||
_globals['_TASKCELL']._serialized_start=26028
|
||||
_globals['_TASKCELL']._serialized_end=26154
|
||||
_globals['_TASKENTRY']._serialized_start=26156
|
||||
_globals['_TASKENTRY']._serialized_end=26251
|
||||
_globals['_TASKSTEPUPDATES2C']._serialized_start=26253
|
||||
_globals['_TASKSTEPUPDATES2C']._serialized_end=26365
|
||||
_globals['_TASKUPDATEENTRY']._serialized_start=26367
|
||||
_globals['_TASKUPDATEENTRY']._serialized_end=26434
|
||||
_globals['_TASKUPDATEFULLS2C']._serialized_start=26436
|
||||
_globals['_TASKUPDATEFULLS2C']._serialized_end=26561
|
||||
_globals['_TOUCHROLEREQ']._serialized_start=26563
|
||||
_globals['_TOUCHROLEREQ']._serialized_end=26618
|
||||
_globals['_TOUCHROLERSP']._serialized_start=26620
|
||||
_globals['_TOUCHROLERSP']._serialized_end=26676
|
||||
_globals['_UECANCELQUEUEWAITREQ']._serialized_start=26678
|
||||
_globals['_UECANCELQUEUEWAITREQ']._serialized_end=26718
|
||||
_globals['_UECANCELQUEUEWAITRSP']._serialized_start=26720
|
||||
_globals['_UECANCELQUEUEWAITRSP']._serialized_end=26784
|
||||
_globals['_UECANCELROOMENTERREQ']._serialized_start=26786
|
||||
_globals['_UECANCELROOMENTERREQ']._serialized_end=26808
|
||||
_globals['_UECANCELROOMENTERRSP']._serialized_start=26810
|
||||
_globals['_UECANCELROOMENTERRSP']._serialized_end=26874
|
||||
_globals['_UEGETROOMREQ']._serialized_start=26877
|
||||
_globals['_UEGETROOMREQ']._serialized_end=27011
|
||||
_globals['_UEGETROOMRSP']._serialized_start=27013
|
||||
_globals['_UEGETROOMRSP']._serialized_end=27133
|
||||
_globals['_UEPLAYERLEAVEC2S']._serialized_start=27135
|
||||
_globals['_UEPLAYERLEAVEC2S']._serialized_end=27213
|
||||
_globals['_UEPLAYERLOGINREQ']._serialized_start=27215
|
||||
_globals['_UEPLAYERLOGINREQ']._serialized_end=27292
|
||||
_globals['_UEPLAYERLOGINRSP']._serialized_start=27295
|
||||
_globals['_UEPLAYERLOGINRSP']._serialized_end=27545
|
||||
_globals['_UEPLAYERLOGINRSP_RECOGNITIONENTRY']._serialized_start=583
|
||||
_globals['_UEPLAYERLOGINRSP_RECOGNITIONENTRY']._serialized_end=633
|
||||
_globals['_UEPLAYERNETWORKSTATECHANGEC2S']._serialized_start=27547
|
||||
_globals['_UEPLAYERNETWORKSTATECHANGEC2S']._serialized_end=27653
|
||||
_globals['_UESERVERLOGINREQ']._serialized_start=27656
|
||||
_globals['_UESERVERLOGINREQ']._serialized_end=27937
|
||||
_globals['_UESERVERLOGINRSP']._serialized_start=27939
|
||||
_globals['_UESERVERLOGINRSP']._serialized_end=28023
|
||||
_globals['_UESYNCPLAYERC2S']._serialized_start=28025
|
||||
_globals['_UESYNCPLAYERC2S']._serialized_end=28061
|
||||
_globals['_UPGRADEROLEFAVORLVREQ']._serialized_start=28063
|
||||
_globals['_UPGRADEROLEFAVORLVREQ']._serialized_end=28105
|
||||
_globals['_UPGRADEROLEFAVORLVRSP']._serialized_start=28107
|
||||
_globals['_UPGRADEROLEFAVORLVRSP']._serialized_end=28172
|
||||
_globals['_USEITEMREQ']._serialized_start=28174
|
||||
_globals['_USEITEMREQ']._serialized_end=28264
|
||||
_globals['_USEITEMRSP']._serialized_start=28266
|
||||
_globals['_USEITEMRSP']._serialized_end=28320
|
||||
_globals['_VERIFYLOGINTOKENEXTS2C']._serialized_start=28323
|
||||
_globals['_VERIFYLOGINTOKENEXTS2C']._serialized_end=28508
|
||||
_globals['_VERIFYLOGINTOKENREQ']._serialized_start=28510
|
||||
_globals['_VERIFYLOGINTOKENREQ']._serialized_end=28615
|
||||
_globals['_VERIFYLOGINTOKENRSP']._serialized_start=28618
|
||||
_globals['_VERIFYLOGINTOKENRSP']._serialized_end=28808
|
||||
_globals['_WELFAREINFOFULLS2C']._serialized_start=28810
|
||||
_globals['_WELFAREINFOFULLS2C']._serialized_end=28919
|
||||
_globals['_WORNCLOTHESUPDATES2C']._serialized_start=28922
|
||||
_globals['_WORNCLOTHESUPDATES2C']._serialized_end=29054
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
Binary file not shown.
@@ -0,0 +1,209 @@
|
||||
// protocol_decoder.js - Read-only hook on the game's network wrapper.
|
||||
//
|
||||
// Fires onLeave only: reads the processed buffer at r9 (length r8d) and
|
||||
// forwards it to Python together with the this-pointer identity, stream
|
||||
// byte-offset from [this+0xA0], and the direction flag from [this+0x60].
|
||||
// Python owns all reassembly, protobuf parsing, and logging.
|
||||
//
|
||||
// We intentionally do NOT modify the buffer, and we do NOT read on enter:
|
||||
// at onLeave the wrapper has completed so r9 holds plaintext (decrypt path)
|
||||
// or plaintext-before-encrypt... actually both paths leave plaintext visible
|
||||
// at some point around the wrapper, but the outgoing path writes ciphertext
|
||||
// over plaintext. To stay single-code-path and read-only we capture the
|
||||
// input side by latching r9's bytes onEnter into a JS buffer, and emit both
|
||||
// pre+post so the Python side picks whichever one looks like protobuf.
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var MOD_NAME = 'Paralogue-Win64-Shipping.exe';
|
||||
// Decrypt-side wrapper: called AFTER ciphertext has been XOR'd to
|
||||
// plaintext in place. Reading the buffer onLeave gives S->C plaintext.
|
||||
var DECRYPT_RVA = 0x49A2EB0;
|
||||
// Pre-send helper: called with the fully-assembled plaintext send
|
||||
// buffer right before encryption. Reading it onEnter gives C->S
|
||||
// plaintext. Per IDA the prototype is
|
||||
// sub_1449CEA90(this, _DWORD *buf_ptr_ptr, int off=0, uint len)
|
||||
// so rcx=this, rdx=&buffer_ptr, r8=offset (0), r9=total_length.
|
||||
var SEND_RVA = 0x49CEA90;
|
||||
|
||||
var mod = Process.getModuleByName(MOD_NAME);
|
||||
if (!mod) {
|
||||
send({ t: 'error', msg: 'module not found: ' + MOD_NAME });
|
||||
return;
|
||||
}
|
||||
var decryptWrapper = mod.base.add(DECRYPT_RVA);
|
||||
var sendWrapper = mod.base.add(SEND_RVA);
|
||||
|
||||
var callCount = 0;
|
||||
var sendCount = 0;
|
||||
|
||||
// Capture ChaCha20 session material from every cipher context we see.
|
||||
// There are likely two contexts (one per direction); we emit once per
|
||||
// unique this-pointer so the Python side can build a per-direction map.
|
||||
// [this+0x60] byte -> encryption-enabled flag
|
||||
// [this+0x68] ptr -> 32B key (shared both directions)
|
||||
// [this+0x78] ptr -> 12B nonce (shared both directions)
|
||||
// [this+0x88] ptr -> encrypt EVP context (C->S)
|
||||
// [this+0x90] ptr -> decrypt EVP context (S->C)
|
||||
// [this+0x98] uint64-> encrypt stream byte counter (C->S)
|
||||
// [this+0xA0] uint64-> decrypt stream byte counter (S->C)
|
||||
// Re-emit the key whenever we see a fresh context (stream offset 0)
|
||||
// OR the key bytes change. Game pools cipher-context pointers across
|
||||
// reconnects, so a single this_id can host multiple distinct keys
|
||||
// over its lifetime.
|
||||
var lastKeyByCtx = {};
|
||||
function maybeEmitKey(thisPtr) {
|
||||
var id = thisPtr.toString();
|
||||
try {
|
||||
var keyPtr = thisPtr.add(0x68).readPointer();
|
||||
var noncePtr = thisPtr.add(0x78).readPointer();
|
||||
if (keyPtr.isNull() || noncePtr.isNull()) return;
|
||||
var key = keyPtr.readByteArray(32);
|
||||
var nonce = noncePtr.readByteArray(12);
|
||||
var offDec = Number(thisPtr.add(0xA0).readU64());
|
||||
var offEnc = Number(thisPtr.add(0x98).readU64());
|
||||
var flag = thisPtr.add(0x60).readU8();
|
||||
var keyHex = Array.prototype.map.call(new Uint8Array(key),
|
||||
function (b) { return ('0' + b.toString(16)).slice(-2); }).join('');
|
||||
// Skip if we've already emitted this exact key for this ctx.
|
||||
if (lastKeyByCtx[id] === keyHex) return;
|
||||
lastKeyByCtx[id] = keyHex;
|
||||
send({
|
||||
t: 'session_key',
|
||||
this_id: id,
|
||||
flag: flag,
|
||||
offset: offDec,
|
||||
offset_enc: offEnc,
|
||||
offset_dec: offDec,
|
||||
key_hex: keyHex,
|
||||
nonce_hex: Array.prototype.map.call(new Uint8Array(nonce),
|
||||
function (b) { return ('0' + b.toString(16)).slice(-2); }).join('')
|
||||
});
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
|
||||
function readThisU8(thisPtr, off) {
|
||||
try { return thisPtr.add(off).readU8(); } catch (e) { return -1; }
|
||||
}
|
||||
function readThisU64(thisPtr, off) {
|
||||
try { return Number(thisPtr.add(off).readU64()); } catch (e) { return -1; }
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// OUTGOING hook: capture plaintext sent C->S before encryption.
|
||||
// -----------------------------------------------------------------
|
||||
Interceptor.attach(sendWrapper, {
|
||||
onEnter: function (args) {
|
||||
var len = this.context.r9.toInt32();
|
||||
if (len <= 0 || len > (1 << 20)) return;
|
||||
var bufPtrPtr = this.context.rdx;
|
||||
var bufPtr;
|
||||
try {
|
||||
bufPtr = bufPtrPtr.readPointer();
|
||||
} catch (e) { return; }
|
||||
if (bufPtr.isNull()) return;
|
||||
var bytes;
|
||||
try {
|
||||
bytes = bufPtr.readByteArray(len);
|
||||
} catch (e) { return; }
|
||||
|
||||
sendCount++;
|
||||
send({
|
||||
t: 'chunk',
|
||||
source: 'send',
|
||||
n: sendCount,
|
||||
this_id: this.context.rcx.toString(),
|
||||
off: 0,
|
||||
len: len,
|
||||
enc: 0
|
||||
}, bytes);
|
||||
}
|
||||
});
|
||||
|
||||
Interceptor.attach(decryptWrapper, {
|
||||
onEnter: function (args) {
|
||||
var dataLen = this.context.r8.toInt32();
|
||||
if (dataLen <= 0 || dataLen > (1 << 20)) { this._skip = true; return; }
|
||||
this._skip = false;
|
||||
|
||||
var thisPtr = this.context.rcx;
|
||||
var dataPtr = this.context.r9;
|
||||
|
||||
// Emit the session key/nonce the first time we see this context.
|
||||
maybeEmitKey(thisPtr);
|
||||
|
||||
this._n = ++callCount;
|
||||
this._thisId = thisPtr.toString();
|
||||
this._dataPtr = dataPtr;
|
||||
this._dataLen = dataLen;
|
||||
this._streamOff = readThisU64(thisPtr, 0xA0);
|
||||
this._encFlag = readThisU8(thisPtr, 0x60);
|
||||
|
||||
// Latch the input bytes (ciphertext on decrypt path,
|
||||
// plaintext on encrypt path -- Python decides).
|
||||
try {
|
||||
this._inBytes = dataPtr.readByteArray(dataLen);
|
||||
} catch (e) {
|
||||
this._inBytes = null;
|
||||
}
|
||||
},
|
||||
onLeave: function (retval) {
|
||||
if (this._skip) return;
|
||||
|
||||
var outBytes = null;
|
||||
try {
|
||||
outBytes = this._dataPtr.readByteArray(this._dataLen);
|
||||
} catch (e) { }
|
||||
|
||||
// Empirical observation: the wrapper's `onLeave` buffer always
|
||||
// contains plaintext regardless of direction -- the game's
|
||||
// decrypt-and-dispatch path leaves plaintext in r9 for both
|
||||
// send-preparation and recv-delivery. We forward `outBytes`
|
||||
// and also attach the pre-bytes for fallback if plaintext
|
||||
// detection fails on the Python side (detected by protobuf
|
||||
// parsing: ciphertext will consistently fail to match any
|
||||
// known message type, while plaintext parses cleanly).
|
||||
var primary = outBytes;
|
||||
if (!primary) return;
|
||||
|
||||
send({
|
||||
t: 'chunk',
|
||||
n: this._n,
|
||||
this_id: this._thisId,
|
||||
off: this._streamOff,
|
||||
len: this._dataLen,
|
||||
enc: this._encFlag
|
||||
}, primary);
|
||||
|
||||
// Also emit the keystream so the MITM proxy can decrypt wire
|
||||
// traffic without needing the actual ChaCha20 key schedule.
|
||||
// keystream = input_bytes XOR output_bytes
|
||||
// Both directions of the game's wrapper run the same cipher
|
||||
// state against their buffers; XORing pre/post gives the pad.
|
||||
if (this._inBytes) {
|
||||
var inArr = new Uint8Array(this._inBytes);
|
||||
var outArr = new Uint8Array(outBytes);
|
||||
var n = Math.min(inArr.length, outArr.length);
|
||||
var ks = new Uint8Array(n);
|
||||
for (var i = 0; i < n; i++) ks[i] = inArr[i] ^ outArr[i];
|
||||
send({
|
||||
t: 'keystream',
|
||||
off: this._streamOff,
|
||||
len: n
|
||||
}, ks.buffer);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setInterval(function () {
|
||||
send({ t: 'status', calls: callCount });
|
||||
}, 5000);
|
||||
|
||||
send({
|
||||
t: 'ready',
|
||||
msg: 'decoder hooks installed at recv=0x' + DECRYPT_RVA.toString(16)
|
||||
+ ' send=0x' + SEND_RVA.toString(16),
|
||||
base: mod.base.toString()
|
||||
});
|
||||
})();
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
redirect_and_capture.py - Attach to game, redirect port 11001 to local proxy.
|
||||
Run this AFTER the game is started but BEFORE it connects to the game server.
|
||||
The TCP proxy (tcp_proxy.py) must be running on 127.0.0.1:11001.
|
||||
"""
|
||||
import frida, time, sys, os
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
JS_PATH = os.path.join(SCRIPT_DIR, 'redirect_connect.js')
|
||||
PROCESS = 'Paralogue-Win64-Shipping.exe'
|
||||
|
||||
with open(JS_PATH) as f:
|
||||
js_code = f.read()
|
||||
|
||||
def on_message(message, data):
|
||||
p = message.get('payload', {})
|
||||
if isinstance(p, dict):
|
||||
t = p.get('t', '')
|
||||
if t == 'ready':
|
||||
print(f'[*] {p["msg"]}')
|
||||
elif t == 'redirect':
|
||||
print(f'[+] REDIRECTED {p["from"]}:{p["port"]} -> {p["to"]}:{p["port"]}')
|
||||
elif t == 'error':
|
||||
print(f'[!] {p["msg"]}')
|
||||
elif message['type'] == 'error':
|
||||
print(f'[!] {message["description"]}')
|
||||
|
||||
print(f'[*] Waiting for {PROCESS}...')
|
||||
while True:
|
||||
try:
|
||||
session = frida.attach(PROCESS)
|
||||
print(f'[*] Attached to {PROCESS}')
|
||||
break
|
||||
except frida.ProcessNotFoundError:
|
||||
time.sleep(1)
|
||||
except Exception as e:
|
||||
print(f'[!] {e}')
|
||||
time.sleep(2)
|
||||
|
||||
script = session.create_script(js_code)
|
||||
script.on('message', on_message)
|
||||
script.load()
|
||||
|
||||
print('[*] Hooks active. When the game connects to port 11001, it will be redirected.')
|
||||
print('[*] Press Ctrl+C to detach.')
|
||||
|
||||
try:
|
||||
while True:
|
||||
time.sleep(1)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
session.detach()
|
||||
print('[*] Detached.')
|
||||
@@ -0,0 +1,46 @@
|
||||
// redirect_connect.js - Redirect game server connections to local proxy
|
||||
// Hooks ws2_32!connect and changes destination IP to 127.0.0.1 for port 11001
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
var REDIRECT_PORT = 11001;
|
||||
var REDIRECT_TO_IP = [127, 0, 0, 1];
|
||||
|
||||
var ws2 = Process.getModuleByName('ws2_32.dll');
|
||||
var connectAddr = null;
|
||||
ws2.enumerateExports().forEach(function(e) {
|
||||
if (e.name === 'connect') connectAddr = e.address;
|
||||
});
|
||||
|
||||
if (!connectAddr) {
|
||||
send({t: 'error', msg: 'connect not found'});
|
||||
return;
|
||||
}
|
||||
|
||||
Interceptor.attach(connectAddr, {
|
||||
onEnter: function(args) {
|
||||
var addr = args[1];
|
||||
var family = addr.readU16();
|
||||
if (family !== 2) return; // AF_INET only
|
||||
|
||||
var port = (addr.add(2).readU8() << 8) | addr.add(3).readU8();
|
||||
if (port !== REDIRECT_PORT) return;
|
||||
|
||||
var origIp = addr.add(4).readU8() + '.' +
|
||||
addr.add(5).readU8() + '.' +
|
||||
addr.add(6).readU8() + '.' +
|
||||
addr.add(7).readU8();
|
||||
|
||||
// Rewrite IP to 127.0.0.1
|
||||
addr.add(4).writeU8(REDIRECT_TO_IP[0]);
|
||||
addr.add(5).writeU8(REDIRECT_TO_IP[1]);
|
||||
addr.add(6).writeU8(REDIRECT_TO_IP[2]);
|
||||
addr.add(7).writeU8(REDIRECT_TO_IP[3]);
|
||||
|
||||
send({t: 'redirect', from: origIp, port: port, to: '127.0.0.1'});
|
||||
}
|
||||
});
|
||||
|
||||
send({t: 'ready', msg: 'connect() hook installed. Port ' + REDIRECT_PORT + ' will be redirected to 127.0.0.1'});
|
||||
})();
|
||||
@@ -0,0 +1,138 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
run_chacha_capture.py - Capture ChaCha20 session keys from game process.
|
||||
Attaches to running game and hooks the ChaCha20 implementation to extract keys.
|
||||
The captured key+nonce can then be used by the MITM proxy to decrypt traffic.
|
||||
"""
|
||||
|
||||
import frida
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import json
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
JS_PATH = os.path.join(SCRIPT_DIR, 'capture_chacha_key.js')
|
||||
PROCESS_NAME = 'Paralogue-Win64-Shipping.exe'
|
||||
OUTPUT_DIR = os.path.join(SCRIPT_DIR, 'captures')
|
||||
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
||||
|
||||
KEY_FILE = os.path.join(OUTPUT_DIR, 'chacha_session_key.json')
|
||||
|
||||
captured_keys = []
|
||||
chacha_states = []
|
||||
|
||||
|
||||
def on_message(message, data):
|
||||
if message['type'] == 'error':
|
||||
print(f'[!] {message["description"]}')
|
||||
return
|
||||
|
||||
p = message.get('payload', {})
|
||||
if not isinstance(p, dict):
|
||||
return
|
||||
|
||||
t = p.get('t', '')
|
||||
|
||||
if t == 'ready':
|
||||
print(f'[*] {p["msg"]}')
|
||||
elif t == 'info':
|
||||
print(f'[*] {p["msg"]}')
|
||||
elif t == 'status':
|
||||
print(f'[*] Status: {p["calls"]} ChaCha20 calls, {p["unique_keys"]} unique keys')
|
||||
elif t in ('chacha_key', 'chacha_key_avx'):
|
||||
src = 'AVX' if t == 'chacha_key_avx' else 'ENTRY'
|
||||
key = p['key']
|
||||
nonce = p['nonce']
|
||||
counter = p['counter']
|
||||
r8 = p.get('r8_data', 'N/A')
|
||||
call_num = p.get('call_num', 0)
|
||||
|
||||
print(f'\n{"="*60}')
|
||||
print(f' *** ChaCha20 KEY CAPTURED ({src}) ***')
|
||||
print(f' Call #{call_num}')
|
||||
print(f' Key (32B): {key}')
|
||||
print(f' Nonce (12B): {nonce}')
|
||||
print(f' Counter: {counter}')
|
||||
if r8 != 'N/A':
|
||||
print(f' r8 data: {r8}')
|
||||
print(f'{"="*60}\n')
|
||||
|
||||
entry = {
|
||||
'source': src,
|
||||
'key_hex': key,
|
||||
'nonce_hex': nonce,
|
||||
'counter_hex': counter,
|
||||
'r8_data': r8,
|
||||
'call_num': call_num,
|
||||
'timestamp': time.time()
|
||||
}
|
||||
captured_keys.append(entry)
|
||||
|
||||
# Save immediately
|
||||
with open(KEY_FILE, 'w') as f:
|
||||
json.dump(captured_keys, f, indent=2)
|
||||
print(f' Saved to {KEY_FILE}')
|
||||
|
||||
elif t == 'chacha_state' and data:
|
||||
raw = bytes(data)
|
||||
chacha_states.append(raw)
|
||||
state_file = os.path.join(OUTPUT_DIR, f'chacha_state_{len(chacha_states)}.bin')
|
||||
with open(state_file, 'wb') as f:
|
||||
f.write(raw)
|
||||
print(f' State binary saved to {state_file}')
|
||||
|
||||
|
||||
def main():
|
||||
print('=' * 60)
|
||||
print(' ChaCha20 Key Capture Tool')
|
||||
print(' Attach to game and capture encryption keys at runtime')
|
||||
print('=' * 60)
|
||||
|
||||
with open(JS_PATH, 'r') as f:
|
||||
js_code = f.read()
|
||||
|
||||
# Find the game process
|
||||
session = None
|
||||
print(f'[*] Looking for {PROCESS_NAME}...')
|
||||
while True:
|
||||
try:
|
||||
device = frida.get_local_device()
|
||||
for proc in device.enumerate_processes():
|
||||
if proc.name == PROCESS_NAME:
|
||||
print(f'[*] Found {PROCESS_NAME} (PID {proc.pid}), attaching...')
|
||||
session = frida.attach(proc.pid)
|
||||
break
|
||||
if session:
|
||||
break
|
||||
except frida.ProcessNotFoundError:
|
||||
pass
|
||||
except Exception as e:
|
||||
print(f'[!] {e}')
|
||||
time.sleep(1)
|
||||
|
||||
print(f'[*] Attached. Installing ChaCha20 hooks...')
|
||||
script = session.create_script(js_code)
|
||||
script.on('message', on_message)
|
||||
script.load()
|
||||
|
||||
print('[*] Hooks active. Connect to a server in-game to trigger encryption.')
|
||||
print('[*] Keys will be saved to captures/chacha_session_key.json')
|
||||
print('[*] Press Ctrl+C to stop.\n')
|
||||
|
||||
try:
|
||||
while True:
|
||||
time.sleep(0.5)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
print(f'\n[*] Captured {len(captured_keys)} unique keys.')
|
||||
if captured_keys:
|
||||
print(f'[*] Keys saved to {KEY_FILE}')
|
||||
|
||||
session.detach()
|
||||
print('[*] Done.')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,828 @@
|
||||
#!/usr/bin/env python3
|
||||
"""run_decoder.py - real-time protocol decoder for Paralogue (Fallen Doll).
|
||||
|
||||
Attaches Frida to Paralogue-Win64-Shipping.exe, loads protocol_decoder.js
|
||||
(a read-only onLeave hook on the encrypt/decrypt wrapper at RVA 0x49A2EB0),
|
||||
reassembles the [2B length-prefix][PacketHead][body] framing, and then:
|
||||
|
||||
* parses each PacketHead to obtain msg_id and body_len
|
||||
* identifies msg_id -> protobuf message-type by trying all 239 known types
|
||||
from paralogue_net_full_pb2 and scoring the parses
|
||||
* writes one JSON line per message to captures/session_<ts>.jsonl
|
||||
* prints a human-readable conversation log
|
||||
|
||||
Usage
|
||||
python run_decoder.py # decode only
|
||||
python run_decoder.py --redirect # also load redirect_connect.js
|
||||
|
||||
Author: protocol research tool; instrumentation is read-only.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Optional
|
||||
|
||||
import frida
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, SCRIPT_DIR)
|
||||
|
||||
import paralogue_net_full_pb2 as pb_mod # noqa: E402
|
||||
|
||||
from google.protobuf.message import DecodeError # noqa: E402
|
||||
|
||||
PROCESS_NAME = "Paralogue-Win64-Shipping.exe"
|
||||
DECODER_JS = os.path.join(SCRIPT_DIR, "protocol_decoder.js")
|
||||
REDIRECT_JS = os.path.join(SCRIPT_DIR, "redirect_connect.js")
|
||||
OUT_DIR = os.path.join(SCRIPT_DIR, "captures")
|
||||
os.makedirs(OUT_DIR, exist_ok=True)
|
||||
KEYSTREAM_PATH = os.path.join(OUT_DIR, "keystream.bin")
|
||||
|
||||
# User-editable known-good mappings discovered from research.
|
||||
# Lines are loaded on startup and used as strong hints (any type here
|
||||
# outranks heuristic matches). This file is rewritten when the decoder
|
||||
# discovers new high-confidence mappings.
|
||||
KNOWN_IDS_PATH = os.path.join(SCRIPT_DIR, "known_msg_ids.json")
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# protobuf catalog + msg_id identification
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def _build_catalog():
|
||||
"""Return (list of (name, descriptor, message_class)) for all types."""
|
||||
fd = pb_mod.DESCRIPTOR
|
||||
out = []
|
||||
for name, desc in fd.message_types_by_name.items():
|
||||
cls = getattr(pb_mod, name, None)
|
||||
if cls is None:
|
||||
continue
|
||||
out.append((name, desc, cls))
|
||||
return out
|
||||
|
||||
|
||||
CATALOG = _build_catalog()
|
||||
PACKET_HEAD_CLS = pb_mod.PacketHead
|
||||
|
||||
|
||||
def _score_fit(msg, body: bytes, desc) -> int:
|
||||
"""Score how well `msg` (parsed from `body`) fits the descriptor.
|
||||
|
||||
Strategy:
|
||||
* require at least one field set (wire bytes are not empty yet type has
|
||||
no matching fields -> protobuf stored them as unknown -> score 0)
|
||||
* re-serialize; exact byte-equality = huge bonus (canonical round-trip)
|
||||
* length-equality = smaller bonus
|
||||
* validate that declared `string` fields are valid UTF-8 (protobuf's
|
||||
pure-python decoder does not always enforce this; the C++ decoder does,
|
||||
but we check anyway for cross-platform consistency)
|
||||
* penalise large unknown-field byte counts
|
||||
"""
|
||||
try:
|
||||
set_fields = msg.ListFields()
|
||||
except Exception:
|
||||
return 0
|
||||
if not set_fields:
|
||||
return 0
|
||||
|
||||
score = len(set_fields) * 2
|
||||
|
||||
# 1. Round-trip check
|
||||
try:
|
||||
rt = msg.SerializeToString()
|
||||
except Exception:
|
||||
rt = b""
|
||||
if rt == body:
|
||||
score += 100 # canonical fit -- almost certainly the right type
|
||||
elif rt and len(rt) == len(body):
|
||||
score += 20 # same size but different bytes (ordering differences)
|
||||
elif rt:
|
||||
# how close is the length?
|
||||
ratio = min(len(rt), len(body)) / max(len(rt), len(body))
|
||||
score += int(ratio * 10)
|
||||
|
||||
# 2. Unknown fields: wire bytes we couldn't assign to any declared field.
|
||||
# If serializing loses lots of bytes, the type is a poor fit.
|
||||
if rt:
|
||||
missing = max(0, len(body) - len(rt))
|
||||
score -= missing // 4
|
||||
|
||||
# 3. String validation: for every field declared `string`, require UTF-8.
|
||||
TYPE_STRING = 9 # FieldDescriptor.TYPE_STRING
|
||||
TYPE_BYTES = 12
|
||||
NUMERIC_TYPES = {
|
||||
1, 2, # double, float
|
||||
3, 4, # int64, uint64
|
||||
5, # int32
|
||||
6, 7, # fixed64, fixed32
|
||||
13, 14, # uint32, enum
|
||||
15, 16, # sfixed32, sfixed64
|
||||
17, 18, # sint32, sint64
|
||||
}
|
||||
LABEL_REPEATED = 3
|
||||
|
||||
for f, v in set_fields:
|
||||
if f.type == TYPE_STRING:
|
||||
vals = v if f.label == LABEL_REPEATED else [v]
|
||||
for s in vals:
|
||||
if not isinstance(s, str):
|
||||
continue
|
||||
try:
|
||||
s.encode("utf-8")
|
||||
except Exception:
|
||||
score -= 50
|
||||
continue
|
||||
if s and sum(1 for c in s if c.isprintable()) / len(s) >= 0.8:
|
||||
score += 5 # strongly string-like
|
||||
elif s and sum(1 for c in s if c.isprintable()) / len(s) < 0.5:
|
||||
score -= 10
|
||||
|
||||
# Repeated-numeric field whose values all look like ASCII? That's
|
||||
# a packed-int parse of what was really a string. Penalise hard.
|
||||
if f.label == LABEL_REPEATED and f.type in NUMERIC_TYPES and isinstance(v, (list, tuple)) and v:
|
||||
try:
|
||||
ints = [int(x) for x in v]
|
||||
except Exception:
|
||||
ints = []
|
||||
if ints and all(32 <= x <= 126 for x in ints) and len(ints) >= 3:
|
||||
score -= 40
|
||||
|
||||
return score
|
||||
|
||||
|
||||
def identify_body(body: bytes, preferred_name: Optional[str] = None):
|
||||
"""Try to parse `body` against every known message type.
|
||||
|
||||
Returns (best_name, best_msg, best_score, candidates, top) where
|
||||
`top` is a list of (name, score) for the top 3 candidates (for the log).
|
||||
"""
|
||||
if not body:
|
||||
return None, None, 0, 0, []
|
||||
|
||||
scored: list[tuple[int, str, object]] = []
|
||||
|
||||
for name, desc, cls in CATALOG:
|
||||
try:
|
||||
m = cls()
|
||||
m.MergeFromString(body)
|
||||
except (DecodeError, ValueError, Exception):
|
||||
continue
|
||||
score = _score_fit(m, body, desc)
|
||||
if score > 0:
|
||||
scored.append((score, name, m))
|
||||
|
||||
if not scored:
|
||||
return None, None, 0, 0, []
|
||||
|
||||
# preferred (cached) name wins ties
|
||||
scored.sort(key=lambda t: (-t[0], 0 if t[1] == preferred_name else 1, t[1]))
|
||||
if preferred_name:
|
||||
for s, n, m in scored:
|
||||
if n == preferred_name:
|
||||
top = [(nn, ss) for ss, nn, _ in scored[:3]]
|
||||
return n, m, s, len(scored), top
|
||||
|
||||
best_score, best_name, best_msg = scored[0]
|
||||
top = [(nn, ss) for ss, nn, _ in scored[:3]]
|
||||
return best_name, best_msg, best_score, len(scored), top
|
||||
|
||||
|
||||
def msg_to_dict(msg) -> dict:
|
||||
"""Protobuf message -> plain python dict (best-effort, handles bytes)."""
|
||||
from google.protobuf import json_format
|
||||
try:
|
||||
return json_format.MessageToDict(
|
||||
msg,
|
||||
preserving_proto_field_name=True,
|
||||
including_default_value_fields=False,
|
||||
)
|
||||
except Exception:
|
||||
# Fallback: field-by-field
|
||||
out = {}
|
||||
for f, v in msg.ListFields():
|
||||
if isinstance(v, bytes):
|
||||
out[f.name] = v.hex()
|
||||
else:
|
||||
out[f.name] = repr(v)
|
||||
return out
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# per-stream framing reassembler
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@dataclass
|
||||
class Stream:
|
||||
"""One reassembled byte stream (one per (this_id, direction))."""
|
||||
|
||||
this_id: str
|
||||
direction: str # "C->S" or "S->C"
|
||||
chunks: dict = field(default_factory=dict) # offset -> bytes
|
||||
consumed: int = 0 # bytes already emitted as decoded messages
|
||||
frontier: int = 0 # highest contiguous byte available
|
||||
_cache_bytes: bytearray = field(default_factory=bytearray)
|
||||
|
||||
def add(self, off: int, data: bytes) -> None:
|
||||
# On the very first chunk, initialise consumed/frontier to its offset
|
||||
# so we don't scan through thousands of zero-fill bytes from offset 0.
|
||||
if not self.chunks:
|
||||
self.consumed = off
|
||||
self.frontier = off
|
||||
# Grow the cache to cover the end of this chunk, zero-filled.
|
||||
end = off + len(data)
|
||||
if end > len(self._cache_bytes):
|
||||
self._cache_bytes.extend(b"\x00" * (end - len(self._cache_bytes)))
|
||||
self._cache_bytes[off:end] = data
|
||||
self.chunks[off] = len(data)
|
||||
# Update contiguous frontier: walk forward while chunks cover it.
|
||||
f = self.frontier
|
||||
while True:
|
||||
# Find chunk that starts at or before f and extends past f.
|
||||
advanced = False
|
||||
for co, cl in self.chunks.items():
|
||||
if co <= f < co + cl:
|
||||
f = co + cl
|
||||
advanced = True
|
||||
break
|
||||
if not advanced:
|
||||
break
|
||||
self.frontier = f
|
||||
|
||||
def available(self) -> int:
|
||||
return self.frontier - self.consumed
|
||||
|
||||
def peek(self, n: int) -> bytes:
|
||||
return bytes(self._cache_bytes[self.consumed:self.consumed + n])
|
||||
|
||||
def consume(self, n: int) -> bytes:
|
||||
out = bytes(self._cache_bytes[self.consumed:self.consumed + n])
|
||||
self.consumed += n
|
||||
return out
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# framing decoder
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def _load_known_ids() -> dict:
|
||||
if os.path.isfile(KNOWN_IDS_PATH):
|
||||
try:
|
||||
with open(KNOWN_IDS_PATH, "r", encoding="utf-8") as f:
|
||||
raw = json.load(f)
|
||||
# keys are ints (but JSON stores them as strings)
|
||||
return {int(k): v for k, v in raw.items()}
|
||||
except Exception:
|
||||
return {}
|
||||
return {}
|
||||
|
||||
|
||||
def _save_known_ids(m: dict) -> None:
|
||||
try:
|
||||
with open(KNOWN_IDS_PATH, "w", encoding="utf-8") as f:
|
||||
json.dump({str(k): v for k, v in sorted(m.items())}, f, indent=2)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
class Decoder:
|
||||
"""Pull messages out of a reassembled Stream.
|
||||
|
||||
Framing (from RESEARCH.md):
|
||||
[2B BE length-prefix N][N bytes PacketHead protobuf][body_len bytes body]
|
||||
|
||||
The N-byte blob is parseable as a PacketHead and gives msg_id + body_len.
|
||||
"""
|
||||
|
||||
# score threshold above which we consider an identification strong enough
|
||||
# to auto-promote into the persistent known_msg_ids.json cache
|
||||
STRONG_SCORE = 60
|
||||
|
||||
def __init__(self, log_fp, seq_start: int = 1):
|
||||
self.log_fp = log_fp
|
||||
self.seq = seq_start
|
||||
self.msg_id_cache: dict[int, str] = _load_known_ids()
|
||||
self._user_supplied_ids = set(self.msg_id_cache.keys())
|
||||
|
||||
def process_chunk(self, direction: str, off: int, data: bytes) -> None:
|
||||
"""Each chunk is a self-contained packet.
|
||||
|
||||
Strategy:
|
||||
1. Try to parse the leading bytes (4-10 bytes) as a PacketHead; if
|
||||
body_len matches the chunk's total size (TOTAL-bytes semantics)
|
||||
or the chunk has just a header-worth of bytes, emit.
|
||||
2. If leading-bytes parse fails, skip a byte and retry up to 4 times
|
||||
(handles a leading length-prefix or envelope byte).
|
||||
3. Otherwise emit an "unparsed" record so the chunk isn't dropped.
|
||||
"""
|
||||
n = len(data)
|
||||
|
||||
# 1. Try to find a clean PacketHead at a small offset.
|
||||
for skip in range(0, min(4, n - 3)):
|
||||
for hlen in range(4, min(16, n - skip + 1)):
|
||||
hb = data[skip:skip + hlen]
|
||||
head = PACKET_HEAD_CLS()
|
||||
try:
|
||||
head.MergeFromString(hb)
|
||||
except DecodeError:
|
||||
continue
|
||||
try:
|
||||
rt = head.SerializeToString()
|
||||
except Exception:
|
||||
continue
|
||||
if len(rt) != hlen:
|
||||
continue
|
||||
mid = int(head.msg_id)
|
||||
blen = int(head.body_len)
|
||||
if mid <= 0 or mid > 100000:
|
||||
continue
|
||||
# Accept when body_len equals chunk size (TOTAL semantics)
|
||||
# or when the post-header bytes == body_len (body-only).
|
||||
total_match = (blen == n - skip)
|
||||
bodyonly_match = (skip + hlen + blen == n)
|
||||
if not (total_match or bodyonly_match):
|
||||
continue
|
||||
body = (data[skip + hlen:skip + blen] if total_match
|
||||
else data[skip + hlen:skip + hlen + blen])
|
||||
self._emit_packet(direction, off + skip, head, body, skip)
|
||||
return
|
||||
|
||||
# 2. Fallback: emit as raw/unparsed
|
||||
self._emit_raw(direction, off, data)
|
||||
|
||||
def _emit_raw(self, direction: str, off: int, data: bytes) -> None:
|
||||
record = {
|
||||
"seq": self.seq,
|
||||
"direction": direction,
|
||||
"stream_offset": off,
|
||||
"msg_id": None,
|
||||
"msg_type": "<raw-chunk>",
|
||||
"body_len": len(data),
|
||||
"fields": {"_raw_hex": data.hex()},
|
||||
}
|
||||
self.seq += 1
|
||||
self.log_fp.write(json.dumps(record, ensure_ascii=False) + "\n")
|
||||
self.log_fp.flush()
|
||||
# Don't spam stdout for short control-plane chunks.
|
||||
|
||||
def _emit_packet(self, direction: str, off: int, head, body: bytes, skipped: int) -> None:
|
||||
mid = int(head.msg_id)
|
||||
preferred = self.msg_id_cache.get(mid)
|
||||
name, parsed, score, cand, top = identify_body(body, preferred)
|
||||
|
||||
if name and not preferred and score >= self.STRONG_SCORE:
|
||||
self.msg_id_cache[mid] = name
|
||||
if mid not in self._user_supplied_ids:
|
||||
_save_known_ids(self.msg_id_cache)
|
||||
|
||||
if parsed is not None:
|
||||
fields_obj = msg_to_dict(parsed)
|
||||
else:
|
||||
fields_obj = {"_raw_hex": body.hex()}
|
||||
|
||||
record = {
|
||||
"seq": self.seq,
|
||||
"direction": direction,
|
||||
"stream_offset": off,
|
||||
"msg_id": mid,
|
||||
"msg_type": name or "<unknown>",
|
||||
"packet_id": int(head.packet_id),
|
||||
"flag": int(head.flag),
|
||||
"body_len": int(head.body_len),
|
||||
"seq_id": int(head.seq_id),
|
||||
"total_pack_count": int(head.total_pack_count),
|
||||
"identify_score": score,
|
||||
"identify_candidates": cand,
|
||||
"top_candidates": [{"type": n, "score": s} for n, s in top],
|
||||
"skipped_bytes": skipped,
|
||||
"fields": fields_obj,
|
||||
}
|
||||
self.seq += 1
|
||||
|
||||
self.log_fp.write(json.dumps(record, ensure_ascii=False) + "\n")
|
||||
self.log_fp.flush()
|
||||
|
||||
short = _short_repr(fields_obj)
|
||||
print(
|
||||
f"[{record['seq']:04d}] {direction} "
|
||||
f"msg_id={mid:<5d} "
|
||||
f"{record['msg_type']:<28s} "
|
||||
f"body={record['body_len']:>5d}B {short}"
|
||||
)
|
||||
|
||||
def drain(self, stream: Stream) -> int:
|
||||
"""Emit as many complete messages as possible.
|
||||
|
||||
Framing (confirmed against live plaintext captures):
|
||||
[2B BE prefix N][N-byte PacketHead][body_len bytes body]
|
||||
|
||||
Where body_len is the PacketHead.body_len field (body-only size).
|
||||
The PacketHead-length prefix lets us parse the header unambiguously.
|
||||
We also tolerate a stray pattern where the prefix is replaced by a
|
||||
sentinel `00 00` ; in that case we advance one byte and retry.
|
||||
"""
|
||||
emitted = 0
|
||||
while True:
|
||||
avail = stream.available()
|
||||
if avail < 2:
|
||||
return emitted
|
||||
prefix = stream.peek(2)
|
||||
hlen = (prefix[0] << 8) | prefix[1]
|
||||
if hlen == 0 or hlen > 32:
|
||||
# not a sane header length -- skip one byte and retry
|
||||
stream.consume(1)
|
||||
continue
|
||||
if avail < 2 + hlen:
|
||||
return emitted
|
||||
head_bytes = bytes(
|
||||
stream._cache_bytes[stream.consumed + 2:
|
||||
stream.consumed + 2 + hlen]
|
||||
)
|
||||
head = PACKET_HEAD_CLS()
|
||||
try:
|
||||
head.MergeFromString(head_bytes)
|
||||
except DecodeError:
|
||||
stream.consume(1)
|
||||
continue
|
||||
try:
|
||||
rt = head.SerializeToString()
|
||||
except Exception:
|
||||
stream.consume(1)
|
||||
continue
|
||||
if len(rt) != hlen:
|
||||
# header parsed but canonical length differs -- resync
|
||||
stream.consume(1)
|
||||
continue
|
||||
mid = int(head.msg_id)
|
||||
blen = int(head.body_len)
|
||||
if mid <= 0 or mid > 100000 or blen < 0 or blen > (1 << 20):
|
||||
stream.consume(1)
|
||||
continue
|
||||
if avail < 2 + hlen + blen:
|
||||
return emitted
|
||||
|
||||
stream.consume(2 + hlen)
|
||||
body = stream.consume(blen)
|
||||
self._emit(stream, head, body, skipped=0)
|
||||
emitted += 1
|
||||
# (unreachable) -- kept to keep the legacy scan below inert
|
||||
return emitted # type: ignore[unreachable]
|
||||
|
||||
def _unused_scan_path(self, stream: Stream) -> int:
|
||||
emitted = 0
|
||||
while True:
|
||||
avail = stream.available()
|
||||
if avail < 5:
|
||||
return emitted
|
||||
|
||||
base = stream.consumed
|
||||
window = bytes(stream._cache_bytes[base:base + min(avail, 4096)])
|
||||
|
||||
# Score every viable (pos, hlen) candidate and pick the best.
|
||||
best = None # (score, pos, hlen, head, body)
|
||||
for pos in range(0, min(len(window) - 4, 16)):
|
||||
for hlen in range(5, 24):
|
||||
if pos + hlen > len(window):
|
||||
break
|
||||
hb = window[pos:pos + hlen]
|
||||
head = PACKET_HEAD_CLS()
|
||||
try:
|
||||
head.MergeFromString(hb)
|
||||
except DecodeError:
|
||||
continue
|
||||
try:
|
||||
rt = head.SerializeToString()
|
||||
except Exception:
|
||||
continue
|
||||
if len(rt) != hlen:
|
||||
continue
|
||||
mid = int(head.msg_id)
|
||||
blen = int(head.body_len)
|
||||
if mid <= 0 or mid > 100000:
|
||||
continue
|
||||
if blen < 0 or blen > (1 << 20):
|
||||
continue
|
||||
# `body_len` appears to be body-only for login-phase
|
||||
# packets but total-size for ping keepalives. Prefer
|
||||
# body-only (matches RESEARCH.md observations on login)
|
||||
# and fall back to total-size when body-only exceeds
|
||||
# what's available in the current stream window.
|
||||
bodyonly_ok = pos + hlen + blen <= len(window)
|
||||
total_ok = blen >= hlen and pos + blen <= len(window)
|
||||
if bodyonly_ok:
|
||||
body = window[pos + hlen:pos + hlen + blen]
|
||||
consumed_len = pos + hlen + blen
|
||||
elif total_ok:
|
||||
body = window[pos + hlen:pos + blen]
|
||||
consumed_len = pos + blen
|
||||
else:
|
||||
continue
|
||||
|
||||
# Score: prefer headers that explicitly set body_len and
|
||||
# have more set fields; prefer low `pos` (earlier match);
|
||||
# prefer non-empty bodies.
|
||||
score = len(head.ListFields()) * 10
|
||||
if head.HasField("body_len") if False else (blen > 0 or hlen >= 7):
|
||||
score += 20
|
||||
if blen > 0:
|
||||
score += 30
|
||||
score -= pos * 2
|
||||
if best is None or score > best[0]:
|
||||
best = (score, pos, hlen, head, body, consumed_len)
|
||||
if best is not None:
|
||||
_score, pos, hlen, head, body, consumed_len = best
|
||||
|
||||
if best is None:
|
||||
# no packet found in the lookahead; if the window is full,
|
||||
# drop the first byte and try again to resync
|
||||
if avail >= 4096:
|
||||
stream.consume(1)
|
||||
continue
|
||||
return emitted
|
||||
|
||||
stream.consume(consumed_len)
|
||||
self._emit(stream, head, body, skipped=pos)
|
||||
emitted += 1
|
||||
|
||||
def _emit(self, stream: Stream, head, body: bytes, skipped: int = 0) -> None:
|
||||
mid = int(head.msg_id)
|
||||
preferred = self.msg_id_cache.get(mid)
|
||||
name, parsed, score, cand, top = identify_body(body, preferred)
|
||||
|
||||
# Promote high-confidence first-time identifications into the cache.
|
||||
if name and not preferred and score >= self.STRONG_SCORE:
|
||||
self.msg_id_cache[mid] = name
|
||||
if mid not in self._user_supplied_ids:
|
||||
_save_known_ids(self.msg_id_cache)
|
||||
|
||||
if parsed is not None:
|
||||
fields_obj = msg_to_dict(parsed)
|
||||
else:
|
||||
fields_obj = {"_raw_hex": body.hex()}
|
||||
|
||||
record = {
|
||||
"seq": self.seq,
|
||||
"direction": stream.direction,
|
||||
"stream_offset": stream.consumed - len(body),
|
||||
"msg_id": mid,
|
||||
"msg_type": name or "<unknown>",
|
||||
"packet_id": int(head.packet_id),
|
||||
"flag": int(head.flag),
|
||||
"body_len": int(head.body_len),
|
||||
"seq_id": int(head.seq_id),
|
||||
"total_pack_count": int(head.total_pack_count),
|
||||
"identify_score": score,
|
||||
"identify_candidates": cand,
|
||||
"top_candidates": [{"type": n, "score": s} for n, s in top],
|
||||
"skipped_bytes": skipped,
|
||||
"fields": fields_obj,
|
||||
}
|
||||
self.seq += 1
|
||||
|
||||
# JSONL for machine consumption
|
||||
self.log_fp.write(json.dumps(record, ensure_ascii=False) + "\n")
|
||||
self.log_fp.flush()
|
||||
|
||||
# Human-readable line
|
||||
short_fields = _short_repr(fields_obj)
|
||||
print(
|
||||
f"[{record['seq']:04d}] {record['direction']} "
|
||||
f"msg_id={record['msg_id']:<5d} "
|
||||
f"{record['msg_type']:<28s} "
|
||||
f"body={record['body_len']:>5d}B {short_fields}"
|
||||
)
|
||||
|
||||
|
||||
def _short_repr(d) -> str:
|
||||
if isinstance(d, dict):
|
||||
parts = []
|
||||
for k, v in list(d.items())[:4]:
|
||||
if isinstance(v, (dict, list)):
|
||||
parts.append(f"{k}=<{type(v).__name__}>")
|
||||
else:
|
||||
s = str(v)
|
||||
if len(s) > 40:
|
||||
s = s[:37] + "..."
|
||||
parts.append(f"{k}={s}")
|
||||
extra = "" if len(d) <= 4 else f" (+{len(d)-4} more)"
|
||||
return "{" + ", ".join(parts) + "}" + extra
|
||||
return str(d)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# session manager
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
class Session:
|
||||
def __init__(self, log_path: str, raw_log_path: Optional[str] = None):
|
||||
self.log_path = log_path
|
||||
self.log_fp = open(log_path, "w", encoding="utf-8")
|
||||
self._raw_fp = open(raw_log_path, "w", encoding="utf-8") if raw_log_path else None
|
||||
self.streams: dict[tuple[str, int], Stream] = {}
|
||||
self.decoder = Decoder(self.log_fp)
|
||||
self.total_chunks = 0
|
||||
|
||||
def close(self):
|
||||
for fp in (self.log_fp, self._raw_fp):
|
||||
if fp is None:
|
||||
continue
|
||||
try:
|
||||
fp.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def on_chunk(self, meta: dict, data: bytes) -> None:
|
||||
self.total_chunks += 1
|
||||
this_id = meta["this_id"]
|
||||
enc = int(meta.get("enc", 0))
|
||||
off = int(meta.get("off", 0))
|
||||
|
||||
direction = "C->S" if enc == 1 else "S->C"
|
||||
|
||||
if self._raw_fp is not None:
|
||||
rec = {
|
||||
"n": self.total_chunks,
|
||||
"dir": direction,
|
||||
"this": this_id[-8:],
|
||||
"off": off,
|
||||
"len": len(data),
|
||||
"hex": data.hex(),
|
||||
}
|
||||
self._raw_fp.write(json.dumps(rec) + "\n")
|
||||
self._raw_fp.flush()
|
||||
|
||||
# Chunks are fragments of a larger plaintext stream. Accumulate by
|
||||
# (this_id, enc_flag) and drain full messages as framing allows.
|
||||
key = (this_id, enc)
|
||||
stream = self.streams.get(key)
|
||||
if stream is None:
|
||||
stream = Stream(this_id=this_id, direction=direction)
|
||||
self.streams[key] = stream
|
||||
stream.add(off, data)
|
||||
self.decoder.drain(stream)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# frida plumbing
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def attach_and_run(redirect: bool, raw: bool = False) -> None:
|
||||
ts = int(time.time())
|
||||
log_path = os.path.join(OUT_DIR, f"session_{ts}.jsonl")
|
||||
raw_path = os.path.join(OUT_DIR, f"session_{ts}.raw.jsonl") if raw else None
|
||||
session = Session(log_path, raw_path)
|
||||
|
||||
print("=" * 64)
|
||||
print(f" Paralogue protocol decoder")
|
||||
print(f" log: {log_path}")
|
||||
print("=" * 64)
|
||||
|
||||
with open(DECODER_JS, "r", encoding="utf-8") as f:
|
||||
decoder_js = f.read()
|
||||
|
||||
redirect_js = None
|
||||
if redirect:
|
||||
with open(REDIRECT_JS, "r", encoding="utf-8") as f:
|
||||
redirect_js = f.read()
|
||||
|
||||
print(f"[*] waiting for {PROCESS_NAME} ...")
|
||||
frida_session = None
|
||||
while frida_session is None:
|
||||
try:
|
||||
for proc in frida.get_local_device().enumerate_processes():
|
||||
if proc.name == PROCESS_NAME:
|
||||
print(f"[*] attaching to PID {proc.pid}")
|
||||
frida_session = frida.attach(proc.pid)
|
||||
break
|
||||
except Exception as e:
|
||||
print(f"[!] {e}")
|
||||
if frida_session is None:
|
||||
time.sleep(1)
|
||||
|
||||
scripts = []
|
||||
if redirect_js:
|
||||
s = frida_session.create_script(redirect_js)
|
||||
s.on("message", lambda msg, data: _on_redirect_msg(msg))
|
||||
s.load()
|
||||
scripts.append(s)
|
||||
print("[*] redirect hook loaded")
|
||||
|
||||
decoder = frida_session.create_script(decoder_js)
|
||||
|
||||
def on_message(message, data):
|
||||
if message.get("type") == "error":
|
||||
print(f"[!] js error: {message.get('description','')}")
|
||||
return
|
||||
payload = message.get("payload")
|
||||
if not isinstance(payload, dict):
|
||||
return
|
||||
t = payload.get("t")
|
||||
if t == "ready":
|
||||
print(f"[*] {payload.get('msg','')}")
|
||||
elif t == "status":
|
||||
print(f"[*] hook calls so far: {payload.get('calls',0)} | "
|
||||
f"chunks processed: {session.total_chunks} | "
|
||||
f"mapped msg_ids: {len(session.decoder.msg_id_cache)}")
|
||||
elif t == "error":
|
||||
print(f"[!] {payload.get('msg','')}")
|
||||
elif t == "chunk":
|
||||
if data is not None:
|
||||
session.on_chunk(payload, bytes(data))
|
||||
elif t == "keystream":
|
||||
if data is not None:
|
||||
_write_keystream(int(payload.get("off", 0)), bytes(data))
|
||||
|
||||
decoder.on("message", on_message)
|
||||
decoder.load()
|
||||
scripts.append(decoder)
|
||||
print("[*] decoder hook loaded. Connect to a server in-game.")
|
||||
print("[*] Ctrl+C to stop.\n")
|
||||
|
||||
try:
|
||||
while True:
|
||||
time.sleep(0.5)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
finally:
|
||||
print("\n[*] detaching...")
|
||||
try:
|
||||
frida_session.detach()
|
||||
except Exception:
|
||||
pass
|
||||
# Summary
|
||||
print(f"\n[=] session log: {log_path}")
|
||||
print(f"[=] chunks processed: {session.total_chunks}")
|
||||
print(f"[=] messages decoded: {session.decoder.seq - 1}")
|
||||
if session.decoder.msg_id_cache:
|
||||
print(f"[=] msg_id -> type mapping discovered ({len(session.decoder.msg_id_cache)}):")
|
||||
for mid, name in sorted(session.decoder.msg_id_cache.items()):
|
||||
print(f" {mid:<6d} {name}")
|
||||
session.close()
|
||||
|
||||
|
||||
_KS_INIT_DONE = False
|
||||
|
||||
|
||||
def _write_keystream(off: int, data: bytes) -> None:
|
||||
"""Write keystream bytes at the game's absolute stream offset.
|
||||
|
||||
The proxy and the in-process wrapper count the same encrypted payload
|
||||
byte stream (post-handshake), so absolute offsets align between them.
|
||||
Truncates the file on first call so stale cross-session bytes don't
|
||||
poison the proxy.
|
||||
"""
|
||||
global _KS_INIT_DONE
|
||||
if not _KS_INIT_DONE:
|
||||
try:
|
||||
open(KEYSTREAM_PATH, "wb").close()
|
||||
except Exception:
|
||||
pass
|
||||
_KS_INIT_DONE = True
|
||||
try:
|
||||
with open(KEYSTREAM_PATH, "r+b") as f:
|
||||
f.seek(off)
|
||||
f.write(data)
|
||||
except FileNotFoundError:
|
||||
with open(KEYSTREAM_PATH, "wb") as f:
|
||||
f.seek(off)
|
||||
f.write(data)
|
||||
|
||||
|
||||
def _on_redirect_msg(msg):
|
||||
if msg.get("type") == "error":
|
||||
print(f"[!] redirect js error: {msg.get('description','')}")
|
||||
return
|
||||
p = msg.get("payload") or {}
|
||||
t = p.get("t")
|
||||
if t == "ready":
|
||||
print(f"[*] redirect: {p.get('msg','')}")
|
||||
elif t == "redirect":
|
||||
print(f"[*] redirect: {p.get('from','?')}:{p.get('port','?')} -> {p.get('to','?')}")
|
||||
elif t == "error":
|
||||
print(f"[!] redirect: {p.get('msg','')}")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
ap = argparse.ArgumentParser(description="Paralogue protocol decoder")
|
||||
ap.add_argument(
|
||||
"--redirect",
|
||||
action="store_true",
|
||||
help="also load redirect_connect.js to redirect port 11001 to 127.0.0.1",
|
||||
)
|
||||
ap.add_argument(
|
||||
"--raw",
|
||||
action="store_true",
|
||||
help="also write session_<ts>.raw.jsonl with every chunk's hex payload",
|
||||
)
|
||||
args = ap.parse_args()
|
||||
|
||||
attach_and_run(redirect=args.redirect, raw=args.raw)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,207 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
run_key_capture.py - Capture ChaCha20 session key from game.
|
||||
Writes key to captures/chacha_session_key.json for the proxy to read.
|
||||
|
||||
Usage:
|
||||
1. Start tcp_proxy_decrypt.py
|
||||
2. Launch game
|
||||
3. Run this script (attaches to game)
|
||||
4. Connect to server in-game
|
||||
5. Key is captured and saved automatically
|
||||
"""
|
||||
|
||||
import frida
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import json
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
JS_PATH = os.path.join(SCRIPT_DIR, 'capture_session_key.js')
|
||||
PROCESS_NAME = 'Paralogue-Win64-Shipping.exe'
|
||||
OUTPUT_DIR = os.path.join(SCRIPT_DIR, 'captures')
|
||||
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
||||
|
||||
KEY_FILE = os.path.join(OUTPUT_DIR, 'chacha_session_key.json')
|
||||
|
||||
captured_keys = []
|
||||
|
||||
|
||||
def on_message(message, data):
|
||||
if message['type'] == 'error':
|
||||
print(f'[!] {message["description"]}')
|
||||
return
|
||||
|
||||
p = message.get('payload', {})
|
||||
if not isinstance(p, dict):
|
||||
return
|
||||
|
||||
t = p.get('t', '')
|
||||
|
||||
if t == 'ready':
|
||||
print(f'[*] {p["msg"]}')
|
||||
elif t == 'info':
|
||||
print(f'[*] {p["msg"]}')
|
||||
elif t == 'error':
|
||||
print(f'[!] {p["msg"]}')
|
||||
elif t == 'hit':
|
||||
hook = p.get('hook', '?')
|
||||
count = p.get('count', 0)
|
||||
extra = ''
|
||||
if 'rcx' in p:
|
||||
extra = f' rcx={p["rcx"]} rdx={p["rdx"]} r8={p["r8"]}'
|
||||
print(f'[HIT] {hook} #{count}{extra}')
|
||||
elif t == 'status':
|
||||
print(f'[*] Hits: {p.get("hits","none")} | Keys: {p.get("keys",0)}')
|
||||
|
||||
elif t == 'key':
|
||||
key = p.get('key', '')
|
||||
nonce = p.get('nonce', '')
|
||||
callers = p.get('callers', [])
|
||||
print(f'\n[KEY] {key}')
|
||||
print(f' Nonce: {nonce}')
|
||||
if callers:
|
||||
print(f' Callers: {" <- ".join(callers)}')
|
||||
|
||||
entry = {
|
||||
'key_hex': key,
|
||||
'nonce_hex': nonce,
|
||||
'counter_hex': '00000000',
|
||||
'callers': callers,
|
||||
'timestamp': time.time()
|
||||
}
|
||||
captured_keys.append(entry)
|
||||
with open(KEY_FILE, 'w') as f:
|
||||
json.dump(captured_keys, f, indent=2)
|
||||
print(f' -> Saved to {KEY_FILE}')
|
||||
|
||||
elif t == 'packet' and data:
|
||||
n = p.get('n', 0)
|
||||
off = p.get('offset', 0)
|
||||
ln = p.get('len', 0)
|
||||
enc = p.get('enc', 0)
|
||||
plaintext = bytes(data)
|
||||
direction = 'SEND' if enc == 1 else 'RECV'
|
||||
print(f' [{direction}] #{n:3d} off={off:6d} len={ln:5d} pt={plaintext[:24].hex()}{"..." if ln > 24 else ""}')
|
||||
|
||||
# Try parsing as protobuf for interesting messages
|
||||
if ln > 4:
|
||||
try:
|
||||
tag = plaintext[0]
|
||||
fn = tag >> 3
|
||||
wt = tag & 7
|
||||
if fn > 0 and fn < 20 and wt in (0, 2):
|
||||
# Try decode string fields
|
||||
text = ''
|
||||
for b in plaintext:
|
||||
if 32 <= b < 127:
|
||||
text += chr(b)
|
||||
else:
|
||||
text += '.'
|
||||
if any(c.isalpha() for c in text):
|
||||
print(f' ascii: {text[:60]}')
|
||||
except:
|
||||
pass
|
||||
|
||||
elif t == 'keystream' and data:
|
||||
off = p.get('offset', 0)
|
||||
ln = p.get('len', 0)
|
||||
ks = bytes(data)
|
||||
# Save keystream to file incrementally
|
||||
ks_file = os.path.join(OUTPUT_DIR, 'keystream.bin')
|
||||
# Write at correct offset
|
||||
with open(ks_file, 'r+b' if os.path.exists(ks_file) else 'wb') as f:
|
||||
f.seek(off)
|
||||
f.write(ks)
|
||||
|
||||
elif t == 'status':
|
||||
gc = p.get('calls', 0)
|
||||
print(f'[*] {gc} calls')
|
||||
|
||||
elif t == 'chacha_key':
|
||||
key = p['key']
|
||||
nonce = p['nonce']
|
||||
counter = p['counter']
|
||||
callers = p.get('callers', [])
|
||||
elapsed = p.get('elapsed_ms', 0)
|
||||
|
||||
source = p.get('source', '?')
|
||||
is_game = p.get('is_game', False)
|
||||
call_num = p.get('call_num', 0)
|
||||
tag = ' *** GAME SOCKET ***' if is_game else ''
|
||||
print(f'\n{"="*60}')
|
||||
print(f' ChaCha20 KEY #{len(captured_keys)+1} (from {source}, call #{call_num}){tag}')
|
||||
print(f' Key (32B): {key}')
|
||||
print(f' Nonce (12B): {nonce}')
|
||||
print(f' Counter (4B): {counter}')
|
||||
print(f' Callers: {" <- ".join(callers)}')
|
||||
print(f'{"="*60}\n')
|
||||
|
||||
entry = {
|
||||
'key_hex': key,
|
||||
'nonce_hex': nonce,
|
||||
'counter_hex': counter,
|
||||
'source': source,
|
||||
'is_game': is_game,
|
||||
'callers': callers,
|
||||
'timestamp': time.time()
|
||||
}
|
||||
captured_keys.append(entry)
|
||||
|
||||
# Save all keys
|
||||
with open(KEY_FILE, 'w') as f:
|
||||
json.dump(captured_keys, f, indent=2)
|
||||
print(f' -> Saved to {KEY_FILE}')
|
||||
print(f' -> Proxy will auto-load this key')
|
||||
|
||||
elif t == 'chacha_state_bin' and data:
|
||||
raw = bytes(data)
|
||||
idx = len(captured_keys)
|
||||
path = os.path.join(OUTPUT_DIR, f'chacha_state_{idx}.bin')
|
||||
with open(path, 'wb') as f:
|
||||
f.write(raw)
|
||||
|
||||
|
||||
def main():
|
||||
print('=' * 60)
|
||||
print(' ChaCha20 Session Key Capture')
|
||||
print('=' * 60)
|
||||
|
||||
with open(JS_PATH, 'r') as f:
|
||||
js_code = f.read()
|
||||
|
||||
print(f'[*] Looking for {PROCESS_NAME}...')
|
||||
session = None
|
||||
while not session:
|
||||
try:
|
||||
for proc in frida.get_local_device().enumerate_processes():
|
||||
if proc.name == PROCESS_NAME:
|
||||
print(f'[*] Found PID {proc.pid}, attaching...')
|
||||
session = frida.attach(proc.pid)
|
||||
break
|
||||
except Exception as e:
|
||||
print(f'[!] {e}')
|
||||
if not session:
|
||||
time.sleep(1)
|
||||
|
||||
script = session.create_script(js_code)
|
||||
script.on('message', on_message)
|
||||
script.load()
|
||||
|
||||
print('[*] Hooks active. Connect to a server in-game.')
|
||||
print('[*] Press Ctrl+C to stop.\n')
|
||||
|
||||
try:
|
||||
while True:
|
||||
time.sleep(0.5)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
print(f'\n[*] Captured {len(captured_keys)} unique keys.')
|
||||
session.detach()
|
||||
print('[*] Done.')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
rem run_mitm.bat - stop any running paralogue_mitm.py and start a fresh one.
|
||||
rem Any args passed to this script are forwarded to paralogue_mitm.py
|
||||
rem (e.g. `run_mitm.bat --inject-items`).
|
||||
|
||||
setlocal
|
||||
set PY=X:\Users\user\AppData\Local\Programs\Python\Python313\python.exe
|
||||
set SCRIPT_DIR=%~dp0
|
||||
set SCRIPT=%SCRIPT_DIR%paralogue_mitm.py
|
||||
|
||||
echo [*] stopping any running paralogue_mitm.py ...
|
||||
for /f "tokens=2 delims=," %%p in ('
|
||||
wmic process where "name='python.exe' and CommandLine like '%%paralogue_mitm.py%%'" get ProcessId /format:csv ^| findstr /r "[0-9]"
|
||||
') do (
|
||||
echo killing PID %%p
|
||||
taskkill /PID %%p /F >nul 2>&1
|
||||
)
|
||||
|
||||
rem Give sockets a moment to release before rebinding.
|
||||
timeout /t 1 /nobreak >nul
|
||||
|
||||
echo [*] starting paralogue_mitm.py %*
|
||||
pushd "%SCRIPT_DIR%\.."
|
||||
"%PY%" -u frida_hooks\paralogue_mitm.py %*
|
||||
popd
|
||||
|
||||
endlocal
|
||||
@@ -0,0 +1,177 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
run_sniffer.py - Frida game server traffic sniffer for Fallen Doll / Paralogue
|
||||
Captures encrypted traffic on port 11001 and EOS P2P packets.
|
||||
|
||||
Usage:
|
||||
python run_sniffer.py # attach to running game
|
||||
python run_sniffer.py --spawn # launch game and attach
|
||||
python run_sniffer.py --dump FILE # also write raw packets to file
|
||||
"""
|
||||
|
||||
import frida
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import struct
|
||||
import argparse
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
JS_PATH = os.path.join(SCRIPT_DIR, 'sniff_gameserver.js')
|
||||
PROCESS_NAME = 'Paralogue-Win64-Shipping.exe'
|
||||
|
||||
MSG_TYPES = {
|
||||
1001: 'KEY_A',
|
||||
1002: 'KEY_B',
|
||||
}
|
||||
|
||||
packet_log = []
|
||||
|
||||
|
||||
def hexdump(data, width=16, limit=128):
|
||||
lines = []
|
||||
for i in range(0, min(len(data), limit), width):
|
||||
chunk = data[i:i+width]
|
||||
hx = ' '.join(f'{b:02x}' for b in chunk)
|
||||
asc = ''.join(chr(b) if 32 <= b < 127 else '.' for b in chunk)
|
||||
lines.append(f' {i:04x} {hx:<{width*3}} {asc}')
|
||||
if len(data) > limit:
|
||||
lines.append(f' ... +{len(data)-limit} bytes')
|
||||
return '\n'.join(lines)
|
||||
|
||||
|
||||
def decode_envelope(data):
|
||||
"""Decode the [2-byte BE hdr_len][protobuf header] envelope."""
|
||||
if len(data) < 4 or data[0] != 0x00:
|
||||
return None
|
||||
hdr_len = (data[0] << 8) | data[1]
|
||||
if hdr_len < 2 or 2 + hdr_len > len(data):
|
||||
return None
|
||||
hdr = data[2:2+hdr_len]
|
||||
fields = {}
|
||||
pos = 0
|
||||
try:
|
||||
while pos < len(hdr):
|
||||
byte = hdr[pos]
|
||||
fn = byte >> 3
|
||||
wt = byte & 0x07
|
||||
pos += 1
|
||||
if wt == 0:
|
||||
val = 0; shift = 0
|
||||
while pos < len(hdr):
|
||||
b = hdr[pos]; val |= (b & 0x7f) << shift; shift += 7; pos += 1
|
||||
if (b & 0x80) == 0: break
|
||||
fields[fn] = val
|
||||
else:
|
||||
break
|
||||
except (IndexError, ValueError):
|
||||
return None
|
||||
if not fields:
|
||||
return None
|
||||
return {'hdr_len': hdr_len, 'fields': fields, 'payload_off': 2 + hdr_len}
|
||||
|
||||
|
||||
def on_message(message, data):
|
||||
if message['type'] == 'error':
|
||||
print(f'[!] JS Error: {message["description"]}')
|
||||
return
|
||||
|
||||
p = message.get('payload', {})
|
||||
if not isinstance(p, dict):
|
||||
return
|
||||
|
||||
t = p.get('t', '')
|
||||
|
||||
if t == 'ready':
|
||||
print(f'[*] {p["msg"]}')
|
||||
return
|
||||
|
||||
if t == 'found':
|
||||
print(f'[+] Game socket fd={p["fd"]} -> {p["ip"]}:{p["port"]}')
|
||||
return
|
||||
|
||||
if t in ('s', 'r') and data:
|
||||
raw = bytes(data)
|
||||
direction = 'C->S' if t == 's' else 'S->C'
|
||||
n = p.get('n', 0)
|
||||
packet_log.append((time.time(), direction, raw))
|
||||
|
||||
env = decode_envelope(raw)
|
||||
if env:
|
||||
f = env['fields']
|
||||
msg_id = f.get(2, 0)
|
||||
name = MSG_TYPES.get(msg_id, f'type_{msg_id}')
|
||||
payload_sz = len(raw) - env['payload_off']
|
||||
print(f'[#{n:04d}] {direction} {len(raw):5d}B ENVELOPE route={f.get(1,"?")} {name}({msg_id}) f4={f.get(4,"?")} payload={payload_sz}B')
|
||||
else:
|
||||
print(f'[#{n:04d}] {direction} {len(raw):5d}B encrypted first8={raw[:8].hex()}')
|
||||
|
||||
if len(raw) <= 64 or env:
|
||||
print(hexdump(raw))
|
||||
print()
|
||||
return
|
||||
|
||||
if t == 'eos_send':
|
||||
print(f'[#{p.get("n",0):04d}] EOS_P2P_SendPacket called')
|
||||
return
|
||||
|
||||
if t == 'eos_recv' and data:
|
||||
raw = bytes(data)
|
||||
n = p.get('n', 0)
|
||||
print(f'[#{n:04d}] EOS_P2P_ReceivePacket {len(raw)}B first8={raw[:8].hex()}')
|
||||
if len(raw) <= 128:
|
||||
print(hexdump(raw))
|
||||
print()
|
||||
return
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Fallen Doll game server traffic sniffer')
|
||||
parser.add_argument('--dump', help='Write raw packets to file')
|
||||
args = parser.parse_args()
|
||||
|
||||
print('=' * 60)
|
||||
print(' Fallen Doll / Paralogue - Game Server Sniffer')
|
||||
print(' Hooks: ws2_32 recv/send + EOS P2P')
|
||||
print('=' * 60)
|
||||
|
||||
with open(JS_PATH, 'r') as f:
|
||||
js_code = f.read()
|
||||
|
||||
try:
|
||||
session = frida.attach(PROCESS_NAME)
|
||||
print(f'[*] Attached to {PROCESS_NAME}')
|
||||
except frida.ProcessNotFoundError:
|
||||
print(f'[!] {PROCESS_NAME} not running.')
|
||||
print('[!] Start the game, then run this script.')
|
||||
sys.exit(1)
|
||||
|
||||
script = session.create_script(js_code)
|
||||
script.on('message', on_message)
|
||||
script.load()
|
||||
|
||||
print('[*] Press Ctrl+C to stop.\n')
|
||||
|
||||
try:
|
||||
while True:
|
||||
time.sleep(0.5)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
print(f'\n[*] Captured {len(packet_log)} packets.')
|
||||
|
||||
if args.dump and packet_log:
|
||||
with open(args.dump, 'wb') as f:
|
||||
for ts, direction, raw in packet_log:
|
||||
# Simple format: [8-byte timestamp][1-byte dir (0=C->S, 1=S->C)][4-byte len][data]
|
||||
d = 0 if direction == 'C->S' else 1
|
||||
f.write(struct.pack('<dBI', ts, d, len(raw)))
|
||||
f.write(raw)
|
||||
print(f'[*] Dumped to {args.dump}')
|
||||
|
||||
session.detach()
|
||||
print('[*] Detached.')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,131 @@
|
||||
// sniff_gameserver.js - Frida hook to intercept game server traffic (port 11001)
|
||||
// Also hooks EOS_P2P_SendPacket/ReceivePacket for the room replication layer
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
var TARGET_PORT = 11001;
|
||||
var knownGameFds = {};
|
||||
var pktCount = 0;
|
||||
|
||||
// ---- ws2_32 exports ----
|
||||
var ws2 = Process.getModuleByName('ws2_32.dll');
|
||||
var ws2exp = {};
|
||||
ws2.enumerateExports().forEach(function(e) { ws2exp[e.name] = e.address; });
|
||||
|
||||
// NativeFunction wrappers (x64 uses default calling convention)
|
||||
var getpeername_fn = new NativeFunction(ws2exp['getpeername'], 'int', ['uint', 'pointer', 'pointer']);
|
||||
|
||||
function getPeerPort(fd) {
|
||||
var buf = Memory.alloc(32);
|
||||
var lenp = Memory.alloc(4);
|
||||
lenp.writeU32(32);
|
||||
if (getpeername_fn(fd, buf, lenp) === 0 && buf.readU16() === 2) {
|
||||
return (buf.add(2).readU8() << 8) | buf.add(3).readU8();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function getPeerInfo(fd) {
|
||||
var buf = Memory.alloc(32);
|
||||
var lenp = Memory.alloc(4);
|
||||
lenp.writeU32(32);
|
||||
if (getpeername_fn(fd, buf, lenp) === 0 && buf.readU16() === 2) {
|
||||
var port = (buf.add(2).readU8() << 8) | buf.add(3).readU8();
|
||||
var ip = buf.add(4).readU8() + '.' + buf.add(5).readU8() + '.' +
|
||||
buf.add(6).readU8() + '.' + buf.add(7).readU8();
|
||||
return { ip: ip, port: port };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function isGameSocket(fd) {
|
||||
if (knownGameFds[fd] !== undefined) return knownGameFds[fd];
|
||||
var port = getPeerPort(fd);
|
||||
knownGameFds[fd] = (port === TARGET_PORT);
|
||||
if (knownGameFds[fd]) {
|
||||
var info = getPeerInfo(fd);
|
||||
send({ t: 'found', fd: fd, ip: info.ip, port: info.port });
|
||||
}
|
||||
return knownGameFds[fd];
|
||||
}
|
||||
|
||||
function hexBytes(ptr, n) {
|
||||
var s = '';
|
||||
for (var i = 0; i < n; i++) {
|
||||
var b = ptr.add(i).readU8();
|
||||
s += ('0' + b.toString(16)).slice(-2);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
// ---- Hook recv ----
|
||||
Interceptor.attach(ws2exp['recv'], {
|
||||
onEnter: function(args) {
|
||||
this.fd = args[0].toInt32();
|
||||
this.buf = args[1];
|
||||
},
|
||||
onLeave: function(retval) {
|
||||
var n = retval.toInt32();
|
||||
if (n > 0 && isGameSocket(this.fd)) {
|
||||
pktCount++;
|
||||
var data = this.buf.readByteArray(n);
|
||||
send({ t: 'r', n: pktCount, sz: n }, data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ---- Hook send ----
|
||||
Interceptor.attach(ws2exp['send'], {
|
||||
onEnter: function(args) {
|
||||
this.fd = args[0].toInt32();
|
||||
this.buf = args[1];
|
||||
this.len = args[2].toInt32();
|
||||
},
|
||||
onLeave: function(retval) {
|
||||
var n = retval.toInt32();
|
||||
if (n > 0 && isGameSocket(this.fd)) {
|
||||
pktCount++;
|
||||
var data = this.buf.readByteArray(n);
|
||||
send({ t: 's', n: pktCount, sz: n }, data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ---- Hook EOS P2P ----
|
||||
var eos = Process.getModuleByName('EOSSDK-Win64-Shipping.dll');
|
||||
var eosexp = {};
|
||||
eos.enumerateExports().forEach(function(e) { eosexp[e.name] = e.address; });
|
||||
|
||||
if (eosexp['EOS_P2P_SendPacket']) {
|
||||
Interceptor.attach(eosexp['EOS_P2P_SendPacket'], {
|
||||
onEnter: function(args) {
|
||||
// EOS_P2P_SendPacket(handle, options)
|
||||
// options->DataLengthBytes at offset, options->Data at offset
|
||||
// We just log that it was called for now
|
||||
pktCount++;
|
||||
send({ t: 'eos_send', n: pktCount });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (eosexp['EOS_P2P_ReceivePacket']) {
|
||||
Interceptor.attach(eosexp['EOS_P2P_ReceivePacket'], {
|
||||
onEnter: function(args) {
|
||||
this.outData = args[4]; // void* OutData
|
||||
this.outBytesWritten = args[5]; // uint32_t* OutBytesWritten
|
||||
},
|
||||
onLeave: function(retval) {
|
||||
if (retval.toInt32() === 0 && this.outBytesWritten) { // EOS_Success = 0
|
||||
var written = this.outBytesWritten.readU32();
|
||||
if (written > 0) {
|
||||
pktCount++;
|
||||
var data = this.outData.readByteArray(written);
|
||||
send({ t: 'eos_recv', n: pktCount, sz: written }, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
send({ t: 'ready', msg: 'Hooks installed. Watching port ' + TARGET_PORT + '. Pkt hooks: recv/send + EOS P2P.' });
|
||||
})();
|
||||
@@ -0,0 +1,318 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
tcp_proxy.py - MITM TCP proxy for Fallen Doll game server
|
||||
Sits between the game client and real server, logging all traffic.
|
||||
Parses the KEY_A/KEY_B handshake to extract ChaCha20 key material.
|
||||
|
||||
Usage:
|
||||
1. Add to hosts file: 127.0.0.1 dispatch.projecthelius.com
|
||||
2. Run this proxy
|
||||
3. Start the game
|
||||
4. The proxy logs all traffic and extracts encryption keys
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
import struct
|
||||
import time
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Real server IPs (AWS Global Accelerator)
|
||||
REAL_SERVER_IPS = ['13.248.150.146', '35.71.128.233', '3.33.185.193', '76.223.57.31']
|
||||
|
||||
# Dispatch server (HTTP) - dispatch.projecthelius.com
|
||||
DISPATCH_IP = '13.248.150.146'
|
||||
# Game server - a09484ac4d76eba25.awsglobalaccelerator.com
|
||||
GAME_SERVER_IP = '3.33.185.193'
|
||||
|
||||
# Ports to proxy
|
||||
GAME_PORT = 11001
|
||||
HTTP_PORT = 18801
|
||||
|
||||
# Output
|
||||
OUT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'captures')
|
||||
os.makedirs(OUT_DIR, exist_ok=True)
|
||||
|
||||
pkt_log = []
|
||||
handshake_keys = {}
|
||||
|
||||
|
||||
def hexdump(data, width=16, limit=128):
|
||||
lines = []
|
||||
for i in range(0, min(len(data), limit), width):
|
||||
chunk = data[i:i+width]
|
||||
hx = ' '.join(f'{b:02x}' for b in chunk)
|
||||
asc = ''.join(chr(b) if 32 <= b < 127 else '.' for b in chunk)
|
||||
lines.append(f' {i:04x} {hx:<{width*3}} {asc}')
|
||||
if len(data) > limit:
|
||||
lines.append(f' ... +{len(data)-limit} bytes')
|
||||
return '\n'.join(lines)
|
||||
|
||||
|
||||
def parse_envelope(data):
|
||||
"""Parse the outer protobuf envelope [2B BE hdr_len][protobuf fields]"""
|
||||
if len(data) < 4 or data[0] != 0x00:
|
||||
return None
|
||||
hdr_len = (data[0] << 8) | data[1]
|
||||
if hdr_len < 2 or 2 + hdr_len > len(data):
|
||||
return None
|
||||
hdr = data[2:2+hdr_len]
|
||||
fields = {}
|
||||
pos = 0
|
||||
try:
|
||||
while pos < len(hdr):
|
||||
byte = hdr[pos]; fn = byte >> 3; wt = byte & 7; pos += 1
|
||||
if wt == 0:
|
||||
val = 0; shift = 0
|
||||
while pos < len(hdr):
|
||||
b = hdr[pos]; val |= (b & 0x7f) << shift; shift += 7; pos += 1
|
||||
if (b & 0x80) == 0: break
|
||||
fields[fn] = val
|
||||
else:
|
||||
break
|
||||
except:
|
||||
return None
|
||||
return {'hdr_len': hdr_len, 'fields': fields, 'payload_off': 2 + hdr_len}
|
||||
|
||||
|
||||
class GameProxy:
|
||||
def __init__(self):
|
||||
self.pkt_num = 0
|
||||
self.capfile = os.path.join(OUT_DIR, f'proxy_{int(time.time())}.jsonl')
|
||||
self.handshake_complete = False
|
||||
self.client_key_data = None
|
||||
self.server_key_data = None
|
||||
|
||||
def log_packet(self, direction, data, label=''):
|
||||
self.pkt_num += 1
|
||||
ts = time.time()
|
||||
|
||||
# Try to parse envelope (handshake packets)
|
||||
env = parse_envelope(data)
|
||||
if env:
|
||||
f = env['fields']
|
||||
msg_type = f.get(2, 0)
|
||||
names = {1: 'KEY_A', 2: 'KEY_B', 3: 'PROTO_CTRL', 4: 'SYNC'}
|
||||
name = names.get(msg_type, f'type_{msg_type}')
|
||||
payload = data[env['payload_off']:]
|
||||
label = f'{name} route={f.get(1,0)} f4={f.get(4,0)} payload={len(payload)}B'
|
||||
|
||||
if msg_type == 1: # KEY_A - client key material
|
||||
self.client_key_data = payload
|
||||
print(f' *** CLIENT KEY MATERIAL: {len(payload)} bytes ***')
|
||||
print(hexdump(payload, limit=64))
|
||||
elif msg_type == 2: # KEY_B - server key material
|
||||
self.server_key_data = payload
|
||||
self.handshake_complete = True
|
||||
print(f' *** SERVER KEY MATERIAL: {len(payload)} bytes ***')
|
||||
print(hexdump(payload, limit=64))
|
||||
self._save_keys()
|
||||
|
||||
prefix = '>>>' if direction == 'C->S' else '<<<'
|
||||
enc = ' [encrypted]' if self.handshake_complete and not env else ''
|
||||
print(f'[#{self.pkt_num:04d}] {prefix} {direction} {len(data):5d}B {label}{enc}')
|
||||
if len(data) <= 64 or env:
|
||||
print(hexdump(data, limit=96))
|
||||
print()
|
||||
|
||||
# Save to file
|
||||
entry = {
|
||||
'n': self.pkt_num, 'ts': ts, 'd': direction,
|
||||
'sz': len(data), 'hex': data.hex(), 'label': label
|
||||
}
|
||||
with open(self.capfile, 'a') as f:
|
||||
f.write(json.dumps(entry) + '\n')
|
||||
|
||||
def _save_keys(self):
|
||||
key_file = os.path.join(OUT_DIR, 'handshake_keys.json')
|
||||
keys = {
|
||||
'client_key_data': self.client_key_data.hex() if self.client_key_data else None,
|
||||
'server_key_data': self.server_key_data.hex() if self.server_key_data else None,
|
||||
'client_key_size': len(self.client_key_data) if self.client_key_data else 0,
|
||||
'server_key_size': len(self.server_key_data) if self.server_key_data else 0,
|
||||
'timestamp': time.time()
|
||||
}
|
||||
with open(key_file, 'w') as f:
|
||||
json.dump(keys, f, indent=2)
|
||||
print(f' *** KEYS SAVED to {key_file} ***')
|
||||
|
||||
# Also save raw binary key data
|
||||
if self.client_key_data:
|
||||
with open(os.path.join(OUT_DIR, 'client_key.bin'), 'wb') as f:
|
||||
f.write(self.client_key_data)
|
||||
if self.server_key_data:
|
||||
with open(os.path.join(OUT_DIR, 'server_key.bin'), 'wb') as f:
|
||||
f.write(self.server_key_data)
|
||||
|
||||
|
||||
async def pipe(reader, writer, proxy, direction):
|
||||
"""Forward data from reader to writer, logging everything."""
|
||||
try:
|
||||
while True:
|
||||
data = await reader.read(65536)
|
||||
if not data:
|
||||
break
|
||||
proxy.log_packet(direction, data)
|
||||
writer.write(data)
|
||||
await writer.drain()
|
||||
except (ConnectionResetError, BrokenPipeError, asyncio.CancelledError):
|
||||
pass
|
||||
finally:
|
||||
try:
|
||||
writer.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
async def handle_game_client(client_reader, client_writer, proxy):
|
||||
"""Handle a game client connection on port 11001."""
|
||||
addr = client_writer.get_extra_info('peername')
|
||||
print(f'[+] Game client connected from {addr}')
|
||||
|
||||
# Connect to real server
|
||||
try:
|
||||
server_reader, server_writer = await asyncio.open_connection(GAME_SERVER_IP, GAME_PORT)
|
||||
print(f'[+] Connected to real server {GAME_SERVER_IP}:{GAME_PORT}')
|
||||
except Exception as e:
|
||||
print(f'[!] Failed to connect to real server: {e}')
|
||||
client_writer.close()
|
||||
return
|
||||
|
||||
# Bidirectional forwarding
|
||||
c2s = asyncio.create_task(pipe(client_reader, server_writer, proxy, 'C->S'))
|
||||
s2c = asyncio.create_task(pipe(server_reader, client_writer, proxy, 'S->C'))
|
||||
|
||||
await asyncio.gather(c2s, s2c, return_exceptions=True)
|
||||
print(f'[-] Game client {addr} disconnected')
|
||||
|
||||
|
||||
async def handle_http_client(client_reader, client_writer):
|
||||
"""Handle HTTP client on port 18801 - intercept and modify responses."""
|
||||
addr = client_writer.get_extra_info('peername')
|
||||
print(f'[+] HTTP client connected from {addr}')
|
||||
|
||||
try:
|
||||
server_reader, server_writer = await asyncio.open_connection(DISPATCH_IP, HTTP_PORT)
|
||||
print(f'[+] Connected to real HTTP server {DISPATCH_IP}:{HTTP_PORT}')
|
||||
except Exception as e:
|
||||
print(f'[!] Failed to connect to HTTP server: {e}')
|
||||
client_writer.close()
|
||||
return
|
||||
|
||||
async def fwd_c2s(r, w):
|
||||
"""Forward client requests to server."""
|
||||
try:
|
||||
while True:
|
||||
data = await r.read(65536)
|
||||
if not data:
|
||||
break
|
||||
try:
|
||||
first_line = data.split(b'\r\n')[0].decode(errors='replace')
|
||||
print(f' [HTTP] C->S {first_line}')
|
||||
except:
|
||||
pass
|
||||
w.write(data)
|
||||
await w.drain()
|
||||
except:
|
||||
pass
|
||||
|
||||
async def fwd_s2c(r, w):
|
||||
"""Forward server responses to client, replacing IPs."""
|
||||
try:
|
||||
while True:
|
||||
data = await r.read(65536)
|
||||
if not data:
|
||||
break
|
||||
original_len = len(data)
|
||||
|
||||
# Replace real server IPs with 127.0.0.1 in the response body
|
||||
modified = data
|
||||
for real_ip in REAL_SERVER_IPS:
|
||||
if real_ip.encode() in modified:
|
||||
print(f' [HTTP] *** Replacing {real_ip} -> 127.0.0.1 ***')
|
||||
modified = modified.replace(real_ip.encode(), b'127.0.0.1 ')
|
||||
# Pad with spaces to keep Content-Length valid (IPs are longer than 127.0.0.1)
|
||||
# Actually, the IP "13.248.150.146" is 15 chars, "127.0.0.1" is 9 chars
|
||||
# We need to pad or fix Content-Length
|
||||
|
||||
# Also replace the awsglobalaccelerator hostname if present
|
||||
for pattern in [b'a6e3077dcfb5ca02d.awsglobalaccelerator.com']:
|
||||
if pattern in modified:
|
||||
# Replace with 127.0.0.1 padded to same length
|
||||
replacement = b'127.0.0.1' + b' ' * (len(pattern) - 9)
|
||||
print(f' [HTTP] *** Replacing {pattern.decode()} -> 127.0.0.1 ***')
|
||||
modified = modified.replace(pattern, replacement)
|
||||
|
||||
if len(modified) != original_len:
|
||||
# Fix Content-Length header if it changed
|
||||
# Actually we padded to same length so it should be fine
|
||||
pass
|
||||
|
||||
try:
|
||||
first_line = modified.split(b'\r\n')[0].decode(errors='replace')
|
||||
print(f' [HTTP] S->C {first_line} ({len(modified)}B)')
|
||||
except:
|
||||
pass
|
||||
|
||||
# Save the response for analysis
|
||||
resp_file = os.path.join(OUT_DIR, f'http_response_{int(time.time())}.bin')
|
||||
with open(resp_file, 'wb') as f:
|
||||
f.write(modified)
|
||||
|
||||
w.write(modified)
|
||||
await w.drain()
|
||||
except:
|
||||
pass
|
||||
|
||||
c2s = asyncio.create_task(fwd_c2s(client_reader, server_writer))
|
||||
s2c = asyncio.create_task(fwd_s2c(server_reader, client_writer))
|
||||
await asyncio.gather(c2s, s2c, return_exceptions=True)
|
||||
print(f'[-] HTTP client {addr} disconnected')
|
||||
|
||||
|
||||
async def main():
|
||||
proxy = GameProxy()
|
||||
|
||||
print('=' * 60)
|
||||
print(' Fallen Doll TCP Proxy')
|
||||
print('=' * 60)
|
||||
print(f' Game server: {GAME_SERVER_IP}:{GAME_PORT}')
|
||||
print(f' HTTP server: {DISPATCH_IP}:{HTTP_PORT}')
|
||||
print(f' Capture dir: {OUT_DIR}')
|
||||
print()
|
||||
print(' Make sure hosts file has:')
|
||||
print(f' 127.0.0.1 dispatch.projecthelius.com')
|
||||
print()
|
||||
|
||||
# Start game server proxy (with reuse_address to avoid TIME_WAIT issues)
|
||||
game_server = await asyncio.start_server(
|
||||
lambda r, w: handle_game_client(r, w, proxy),
|
||||
'0.0.0.0', GAME_PORT,
|
||||
reuse_address=True
|
||||
)
|
||||
print(f'[*] Game proxy listening on 0.0.0.0:{GAME_PORT}')
|
||||
|
||||
# Start HTTP proxy
|
||||
http_server = await asyncio.start_server(
|
||||
handle_http_client,
|
||||
'0.0.0.0', HTTP_PORT,
|
||||
reuse_address=True
|
||||
)
|
||||
print(f'[*] HTTP proxy listening on 0.0.0.0:{HTTP_PORT}')
|
||||
|
||||
print('[*] Start the game now!')
|
||||
print()
|
||||
|
||||
async with game_server, http_server:
|
||||
await asyncio.gather(
|
||||
game_server.serve_forever(),
|
||||
http_server.serve_forever()
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
asyncio.run(main())
|
||||
except KeyboardInterrupt:
|
||||
print('\n[*] Proxy stopped.')
|
||||
@@ -0,0 +1,594 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
tcp_proxy_decrypt.py - MITM TCP proxy with ChaCha20 decryption/encryption.
|
||||
Extends tcp_proxy.py with ability to decrypt, parse, modify, and re-encrypt
|
||||
game server traffic once the ChaCha20 session key is captured.
|
||||
|
||||
Usage:
|
||||
1. Start this proxy
|
||||
2. Launch game + Frida redirect (redirect_and_capture.py)
|
||||
3. Run run_chacha_capture.py to capture the session key
|
||||
4. Proxy auto-loads key from captures/chacha_session_key.json
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
import struct
|
||||
import time
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
from Crypto.Cipher import ChaCha20
|
||||
|
||||
# Add parent dir for proto import
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
import paralogue_net_full_pb2 as pb
|
||||
from paralogue_decoder import (
|
||||
Stream, drain_stream, identify_body, msg_to_dict, short_repr,
|
||||
load_known_ids, save_known_ids,
|
||||
)
|
||||
|
||||
# Real server IPs
|
||||
REAL_SERVER_IPS = ['13.248.150.146', '35.71.128.233', '3.33.185.193', '76.223.57.31']
|
||||
DISPATCH_IP = '13.248.150.146'
|
||||
GAME_SERVER_IP = '3.33.185.193'
|
||||
|
||||
GAME_PORT = 11001
|
||||
HTTP_PORT = 18801
|
||||
|
||||
OUT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'captures')
|
||||
os.makedirs(OUT_DIR, exist_ok=True)
|
||||
|
||||
KEY_FILE = os.path.join(OUT_DIR, 'chacha_session_key.json')
|
||||
KEYSTREAM_FILE = os.path.join(OUT_DIR, 'keystream.bin')
|
||||
|
||||
# Whether to modify packets (set True once we confirm decryption works)
|
||||
MODIFY_PACKETS = True
|
||||
|
||||
|
||||
def hexdump(data, width=16, limit=128):
|
||||
lines = []
|
||||
for i in range(0, min(len(data), limit), width):
|
||||
chunk = data[i:i+width]
|
||||
hx = ' '.join(f'{b:02x}' for b in chunk)
|
||||
asc = ''.join(chr(b) if 32 <= b < 127 else '.' for b in chunk)
|
||||
lines.append(f' {i:04x} {hx:<{width*3}} {asc}')
|
||||
if len(data) > limit:
|
||||
lines.append(f' ... +{len(data)-limit} bytes')
|
||||
return '\n'.join(lines)
|
||||
|
||||
|
||||
def parse_envelope(data):
|
||||
"""Parse outer protobuf envelope: [2B BE hdr_len][protobuf fields]"""
|
||||
if len(data) < 4:
|
||||
return None
|
||||
hdr_len = (data[0] << 8) | data[1]
|
||||
if hdr_len < 2 or 2 + hdr_len > len(data):
|
||||
return None
|
||||
hdr = data[2:2+hdr_len]
|
||||
fields = {}
|
||||
pos = 0
|
||||
try:
|
||||
while pos < len(hdr):
|
||||
byte = hdr[pos]; fn = byte >> 3; wt = byte & 7; pos += 1
|
||||
if wt == 0:
|
||||
val = 0; shift = 0
|
||||
while pos < len(hdr):
|
||||
b = hdr[pos]; val |= (b & 0x7f) << shift; shift += 7; pos += 1
|
||||
if (b & 0x80) == 0: break
|
||||
fields[fn] = val
|
||||
else:
|
||||
break
|
||||
except:
|
||||
return None
|
||||
return {'hdr_len': hdr_len, 'fields': fields, 'payload_off': 2 + hdr_len}
|
||||
|
||||
|
||||
# msg_id -> message name mapping (populated as we discover them)
|
||||
MSG_ID_NAMES = {
|
||||
1001: 'KEY_A',
|
||||
1002: 'KEY_B',
|
||||
}
|
||||
|
||||
|
||||
class ChaChaStream:
|
||||
"""Wraps ChaCha20 as a continuous stream cipher for one direction.
|
||||
|
||||
Per RESEARCH.md, PyCryptodome cannot reproduce the game's ChaCha20
|
||||
keystream from the raw key/nonce we capture -- OpenSSL transforms
|
||||
the key internally. We keep this class as a fallback but the proxy
|
||||
prefers `KeystreamFile` below when it's available.
|
||||
"""
|
||||
|
||||
def __init__(self, key: bytes, nonce: bytes):
|
||||
self.key = key
|
||||
self.nonce = nonce
|
||||
self.offset = 0
|
||||
self._cipher = ChaCha20.new(key=key, nonce=nonce)
|
||||
|
||||
def process(self, data: bytes) -> bytes:
|
||||
result = self._cipher.encrypt(data)
|
||||
self.offset += len(data)
|
||||
return result
|
||||
|
||||
def reset(self):
|
||||
self._cipher = ChaCha20.new(key=self.key, nonce=self.nonce)
|
||||
self.offset = 0
|
||||
|
||||
|
||||
class KeystreamFile:
|
||||
"""Keystream-based decryptor.
|
||||
|
||||
The Frida hook `capture_session_key.js` writes the ChaCha20 keystream
|
||||
to `captures/keystream.bin` at each stream offset. Both directions
|
||||
share the same keystream (per RESEARCH.md), so XOR-ing ciphertext
|
||||
against the bytes at its stream offset yields plaintext without
|
||||
needing PyCryptodome's key schedule to match.
|
||||
|
||||
Each direction maintains its own running `offset` counter -- TCP
|
||||
reassembly on the proxy side is not strictly byte-aligned to the
|
||||
game's internal stream, but because the keystream bytes we capture
|
||||
from Frida cover the same byte positions, reads stay in sync.
|
||||
"""
|
||||
|
||||
def __init__(self, path: str):
|
||||
self.path = path
|
||||
self._cache = b""
|
||||
self._mtime = 0.0
|
||||
self.offset = 0
|
||||
|
||||
def _ensure(self, upto: int) -> None:
|
||||
# Re-read whenever the file has been modified (Frida hook writes
|
||||
# fresh keystream on every new session and truncates at start).
|
||||
try:
|
||||
st = os.stat(self.path)
|
||||
except FileNotFoundError:
|
||||
self._cache = b""
|
||||
return
|
||||
if st.st_mtime != self._mtime or upto > len(self._cache):
|
||||
try:
|
||||
with open(self.path, "rb") as f:
|
||||
self._cache = f.read()
|
||||
self._mtime = st.st_mtime
|
||||
except FileNotFoundError:
|
||||
self._cache = b""
|
||||
|
||||
def process(self, data: bytes) -> bytes:
|
||||
# Proxy byte arrival races ahead of the in-process Frida hook by
|
||||
# a few ms. Poll briefly for the keystream file to reach the end
|
||||
# offset we need. Valid keystream bytes may be 0x00 themselves, so
|
||||
# we can't use a "non-zero" heuristic; we rely on file size growing
|
||||
# past `need_end` (the decoder always writes sequentially).
|
||||
need_end = self.offset + len(data)
|
||||
deadline = time.time() + 0.5
|
||||
while True:
|
||||
try:
|
||||
st = os.stat(self.path)
|
||||
if st.st_size >= need_end:
|
||||
self._ensure(need_end)
|
||||
break
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
if time.time() >= deadline:
|
||||
self._ensure(need_end)
|
||||
break
|
||||
time.sleep(0.01)
|
||||
|
||||
out = bytearray(len(data))
|
||||
for i, b in enumerate(data):
|
||||
j = self.offset + i
|
||||
if j < len(self._cache):
|
||||
out[i] = b ^ self._cache[j]
|
||||
else:
|
||||
out[i] = b
|
||||
self.offset += len(data)
|
||||
return bytes(out)
|
||||
|
||||
def available(self) -> bool:
|
||||
return os.path.isfile(self.path) and os.path.getsize(self.path) > 0
|
||||
|
||||
|
||||
class GameProxy:
|
||||
def __init__(self):
|
||||
self.pkt_num = 0
|
||||
ts = int(time.time())
|
||||
self.capfile = os.path.join(OUT_DIR, f'decproxy_{ts}.jsonl')
|
||||
self.decoded_file = os.path.join(OUT_DIR, f'proxy_decoded_{ts}.jsonl')
|
||||
self.handshake_complete = False
|
||||
self.client_key_data = None
|
||||
self.server_key_data = None
|
||||
|
||||
# ChaCha20 streams (initialized when key is loaded)
|
||||
self.c2s_cipher = None # decrypt client->server
|
||||
self.s2c_cipher = None # decrypt server->client
|
||||
self.key_loaded = False
|
||||
self.key_check_time = 0
|
||||
|
||||
# Keystream-based fallback (preferred when available)
|
||||
self.c2s_ks = None
|
||||
self.s2c_ks = None
|
||||
self.using_keystream = False
|
||||
|
||||
# Packet counters for decrypted stream
|
||||
self.dec_pkt_num = 0
|
||||
|
||||
# Shared decoder state: per-direction Stream and msg_id cache,
|
||||
# plus a running sequence number for the decoded log.
|
||||
self.streams: dict[str, Stream] = {
|
||||
'C->S': Stream(label='C->S'),
|
||||
'S->C': Stream(label='S->C'),
|
||||
}
|
||||
self.msg_id_cache = load_known_ids()
|
||||
self._user_ids = set(self.msg_id_cache.keys())
|
||||
self.decoded_seq = 0
|
||||
self._decoded_fp = open(self.decoded_file, 'w', encoding='utf-8')
|
||||
print(f' Decoded log -> {self.decoded_file}')
|
||||
|
||||
def try_load_key(self):
|
||||
"""Try to initialise decryption.
|
||||
|
||||
Two sources:
|
||||
1. keystream.bin produced by the Frida keystream-capture hook
|
||||
(preferred -- it's a byte-for-byte XOR pad and works reliably)
|
||||
2. chacha_session_key.json with key+nonce (falls back to
|
||||
PyCryptodome, which per RESEARCH.md does not reproduce
|
||||
the game's keystream but we try anyway)
|
||||
"""
|
||||
if self.key_loaded:
|
||||
return True
|
||||
now = time.time()
|
||||
if now - self.key_check_time < 2:
|
||||
return False
|
||||
self.key_check_time = now
|
||||
|
||||
# Preferred: keystream file
|
||||
if os.path.isfile(KEYSTREAM_FILE) and os.path.getsize(KEYSTREAM_FILE) > 0:
|
||||
self.c2s_ks = KeystreamFile(KEYSTREAM_FILE)
|
||||
self.s2c_ks = KeystreamFile(KEYSTREAM_FILE)
|
||||
self.using_keystream = True
|
||||
self.key_loaded = True
|
||||
print(f'\n{"="*60}')
|
||||
print(f' *** Decryption via keystream.bin ({os.path.getsize(KEYSTREAM_FILE)}B available) ***')
|
||||
print(f'{"="*60}\n')
|
||||
return True
|
||||
|
||||
if not os.path.exists(KEY_FILE):
|
||||
return False
|
||||
|
||||
try:
|
||||
with open(KEY_FILE, 'r') as f:
|
||||
keys = json.load(f)
|
||||
if not keys:
|
||||
return False
|
||||
# Use the first captured key
|
||||
k = keys[0] if isinstance(keys, list) else keys
|
||||
key_hex = k['key_hex']
|
||||
nonce_hex = k['nonce_hex']
|
||||
key = bytes.fromhex(key_hex)
|
||||
nonce = bytes.fromhex(nonce_hex)
|
||||
|
||||
if len(key) != 32:
|
||||
print(f'[!] Bad key length: {len(key)}')
|
||||
return False
|
||||
|
||||
# ChaCha20 nonce can be 8 or 12 bytes
|
||||
if len(nonce) not in (8, 12):
|
||||
print(f'[!] Bad nonce length: {len(nonce)}, trying 8-byte trim')
|
||||
nonce = nonce[:8]
|
||||
|
||||
# Both directions use same key but may use different nonces
|
||||
# For now assume same key+nonce, we'll adjust if needed
|
||||
self.c2s_cipher = ChaChaStream(key, nonce)
|
||||
self.s2c_cipher = ChaChaStream(key, nonce)
|
||||
self.key_loaded = True
|
||||
|
||||
print(f'\n{"="*60}')
|
||||
print(f' *** ChaCha20 KEY LOADED ***')
|
||||
print(f' Key: {key_hex}')
|
||||
print(f' Nonce: {nonce_hex}')
|
||||
print(f'{"="*60}\n')
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f'[!] Failed to load key: {e}')
|
||||
return False
|
||||
|
||||
def parse_packet_head(self, data):
|
||||
"""Parse a decrypted PacketHead protobuf."""
|
||||
try:
|
||||
ph = pb.PacketHead()
|
||||
ph.ParseFromString(data)
|
||||
return ph
|
||||
except Exception as e:
|
||||
return None
|
||||
|
||||
def try_parse_body(self, msg_id, body_data):
|
||||
"""Try to parse a protobuf body based on msg_id."""
|
||||
# We don't know the msg_id -> message type mapping yet.
|
||||
# Log raw protobuf fields for discovery.
|
||||
# As we discover mappings, add them here.
|
||||
result = {'msg_id': msg_id, 'raw_len': len(body_data)}
|
||||
try:
|
||||
# Generic protobuf decode attempt
|
||||
from google.protobuf import descriptor_pool, descriptor_pb2
|
||||
# For now just try known message types
|
||||
# We'll build the mapping as we see traffic
|
||||
result['hex_preview'] = body_data[:64].hex()
|
||||
except:
|
||||
pass
|
||||
return result
|
||||
|
||||
def log_packet(self, direction, data, label=''):
|
||||
"""Log a raw packet, attempt decryption if key is loaded."""
|
||||
self.pkt_num += 1
|
||||
ts = time.time()
|
||||
|
||||
# Check for handshake envelope
|
||||
env = parse_envelope(data)
|
||||
is_handshake = False
|
||||
if env and not self.handshake_complete:
|
||||
f = env['fields']
|
||||
msg_type = f.get(2, 0)
|
||||
if msg_type in (1001, 1002):
|
||||
is_handshake = True
|
||||
name = MSG_ID_NAMES.get(msg_type, f'type_{msg_type}')
|
||||
payload = data[env['payload_off']:]
|
||||
label = f'{name} route={f.get(1,0)} f4={f.get(4,0)} payload={len(payload)}B'
|
||||
|
||||
if msg_type == 1001:
|
||||
self.client_key_data = payload
|
||||
print(f' *** KEY_A: {len(payload)} bytes ***')
|
||||
elif msg_type == 1002:
|
||||
self.server_key_data = payload
|
||||
self.handshake_complete = True
|
||||
print(f' *** KEY_B: {len(payload)} bytes ***')
|
||||
self._save_keys()
|
||||
|
||||
# Try decryption for post-handshake data
|
||||
decrypted = None
|
||||
if self.handshake_complete and not is_handshake and self.key_loaded:
|
||||
if self.using_keystream:
|
||||
cipher = self.c2s_ks if direction == 'C->S' else self.s2c_ks
|
||||
else:
|
||||
cipher = self.c2s_cipher if direction == 'C->S' else self.s2c_cipher
|
||||
try:
|
||||
decrypted = cipher.process(data)
|
||||
self._log_decrypted(direction, decrypted, cipher_offset=cipher.offset - len(data))
|
||||
except Exception as e:
|
||||
print(f' [!] Decrypt error: {e}')
|
||||
|
||||
# Console output
|
||||
prefix = '>>>' if direction == 'C->S' else '<<<'
|
||||
enc_tag = ''
|
||||
if self.handshake_complete and not is_handshake:
|
||||
enc_tag = ' [DECRYPTED]' if decrypted else ' [encrypted]'
|
||||
print(f'[#{self.pkt_num:04d}] {prefix} {direction} {len(data):5d}B {label}{enc_tag}')
|
||||
|
||||
# Save to capture file
|
||||
entry = {
|
||||
'n': self.pkt_num, 'ts': ts, 'd': direction,
|
||||
'sz': len(data), 'hex': data.hex(), 'label': label
|
||||
}
|
||||
if decrypted:
|
||||
entry['dec_hex'] = decrypted.hex()
|
||||
with open(self.capfile, 'a') as f:
|
||||
f.write(json.dumps(entry) + '\n')
|
||||
|
||||
def _log_decrypted(self, direction, data, cipher_offset=0):
|
||||
"""Analyse decrypted data via the shared framing + identifier.
|
||||
|
||||
TCP reads can span multiple logical packets and/or slice one in the
|
||||
middle. We accumulate into a per-direction Stream keyed by cipher
|
||||
offset so framing holds across reads.
|
||||
"""
|
||||
self.dec_pkt_num += 1
|
||||
stream = self.streams[direction]
|
||||
stream.add(cipher_offset, data)
|
||||
|
||||
for head, body, _skipped in drain_stream(stream):
|
||||
self._emit_decoded(direction, head, body, cipher_offset)
|
||||
|
||||
def _emit_decoded(self, direction, head, body, cipher_offset):
|
||||
mid = int(head.msg_id)
|
||||
preferred = self.msg_id_cache.get(mid)
|
||||
name, parsed, score, cand, top = identify_body(body, preferred)
|
||||
|
||||
# auto-promote strong identifications into the cache
|
||||
if name and not preferred and score >= 60:
|
||||
self.msg_id_cache[mid] = name
|
||||
if mid not in self._user_ids:
|
||||
save_known_ids(self.msg_id_cache)
|
||||
|
||||
if parsed is not None:
|
||||
fields_obj = msg_to_dict(parsed)
|
||||
else:
|
||||
fields_obj = {'_raw_hex': body.hex()}
|
||||
|
||||
self.decoded_seq += 1
|
||||
record = {
|
||||
'seq': self.decoded_seq,
|
||||
'ts': time.time(),
|
||||
'source': 'proxy',
|
||||
'direction': direction,
|
||||
'stream_offset': cipher_offset,
|
||||
'msg_id': mid,
|
||||
'msg_type': name or '<unknown>',
|
||||
'packet_id': int(head.packet_id),
|
||||
'flag': int(head.flag),
|
||||
'body_len': int(head.body_len),
|
||||
'seq_id': int(head.seq_id),
|
||||
'total_pack_count': int(head.total_pack_count),
|
||||
'identify_score': score,
|
||||
'identify_candidates': cand,
|
||||
'top_candidates': [{'type': n, 'score': s} for n, s in top],
|
||||
'fields': fields_obj,
|
||||
}
|
||||
self._decoded_fp.write(json.dumps(record, ensure_ascii=False) + '\n')
|
||||
self._decoded_fp.flush()
|
||||
|
||||
print(f' [{self.decoded_seq:04d}] {direction} '
|
||||
f'msg_id={mid:<5d} {record["msg_type"]:<28s} '
|
||||
f'body={record["body_len"]:>5d}B {short_repr(fields_obj)}')
|
||||
|
||||
def _save_keys(self):
|
||||
"""Save handshake key material."""
|
||||
key_file = os.path.join(OUT_DIR, 'handshake_keys.json')
|
||||
keys = {
|
||||
'client_key_data': self.client_key_data.hex() if self.client_key_data else None,
|
||||
'server_key_data': self.server_key_data.hex() if self.server_key_data else None,
|
||||
'client_key_size': len(self.client_key_data) if self.client_key_data else 0,
|
||||
'server_key_size': len(self.server_key_data) if self.server_key_data else 0,
|
||||
'timestamp': time.time()
|
||||
}
|
||||
with open(key_file, 'w') as f:
|
||||
json.dump(keys, f, indent=2)
|
||||
print(f' *** Handshake keys saved to {key_file} ***')
|
||||
|
||||
|
||||
async def pipe(reader, writer, proxy, direction):
|
||||
"""Forward data, logging and optionally decrypting."""
|
||||
try:
|
||||
while True:
|
||||
data = await reader.read(65536)
|
||||
if not data:
|
||||
break
|
||||
|
||||
# Try loading key periodically
|
||||
proxy.try_load_key()
|
||||
|
||||
# Log (and decrypt for analysis)
|
||||
proxy.log_packet(direction, data)
|
||||
|
||||
# Forward original data (we don't modify yet until decryption is confirmed)
|
||||
writer.write(data)
|
||||
await writer.drain()
|
||||
except (ConnectionResetError, BrokenPipeError, asyncio.CancelledError):
|
||||
pass
|
||||
finally:
|
||||
try:
|
||||
writer.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
async def handle_game_client(client_reader, client_writer, proxy):
|
||||
"""Handle game client connection on port 11001."""
|
||||
addr = client_writer.get_extra_info('peername')
|
||||
print(f'[+] Game client connected from {addr}')
|
||||
|
||||
try:
|
||||
server_reader, server_writer = await asyncio.open_connection(
|
||||
GAME_SERVER_IP, GAME_PORT)
|
||||
print(f'[+] Connected to real server {GAME_SERVER_IP}:{GAME_PORT}')
|
||||
except Exception as e:
|
||||
print(f'[!] Failed to connect to real server: {e}')
|
||||
client_writer.close()
|
||||
return
|
||||
|
||||
c2s = asyncio.create_task(pipe(client_reader, server_writer, proxy, 'C->S'))
|
||||
s2c = asyncio.create_task(pipe(server_reader, client_writer, proxy, 'S->C'))
|
||||
await asyncio.gather(c2s, s2c, return_exceptions=True)
|
||||
print(f'[-] Game client {addr} disconnected')
|
||||
|
||||
|
||||
async def handle_http_client(client_reader, client_writer):
|
||||
"""Handle HTTP client on port 18801."""
|
||||
addr = client_writer.get_extra_info('peername')
|
||||
print(f'[+] HTTP client connected from {addr}')
|
||||
|
||||
try:
|
||||
server_reader, server_writer = await asyncio.open_connection(
|
||||
DISPATCH_IP, HTTP_PORT)
|
||||
except Exception as e:
|
||||
print(f'[!] Failed to connect to HTTP server: {e}')
|
||||
client_writer.close()
|
||||
return
|
||||
|
||||
async def fwd_c2s(r, w):
|
||||
try:
|
||||
while True:
|
||||
data = await r.read(65536)
|
||||
if not data:
|
||||
break
|
||||
try:
|
||||
first_line = data.split(b'\r\n')[0].decode(errors='replace')
|
||||
print(f' [HTTP] C->S {first_line}')
|
||||
except:
|
||||
pass
|
||||
w.write(data)
|
||||
await w.drain()
|
||||
except:
|
||||
pass
|
||||
|
||||
async def fwd_s2c(r, w):
|
||||
try:
|
||||
while True:
|
||||
data = await r.read(65536)
|
||||
if not data:
|
||||
break
|
||||
modified = data
|
||||
for real_ip in REAL_SERVER_IPS:
|
||||
if real_ip.encode() in modified:
|
||||
pad = b' ' * (len(real_ip) - 9)
|
||||
modified = modified.replace(
|
||||
real_ip.encode(), b'127.0.0.1' + pad)
|
||||
print(f' [HTTP] *** Replacing {real_ip} -> 127.0.0.1 ***')
|
||||
for pattern in [b'a6e3077dcfb5ca02d.awsglobalaccelerator.com']:
|
||||
if pattern in modified:
|
||||
replacement = b'127.0.0.1' + b' ' * (len(pattern) - 9)
|
||||
modified = modified.replace(pattern, replacement)
|
||||
try:
|
||||
first_line = modified.split(b'\r\n')[0].decode(errors='replace')
|
||||
print(f' [HTTP] S->C {first_line} ({len(modified)}B)')
|
||||
except:
|
||||
pass
|
||||
w.write(modified)
|
||||
await w.drain()
|
||||
except:
|
||||
pass
|
||||
|
||||
c2s = asyncio.create_task(fwd_c2s(client_reader, server_writer))
|
||||
s2c = asyncio.create_task(fwd_s2c(server_reader, client_writer))
|
||||
await asyncio.gather(c2s, s2c, return_exceptions=True)
|
||||
print(f'[-] HTTP client {addr} disconnected')
|
||||
|
||||
|
||||
async def main():
|
||||
proxy = GameProxy()
|
||||
|
||||
print('=' * 60)
|
||||
print(' Fallen Doll TCP Proxy (with decryption)')
|
||||
print('=' * 60)
|
||||
print(f' Game server: {GAME_SERVER_IP}:{GAME_PORT}')
|
||||
print(f' HTTP server: {DISPATCH_IP}:{HTTP_PORT}')
|
||||
print(f' Capture dir: {OUT_DIR}')
|
||||
print(f' Key file: {KEY_FILE}')
|
||||
if os.path.exists(KEY_FILE):
|
||||
print(f' Key file EXISTS - will load on first packet')
|
||||
else:
|
||||
print(f' Key file NOT FOUND - run run_chacha_capture.py to capture')
|
||||
print()
|
||||
|
||||
game_server = await asyncio.start_server(
|
||||
lambda r, w: handle_game_client(r, w, proxy),
|
||||
'0.0.0.0', GAME_PORT, reuse_address=True)
|
||||
print(f'[*] Game proxy listening on 0.0.0.0:{GAME_PORT}')
|
||||
|
||||
http_server = await asyncio.start_server(
|
||||
handle_http_client,
|
||||
'0.0.0.0', HTTP_PORT, reuse_address=True)
|
||||
print(f'[*] HTTP proxy listening on 0.0.0.0:{HTTP_PORT}')
|
||||
|
||||
print('[*] Start the game now!')
|
||||
print()
|
||||
|
||||
async with game_server, http_server:
|
||||
await asyncio.gather(
|
||||
game_server.serve_forever(),
|
||||
http_server.serve_forever())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
asyncio.run(main())
|
||||
except KeyboardInterrupt:
|
||||
print('\n[*] Proxy stopped.')
|
||||
Reference in new issue
Block a user