Scenexe Socket Fiddler

Scenexe socket fiddler. Modify incoming and outgoing packets by writing functions for incoming and outgoing.

Pada tanggal 07 Januari 2023. Lihat %(latest_version_link).

Skrip ini tidak untuk dipasang secara langsung. Ini adalah pustaka skrip lain untuk disertakan dengan direktif meta // @require https://update.greatest.deepsurf.us/scripts/457775/1135824/Scenexe%20Socket%20Fiddler.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Scenexe Socket Fiddler
// @namespace    ScenexeSocketFiddler
// @version      0.1
// @description  Scenexe socket fiddler. Modify incoming and outgoing packets by writing functions for incoming and outgoing.
// @author       discordtehe
// @match        https://*.scenexe.io
// @require      https://greatest.deepsurf.us/scripts/457386-scenexeutils/code/ScenexeUtils.js?version=1134854
// @grant        none
// ==/UserScript==

window.incoming = (data)=>{return data};
window.outgoing = (data)=>{return data};

WebSocket.prototype.addEventListener = new Proxy(WebSocket.prototype.addEventListener, {
    apply: function (target, scope, args) {
        if (args[0] === 'message') {
            args[1] = new Proxy(args[1], {
                apply: function(ftarget, fscope, fargs) {
                    var decoded = decode(new Uint8Array(fargs[0].data));
                    decoded = incoming(decoded);
                    if (decoded != undefined)
                        fargs[0] = new MessageEvent('message', {data: encode(decoded)})
                    let fdata = ftarget.apply(fscope, fargs);
                    return fdata;
                }
            })
        }
        let data = target.apply(scope, args);
        return data;
    }
})

WebSocket.prototype.send = new Proxy(WebSocket.prototype.send, {
    apply: function (target, scope, args) {
        var decoded = decodeInverse(new Uint8Array(args[0])); //decodeInverse because this data has been already encoded by scenexe's main.js
        decoded = outgoing(decoded);
        if (decoded != undefined)
            args[0] = encodeInverse(decoded);
        let data = target.apply(scope, args);
        return data;
    }
})