improve modem proxy and client sim, send telly to mame so I can fix them, somehow

This commit is contained in:
zefie
2025-08-14 03:08:22 -04:00
parent d5a4330b43
commit b69ca24974
3 changed files with 7 additions and 10 deletions

View File

@@ -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

View File

@@ -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",

View File

@@ -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