AppleWare Key Bypasser

by yours truly, an appleware bypasser :)

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         AppleWare Key Bypasser
// @description  by yours truly, an appleware bypasser :)
// @version      0.2
// @license MIT
// @icon         https://appleware.dev/favicon.png
// @match        https://loot-link.com/*
// @match        https://lootdest.org/*
// @grant        unsafeWindow
// @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 waitForScript() {
        return new Promise((resolve, reject) => {
            const observer = new MutationObserver((mutations, observer) => {
                const dataScript = document.querySelector("body > script:nth-child(2)");
                if (dataScript) {
                    observer.disconnect();
                    resolve(dataScript);
                }
            });

            observer.observe(document.body, {
                childList: true,
                subtree: true,
            });
        });
    }

    async function main() {
        try {
            var dataScript = await waitForScript();
            eval(dataScript.innerText);

            var TID = p.TID;
            var KEY = p.KEY;

            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: window.location.href,
                    doc_ref: document.referrer,
                    cookie_id: (
                        Math.floor(Math.random() * (0x3b9ac9ff - 0x5f5e100 + 0x1)) +
                        0x5f5e100
                    ).toString(),
                    taboola_user_sync: "",
                    fps: 512,
                    gpu: "nvidia",
                    isMobile: true,
                    tier: 1,
                    type: "FALLBACK",
                }),
            });

            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);
                    }, 2000);
                }
            };

            socket.onerror = function (event) {
                console.error("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);
        }
    }

    window.addEventListener("load", main);
})();