Last active
December 24, 2025 02:14
-
-
Save KNN-07/62a12e3346ce857230a925103767846b to your computer and use it in GitHub Desktop.
RoPhim RoX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name RoX Ultimate - Core | |
| // @namespace https://www.rophim.li/ | |
| // @version 2.3 | |
| // @description Core patch for RoPhim | |
| // @match https://www.rophim.li/* | |
| // @run-at document-start | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| // Function to check if URL is related to user info | |
| const isUserInfoUrl = (url) => { | |
| try { | |
| return typeof url === "string" && url.includes("/v1/user/info"); | |
| } catch { | |
| return false; | |
| } | |
| }; | |
| // Function to patch response data | |
| const patchResponse = (responseText) => { | |
| try { | |
| // Try to parse as JSON first | |
| JSON.parse(responseText); | |
| // Replace VIP status, verification status, VIP expiration, and coin balance | |
| return responseText | |
| .replace(/("is_vip"|"is_verified")\s*:\s*false/g, "$1:true") | |
| .replace(/("vip_expires_at")\s*:\s*0/g, "$1:253394586000") // Far future timestamp | |
| .replace(/("coin_balance")\s*:\s*\d+/g, '"coin_balance":999999999'); | |
| } catch { | |
| // If not JSON, return as is | |
| return responseText; | |
| } | |
| }; | |
| // Intercept XMLHttpRequest | |
| if (window.XMLHttpRequest) { | |
| const originalOpen = XMLHttpRequest.prototype.open; | |
| const originalSend = XMLHttpRequest.prototype.send; | |
| XMLHttpRequest.prototype.open = function(method, url, async, user, password) { | |
| this._url = url || ""; | |
| return originalOpen.call(this, method, url, async, user, password); | |
| }; | |
| XMLHttpRequest.prototype.send = function(...args) { | |
| this.addEventListener("load", () => { | |
| if (isUserInfoUrl(this._url)) { | |
| const originalResponse = this.responseText || ""; | |
| const patchedResponse = patchResponse(originalResponse); | |
| if (originalResponse !== patchedResponse) { | |
| Object.defineProperty(this, "responseText", { | |
| get: () => patchedResponse | |
| }); | |
| Object.defineProperty(this, "response", { | |
| get: () => patchedResponse | |
| }); | |
| } | |
| } | |
| }); | |
| return originalSend.apply(this, args); | |
| }; | |
| } | |
| // Intercept fetch API | |
| if (window.fetch) { | |
| const originalFetch = window.fetch; | |
| window.fetch = function(input, init) { | |
| const url = typeof input === "string" ? input : (input?.url || ""); | |
| return originalFetch.apply(this, arguments).then(async (response) => { | |
| if (isUserInfoUrl(url)) { | |
| const responseClone = response.clone(); | |
| const originalText = await responseClone.text(); | |
| const patchedText = patchResponse(originalText); | |
| if (originalText !== patchedText) { | |
| return new Response(patchedText, { | |
| status: response.status, | |
| statusText: response.statusText, | |
| headers: response.headers | |
| }); | |
| } | |
| } | |
| return response; | |
| }); | |
| }; | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment