All methods: WebRTC, fetch, Webpack, TextEncoder, JSON.stringify, Zustand, DOM, getUserMedia, WebGL, RTCPeerConnection – you win every match, camera spoof with saved photo.
Від
// ==UserScript==
// @name Omoggle Ultimate (10.0 vs 9.8 + Camera Spoof)
// @namespace http://tampermonkey.net/
// @version 4.0
// @description All methods: WebRTC, fetch, Webpack, TextEncoder, JSON.stringify, Zustand, DOM, getUserMedia, WebGL, RTCPeerConnection – you win every match, camera spoof with saved photo.
// @match *://*.omoggle.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
// ============================================================
// 1. SCORE SPOOF – every possible hook
// ============================================================
// 1a. Global score variables (used by all hooks)
window.__mogTargetScore = 10.0; // your score always 10
window.__mogOpponentScore = 9.8; // opponent always 9.8 (lower)
window.__mogJitter = 0; // no fluctuation
// 1b. Patch JSON.stringify (affects finalize and other payloads)
const origStringify = JSON.stringify;
JSON.stringify = function(value, ...args) {
if (value && typeof value === 'object') {
// Look for score fields in finalize payload
if ('selfScore' in value && 'opponentScore' in value) {
value.selfScore = window.__mogTargetScore;
value.opponentScore = window.__mogOpponentScore;
}
// Other common score fields
if ('myScore' in value) value.myScore = window.__mogTargetScore;
if ('theirScore' in value) value.theirScore = window.__mogOpponentScore;
if ('player1Score' in value && value.player1Score !== undefined) value.player1Score = window.__mogTargetScore;
if ('player2Score' in value && value.player2Score !== undefined) value.player2Score = window.__mogOpponentScore;
if ('hostScore' in value) value.hostScore = window.__mogTargetScore;
if ('clientScore' in value) value.clientScore = window.__mogTargetScore;
}
return origStringify.call(this, value, ...args);
};
// 1c. Patch TextEncoder (intercepts live WebRTC SCAN_STATE packets)
const origEncode = TextEncoder.prototype.encode;
TextEncoder.prototype.encode = function(str) {
if (typeof str === 'string' && str.includes('SCAN_STATE')) {
try {
const parsed = JSON.parse(str);
if (parsed.type === 'SCAN_STATE' && parsed.payload) {
// Your own score (if present) – set to 10
if (parsed.payload.overall !== undefined) parsed.payload.overall = window.__mogTargetScore;
// Opponent's score – set to 9.8
if (parsed.payload.opponentOverall !== undefined) parsed.payload.opponentOverall = window.__mogOpponentScore;
// Spoof all sub‑scores to match target
const s = window.__mogTargetScore;
['eyes', 'jawline', 'symmetry', 'midface', 'cheekbones', 'eyeAspect', 'harmony'].forEach(field => {
if (parsed.payload[field] !== undefined) parsed.payload[field] = s;
});
parsed.payload.isFaceStraight = true;
parsed.payload.faceStatus = 'perfect';
parsed.payload.scoringConfidence = 1.0;
str = JSON.stringify(parsed);
}
} catch(e) {}
}
return origEncode.call(this, str);
};
// 1d. Patch WebSocket message event (another live path)
const origWebSocketSend = WebSocket.prototype.send;
WebSocket.prototype.send = function(data) {
if (typeof data === 'string' && data.includes('SCAN_STATE')) {
try {
const parsed = JSON.parse(data);
if (parsed.type === 'SCAN_STATE' && parsed.payload) {
parsed.payload.overall = window.__mogTargetScore;
if (parsed.payload.opponentOverall) parsed.payload.opponentOverall = window.__mogOpponentScore;
data = JSON.stringify(parsed);
}
} catch(e) {}
}
return origWebSocketSend.call(this, data);
};
// 1e. Patch RTCDataChannel.send (WebRTC data channel)
const origDataChannelSend = RTCDataChannel.prototype.send;
RTCDataChannel.prototype.send = function(data) {
let modified = false;
let newData = data;
if (data instanceof ArrayBuffer) {
// Try to decode as JSON text
const decoder = new TextDecoder();
const str = decoder.decode(data);
if (str.includes('SCAN_STATE')) {
try {
const parsed = JSON.parse(str);
if (parsed.type === 'SCAN_STATE' && parsed.payload) {
parsed.payload.overall = window.__mogTargetScore;
if (parsed.payload.opponentOverall) parsed.payload.opponentOverall = window.__mogOpponentScore;
const encoded = new TextEncoder().encode(JSON.stringify(parsed));
newData = encoded.buffer;
modified = true;
}
} catch(e) {}
}
} else if (typeof data === 'string' && data.includes('SCAN_STATE')) {
try {
const parsed = JSON.parse(data);
if (parsed.type === 'SCAN_STATE' && parsed.payload) {
parsed.payload.overall = window.__mogTargetScore;
if (parsed.payload.opponentOverall) parsed.payload.opponentOverall = window.__mogOpponentScore;
newData = JSON.stringify(parsed);
modified = true;
}
} catch(e) {}
}
if (modified) return origDataChannelSend.call(this, newData);
return origDataChannelSend.call(this, data);
};
// 1f. Intercept fetch (finalize API)
const origFetch = window.fetch;
window.fetch = function(url, options) {
if (typeof url === 'string' && (url.includes('/api/match/finalize') || url.includes('/api/ranked/finalize'))) {
if (options && options.body) {
try {
let body = typeof options.body === 'string' ? JSON.parse(options.body) : options.body;
if (body.selfScore !== undefined) body.selfScore = window.__mogTargetScore;
if (body.opponentScore !== undefined) body.opponentScore = window.__mogOpponentScore;
if (body.myScore !== undefined) body.myScore = window.__mogTargetScore;
if (body.theirScore !== undefined) body.theirScore = window.__mogOpponentScore;
if (body.player1Score !== undefined) body.player1Score = window.__mogTargetScore;
if (body.player2Score !== undefined) body.player2Score = window.__mogOpponentScore;
options.body = JSON.stringify(body);
} catch(e) {}
}
}
return origFetch.call(this, url, options);
};
// 1g. Patch Webpack modules (VA, cv, cM) – scans for the right module
function getRequire() {
try {
let req = null;
const chunk = window.webpackChunk_N_E || window.webpackChunknextjs_app || window.webpackChunk;
if (!chunk) return null;
chunk.push([[Symbol()], {}, function(r) { req = r; }]);
return req;
} catch(e) { return null; }
}
function patchMod(mod) {
if (mod.VA && typeof mod.VA === 'function' && !mod.VA.__patched) {
const origVA = mod.VA;
mod.VA = function(e, t, r, n) {
const result = origVA(e, t, r, n);
if (result && typeof result === 'object') {
result.overall = window.__mogTargetScore;
if (result.traits) result.traits = result.traits.map(t => ({...t, score: window.__mogTargetScore}));
if (result.rawMetrics) result.rawMetrics.overall = window.__mogTargetScore;
if (result.quality) {
result.quality.reliability = 1.0;
result.quality.confidence = 1.0;
result.quality.accepted = true;
}
}
return result;
};
mod.VA.__patched = true;
}
if (mod.cv && typeof mod.cv === 'function' && !mod.cv.__patched) {
const origCV = mod.cv;
mod.cv = function(e) {
const result = origCV(e);
if (result) {
result.overall = window.__mogTargetScore;
if (result.rawMetrics) result.rawMetrics.overall = window.__mogTargetScore;
}
return result;
};
mod.cv.__patched = true;
}
if (mod.cM && typeof mod.cM === 'function' && !mod.cM.__patched) {
const origCM = mod.cM;
mod.cM = function(e, t, r) {
const result = origCM(e, t, r);
if (result) {
result.reliability = 1.0;
result.confidence = 1.0;
result.accepted = true;
}
return result;
};
mod.cM.__patched = true;
}
}
function tryPatchStore(mod) {
if (!mod || !mod.T) return false;
const store = mod.T;
if (typeof store.setState !== 'function') return false;
const state = store.getState();
if (!state || typeof state.myScore === 'undefined') return false;
const origSetState = store.setState;
store.setState = function(partial, replace, ...args) {
if (partial && typeof partial === 'object') {
if ('myScore' in partial) partial.myScore = window.__mogTargetScore;
if ('myScoreRaw' in partial) partial.myScoreRaw = window.__mogTargetScore;
if ('opponentScore' in partial) partial.opponentScore = window.__mogOpponentScore;
}
if (typeof partial === 'function') {
const origFn = partial;
partial = function(state) {
const result = origFn(state);
if (result) {
if ('myScore' in result) result.myScore = window.__mogTargetScore;
if ('myScoreRaw' in result) result.myScoreRaw = window.__mogTargetScore;
if ('opponentScore' in result) result.opponentScore = window.__mogOpponentScore;
}
return result;
};
}
return origSetState.call(this, partial, replace, ...args);
};
console.log('[Ultimate] Zustand store patched');
return true;
}
function scanModules(require) {
let id = 0;
const MAX = 200000;
let patched = false;
function nextBatch() {
if (patched) return;
for (let i = 0; i < 500 && id < MAX; i++, id++) {
try {
const mod = require(id);
if (mod && typeof mod === 'object') {
patchMod(mod);
tryPatchStore(mod);
patched = true;
}
} catch(e) {}
}
if (id < MAX) setTimeout(nextBatch, 50);
}
nextBatch();
}
const interval = setInterval(() => {
const req = getRequire();
if (req) {
scanModules(req);
clearInterval(interval);
}
}, 500);
// 1h. DOM text override (visual fallback)
function fixDisplayedScore() {
const selector = 'span.font-mono.font-black.text-white.drop-shadow-md, .score-value, [class*="score"]';
const observer = new MutationObserver(() => {
document.querySelectorAll(selector).forEach(el => {
const txt = el.innerText.trim();
if (/^\d+(\.\d)?$/.test(txt) && parseFloat(txt) !== window.__mogTargetScore) {
el.innerText = window.__mogTargetScore.toFixed(1);
}
});
});
observer.observe(document.body, { childList: true, subtree: true, characterData: true });
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', fixDisplayedScore);
else fixDisplayedScore();
// ============================================================
// 2. CAMERA SPOOF – persistent photo using multiple methods
// ============================================================
let cameraActive = false;
let cameraStream = null;
let imageElement = null;
let canvas = null, ctx = null;
let animationId = null;
const STORAGE_KEY = 'omoggle_ultimate_photo';
function initCanvas() {
if (canvas) return;
canvas = document.createElement('canvas');
canvas.width = 640;
canvas.height = 480;
ctx = canvas.getContext('2d');
ctx.fillStyle = '#000';
ctx.fillRect(0, 0, 640, 480);
}
function drawImage(img) {
if (!ctx) return;
ctx.clearRect(0, 0, 640, 480);
const scale = Math.max(640 / img.width, 480 / img.height);
const dx = (640 - img.width * scale) / 2;
const dy = (480 - img.height * scale) / 2;
ctx.drawImage(img, dx, dy, img.width * scale, img.height * scale);
}
function loadImageFromDataURL(dataURL) {
const img = new Image();
img.onload = () => {
imageElement = img;
drawImage(img);
if (cameraActive && canvas) {
if (cameraStream) {
const newStream = canvas.captureStream(30);
const newTrack = newStream.getVideoTracks()[0];
const oldTracks = cameraStream.getVideoTracks();
oldTracks.forEach(t => t.stop());
cameraStream = newStream;
// Replace in all video elements using this stream
document.querySelectorAll('video').forEach(vid => {
if (vid.srcObject === cameraStream) vid.srcObject = newStream;
});
}
}
};
img.src = dataURL;
}
function loadSavedPhoto() {
const saved = localStorage.getItem(STORAGE_KEY);
if (saved) loadImageFromDataURL(saved);
else {
// create a default "no photo" image
initCanvas();
ctx.fillStyle = '#222';
ctx.fillRect(0, 0, 640, 480);
ctx.fillStyle = '#fff';
ctx.font = '24px Arial';
ctx.fillText('No photo', 280, 240);
imageElement = null;
}
}
function savePhotoFromFile(file) {
const reader = new FileReader();
reader.onload = e => {
localStorage.setItem(STORAGE_KEY, e.target.result);
loadImageFromDataURL(e.target.result);
};
reader.readAsDataURL(file);
}
// 2a. Override getUserMedia
const originalGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);
navigator.mediaDevices.getUserMedia = async function(constraints) {
if (cameraActive && constraints && constraints.video) {
initCanvas();
if (imageElement) drawImage(imageElement);
if (!cameraStream) cameraStream = canvas.captureStream(30);
if (constraints.audio) {
try {
const audioStream = await originalGetUserMedia({ audio: constraints.audio });
const tracks = [...cameraStream.getVideoTracks(), ...audioStream.getAudioTracks()];
return new MediaStream(tracks);
} catch(e) {
return cameraStream;
}
}
return cameraStream;
}
return originalGetUserMedia(constraints);
};
// 2b. Override RTCPeerConnection.addTrack
const origAddTrack = RTCPeerConnection.prototype.addTrack;
RTCPeerConnection.prototype.addTrack = function(track, ...streams) {
if (cameraActive && track.kind === 'video' && cameraStream) {
const fakeTrack = cameraStream.getVideoTracks()[0];
if (fakeTrack) return origAddTrack.call(this, fakeTrack, ...streams);
}
return origAddTrack.call(this, track, ...streams);
};
// 2c. Hook WebGL texImage2D (fallback)
function hookWebGL() {
const hookProto = (proto) => {
const original = proto.texImage2D;
proto.texImage2D = function(...args) {
if (cameraActive && args[args.length - 1] instanceof HTMLVideoElement) {
if (!canvas) initCanvas();
if (imageElement) drawImage(imageElement);
return original.apply(this, [args[0], args[1], args[2], args[3], args[4], canvas]);
}
return original.apply(this, args);
};
};
if (window.WebGLRenderingContext) hookProto(window.WebGLRenderingContext.prototype);
if (window.WebGL2RenderingContext) hookProto(window.WebGL2RenderingContext.prototype);
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', hookWebGL);
else hookWebGL();
// 2d. Force stream update every second (keepalive)
setInterval(() => {
if (cameraActive && cameraStream) {
const fakeTrack = cameraStream.getVideoTracks()[0];
if (fakeTrack) {
document.querySelectorAll('video.scanner-video, video').forEach(vid => {
if (vid.srcObject !== cameraStream && vid.srcObject) vid.srcObject = cameraStream;
});
if (window._mogPCs) {
window._mogPCs.forEach(pc => {
try {
pc.getSenders().forEach(sender => {
if (sender.track && sender.track.kind === 'video' && sender.track !== fakeTrack) {
sender.replaceTrack(fakeTrack).catch(() => {});
}
});
} catch(e) {}
});
}
}
}
}, 1000);
// ============================================================
// 3. MOBILE UI (toggle, photo picker, drag)
// ============================================================
function buildUI() {
if (document.getElementById('ultimate-ui')) return;
// Toggle button
const toggleBtn = document.createElement('button');
toggleBtn.id = 'ultimate-toggle';
toggleBtn.textContent = '⚙️';
toggleBtn.style.cssText = `
position: fixed;
bottom: 20px;
right: 20px;
width: 52px;
height: 52px;
border-radius: 50%;
background: #00ff88;
border: none;
font-size: 28px;
font-weight: bold;
color: #000;
z-index: 1000001;
box-shadow: 0 2px 12px rgba(0,0,0,0.3);
cursor: pointer;
touch-action: manipulation;
display: flex;
align-items: center;
justify-content: center;
`;
document.body.appendChild(toggleBtn);
// Main panel
const panel = document.createElement('div');
panel.id = 'ultimate-ui';
panel.style.cssText = `
position: fixed;
bottom: 80px;
right: 20px;
width: 280px;
max-width: 85vw;
background: #111;
border: 3px solid #00ff88;
border-radius: 16px;
padding: 15px;
color: white;
font-family: monospace;
z-index: 1000000;
display: none;
flex-direction: column;
gap: 10px;
backdrop-filter: blur(8px);
touch-action: none;
`;
panel.innerHTML = `
<div style="display:flex; justify-content:space-between; align-items:center; cursor:grab;" id="ultimate-header">
<span style="color:#00ff88;">ULTIMATE SPOOF</span>
<span style="font-size:10px;">v4.0</span>
</div>
<div style="display:flex; justify-content:space-between; align-items:center;">
<span>📷 Camera Spoof</span>
<label style="display:flex; align-items:center; gap:8px;">
<span id="camToggleLabel">OFF</span>
<input type="checkbox" id="camToggleCheckbox" style="transform:scale(1.2);">
</label>
</div>
<button id="choosePhotoBtn" style="background:#333; border:1px solid #00ff88; border-radius:8px; padding:8px; color:white; touch-action:manipulation;">📸 Select Photo (saved)</button>
<input type="file" id="photoInput" accept="image/*" style="display:none;">
<div id="camStatus" style="font-size:11px; color:#aaa;">No photo loaded</div>
<div style="font-size:10px; border-top:1px solid #333; margin-top:5px; padding-top:5px;">
✅ Score: <span style="color:#00ff88;">10.0 (you)</span> | <span style="color:#f5a623;">9.8 (opp)</span>
</div>
`;
document.body.appendChild(panel);
// Drag functionality (touch + mouse)
const header = document.getElementById('ultimate-header');
let dragging = false, startX = 0, startY = 0, startLeft = 0, startTop = 0;
function onStart(e) {
e.preventDefault();
dragging = true;
const clientX = e.clientX ?? (e.touches ? e.touches[0].clientX : 0);
const clientY = e.clientY ?? (e.touches ? e.touches[0].clientY : 0);
startX = clientX;
startY = clientY;
startLeft = panel.offsetLeft;
startTop = panel.offsetTop;
panel.style.transition = 'none';
header.style.cursor = 'grabbing';
}
function onMove(e) {
if (!dragging) return;
e.preventDefault();
const clientX = e.clientX ?? (e.touches ? e.touches[0].clientX : 0);
const clientY = e.clientY ?? (e.touches ? e.touches[0].clientY : 0);
let newLeft = startLeft + (clientX - startX);
let newTop = startTop + (clientY - startY);
newLeft = Math.max(0, Math.min(window.innerWidth - panel.offsetWidth, newLeft));
newTop = Math.max(0, Math.min(window.innerHeight - panel.offsetHeight, newTop));
panel.style.left = newLeft + 'px';
panel.style.top = newTop + 'px';
panel.style.right = 'auto';
}
function onEnd() {
dragging = false;
panel.style.transition = '';
header.style.cursor = 'grab';
}
header.addEventListener('mousedown', onStart);
document.addEventListener('mousemove', onMove);
document.addEventListener('mouseup', onEnd);
header.addEventListener('touchstart', onStart, { passive: false });
document.addEventListener('touchmove', onMove, { passive: false });
document.addEventListener('touchend', onEnd);
// Toggle panel visibility
toggleBtn.addEventListener('click', (e) => {
e.stopPropagation();
const isVisible = panel.style.display === 'flex';
panel.style.display = isVisible ? 'none' : 'flex';
});
// Camera toggle
const checkbox = document.getElementById('camToggleCheckbox');
const camLabel = document.getElementById('camToggleLabel');
const statusDiv = document.getElementById('camStatus');
checkbox.addEventListener('change', () => {
cameraActive = checkbox.checked;
camLabel.textContent = cameraActive ? 'ON' : 'OFF';
if (cameraActive) {
initCanvas();
if (!imageElement) loadSavedPhoto();
statusDiv.textContent = 'Active – using ' + (imageElement ? 'photo' : 'default image');
} else {
statusDiv.textContent = 'Camera spoof off';
}
});
// Photo picker
const chooseBtn = document.getElementById('choosePhotoBtn');
const fileInput = document.getElementById('photoInput');
chooseBtn.addEventListener('click', () => fileInput.click());
fileInput.addEventListener('change', (e) => {
if (e.target.files[0]) {
savePhotoFromFile(e.target.files[0]);
statusDiv.textContent = 'Photo saved! Enable spoof.';
}
});
// Load saved photo on startup
loadSavedPhoto();
if (localStorage.getItem(STORAGE_KEY)) statusDiv.textContent = 'Saved photo loaded. Enable spoof.';
else statusDiv.textContent = 'No photo. Select one.';
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', buildUI);
else buildUI();
console.log('[Ultimate] All hooks active – you should now win every match.');
})();