From b69ca249749a8ce5c758b1238299d419ad76dc9f Mon Sep 17 00:00:00 2001 From: zefie Date: Thu, 14 Aug 2025 03:08:22 -0400 Subject: [PATCH] improve modem proxy and client sim, send telly to mame so I can fix them, somehow --- zefie_wtvp_minisrv/client_sim.js | 13 +++++-------- zefie_wtvp_minisrv/includes/config.json | 2 +- zefie_wtvp_minisrv/modem_proxy.js | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/zefie_wtvp_minisrv/client_sim.js b/zefie_wtvp_minisrv/client_sim.js index 7932b5bd..a2333a3e 100644 --- a/zefie_wtvp_minisrv/client_sim.js +++ b/zefie_wtvp_minisrv/client_sim.js @@ -72,6 +72,7 @@ class WebTVClientSimulator { this.debugLog(`Target: ${host}:${port}`); this.debugLog(`SSID: ${ssid}`); this.debugLog(`Target URL after auth: ${url}`); + this.debugLog(`Box Type: ${boxType}`); this.debugLog(`Encryption: ${useEncryption ? 'enabled' : 'disabled'}`); if (outputFile) { this.debugLog(`Output file: ${outputFile}`); @@ -162,8 +163,7 @@ class WebTVClientSimulator { ] }; - this.defaultBoxConfig = this.boxConfigs[this.defaultBox]; - this.boxType = this.boxConfigs[boxType] || this.defaultBoxConfig; + this.boxType = boxType || this.defaultBox; } getBoxConfig(box) { @@ -255,7 +255,7 @@ class WebTVClientSimulator { */ async start() { try { - await this.makeRequestWithRetry('wtv-1800', '/preregister'); + await this.makeRequestWithRetry('wtv-1800', '/preregister?scriptless-visit-reason=10&0'); } catch (error) { console.error('Failed to start simulation:', error); } @@ -531,8 +531,8 @@ class WebTVClientSimulator { request += `wtv-connect-session-id: ${this.connectSessionId}\r\n` // Add additional headers that real client sends (from PCAP analysis) if (this.useEncryption) request += `wtv-encryption: true\r\n`; - if (!this.challengeResponse) request += `wtv-script-id: -1896417432\r\n`; - if (!this.challengeResponse) request += `wtv-script-mod: 1754789923\r\n`; + if (!this.challengeResponse) request += `wtv-script-id: 0\r\n`; + if (!this.challengeResponse) request += `wtv-script-mod: 0\r\n`; request += this.getBoxHeaders(this.boxType); request += `wtv-client-address: 0.0.0.0\r\n`; @@ -600,9 +600,6 @@ class WebTVClientSimulator { request += `wtv-request-type: ${(this.request_type_download) ? 'download' : 'primary'}\r\n`; request += `wtv-show-time: 0\r\n`; - request += `wtv-system-cpuspeed: 166187148\r\n`; - request += `wtv-system-sysconfig: 4163328\r\n`; - request += `wtv-disk-size: 8006\r\n`; request += `wtv-viewer: zefie-minisrv-client-sim\r\n`; // Note: no space after colon // Add content if POST diff --git a/zefie_wtvp_minisrv/includes/config.json b/zefie_wtvp_minisrv/includes/config.json index 1fea4389..c6ca180e 100644 --- a/zefie_wtvp_minisrv/includes/config.json +++ b/zefie_wtvp_minisrv/includes/config.json @@ -214,7 +214,7 @@ "flags": "0x00000001", "privileged": true, "send_tellyscripts": true, // Best left untouched - "send_tellyscript_to_mame": false, + "send_tellyscript_to_mame": true, "dialin_number": 18006138199, "dns1ip": "10.0.0.50", "dns2ip": "8.8.8.8", diff --git a/zefie_wtvp_minisrv/modem_proxy.js b/zefie_wtvp_minisrv/modem_proxy.js index 3c28fc2f..d71d3249 100644 --- a/zefie_wtvp_minisrv/modem_proxy.js +++ b/zefie_wtvp_minisrv/modem_proxy.js @@ -12,7 +12,7 @@ const SERIAL_BAUDRATE = 115200; let NEXT_RECV_IS_LAST_ASCII = false; let DATA_MODE = false; -const THINGS_TO_STRIP = ["S95=36", "&Q5", "S51=31"]; +const THINGS_TO_STRIP = ["S95=36", "&Q5", "S51=31", "S220=0", "&Q5", "&K3", "&D2"]; const THINGS_TO_REPLACE = [ ["M0", "M1"], // M1 = Speaker on ["S11=110", "S11=50"], // S11 = Dial speed