Greasy Fork

AppleWare Key Bypasser

by yours truly, an appleware bypasser :)

目前为 2024-07-18 提交的版本。查看 最新版本

// ==UserScript==
// @name         AppleWare Key Bypasser
// @description  by yours truly, an appleware bypasser :)
// @version      0.1
// @license MIT
// @match        https://loot-link.com/*
// @grant        GM_xmlhttpRequest
// @grant        GM_setValue
// @grant        GM_getValue
// @connect      gforanopportu.info
// @connect      entlysearchin.info
// @run-at       document-end
// @namespace https://greasyfork.org/users/1287532
// ==/UserScript==

(function() {
    'use strict';

    // Function to decode the string
    function decodeString(input, length = 5) {
        let result = '';
        let decodedString = atob(input);
        let key = decodedString.substring(0, length);
        let message = decodedString.substring(length);

        for (let i = 0; i < message.length; i++) {
            let charCode = message.charCodeAt(i);
            let keyCharCode = key.charCodeAt(i % key.length);
            let decodedCharCode = charCode ^ keyCharCode;
            result += String.fromCharCode(decodedCharCode);
        }

        return result;
    }

    // Function to perform the main operations
    async function main() {
        try {
            const response = await fetch('https://gforanopportu.info/tc', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'
                },
                body: JSON.stringify({
                    tid: TID,
                    bl: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
                    session: Math.floor(Math.random() * (0x3b9ac9ff - 0x5f5e100 + 0x1)) + 0x5f5e100,
                    max_tasks: 2,
                    design_id: 3,
                    cur_url: 'https://loot-link.com/s?c56dbf87&data=FvC8CevZd3UHGx6Y2T0z9pyJNR2l4arjXnBvtJDv3n0rqAcH6k1C868AxMS5jWD%2b8uTlXG2PiGH59eU8K%2flnr4gtu19Bc8pZRnPBgxnJKbEQp286GgdUU3ndX2F5%2fm8R',
                    doc_ref: 'https://appleware.dev/',
                    cookie_id: (Math.floor(Math.random() * (0x3b9ac9ff - 0x5f5e100 + 0x1)) + 0x5f5e100).toString(),
                    taboola_user_sync: '3192901e-73e7-4994-96a6-63cbeb29d09e-tuctd8f23b7',
                    fps: 512,
                    gpu: 'nvidia geforce rtx 2060',
                    isMobile: false,
                    tier: 3,
                    type: 'BENCHMARK'
                })
            });

            const tc = (await response.json())[0];

            const socket = new WebSocket(`wss://2.entlysearchin.info/c?uid=${tc.urid}&cat=${tc.task_id}&key=${KEY}`);

            socket.onopen = function(event) {
                console.log('WebSocket connection opened:', event);
            };

            socket.onmessage = function(event) {
                console.log('Message received:', event.data);

                const message = event.data;
                const prefix = 'r:';
                if (message.startsWith(prefix)) {
                    const extractedText = message.substring(prefix.length);
                    setTimeout(function() {
                      window.location.href = decodeString(extractedText);
                    }, 4000);

                }
            };

            socket.onerror = function(event) {
                console.error('WebSocket error:', event);
                alert('WebSocket error: ' + event);
            };

            socket.onclose = function(event) {
                console.log('WebSocket connection closed:', event);
            };

            await fetch(`https://2.entlysearchin.info/st?uid=${tc.urid}&cat=${tc.task_id}`, {
                method: 'POST'
            });

        } catch (error) {
            console.error('An error occurred:', error);
            alert('An error occurred: ' + error.message);
        }
    }

    // Run the main function after the page has loaded
    window.addEventListener('load', main);
})();