Deadshot.io ESP (صناديق، هيكل عظمي، صحة، أسماء، متتبعات)، Aimbot، Aim FOV، تنعيم، Magic Bullet، بدون ارتداد، بدون انتشار.
// ==UserScript==
// @name Deadshot Cheat
// @name:en Deadshot Cheat
// @name:zh Deadshot 辅助
// @name:hi Deadshot चीट
// @name:es Cheat de Deadshot
// @name:ar غش Deadshot
// @name:fr Cheat Deadshot
// @name:bn Deadshot চিট
// @name:pt Cheat Deadshot
// @name:id Cheat Deadshot
// @name:ur ڈیڈ شاٹ چیٹ
// @name:ru Чит для Deadshot
// @name:de Deadshot Cheat
// @name:ja Deadshot チート
// @name:yo Deadshot Cheat
// @name:mr Deadshot चीट
// @name:vi Hack Deadshot
// @name:te Deadshot చీట్
// @name:sw Deadshot Cheat
// @name:ha Deadshot Cheat
// @name:tr Deadshot Hilesi
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Deadshot.io ESP (Boxes, Skeleton, Health, Names, Tracers), Aimbot, Aim FOV, Smoothing, Magic Bullet, No Recoil, No Spread.
// @description:en Deadshot.io ESP (Boxes, Skeleton, Health, Names, Tracers), Aimbot, Aim FOV, Smoothing, Magic Bullet, No Recoil, No Spread.
// @description:zh Deadshot.io 辅助 (方框, 骨骼, 血条, 名字, 射线), 自瞄, 范围, 平滑, 魔术子弹, 无后坐力, 无扩散.
// @description:hi Deadshot.io ईएसपी (बॉक्स, कंकाल, स्वास्थ्य, नाम, ट्रेसर), एमबॉट, लक्ष्य एफओवी, स्मूथिंग, मैजिक बुलेट, कोई रिकॉइल नहीं, कोई प्रसार नहीं।
// @description:es Deadshot.io ESP (Cajas, Esqueleto, Salud, Nombres, Trazadores), Aimbot, Aim FOV, Suavizado, Magic Bullet, Sin Retroceso, Sin Dispersión.
// @description:ar Deadshot.io ESP (صناديق، هيكل عظمي، صحة، أسماء، متتبعات)، Aimbot، Aim FOV، تنعيم، Magic Bullet، بدون ارتداد، بدون انتشار.
// @description:fr Deadshot.io ESP (Boîtes, Squelette, Santé, Noms, Traceurs), Aimbot, Aim FOV, Lissage, Magic Bullet, Sans Recul, Sans Dispersion.
// @description:bn Deadshot.io ESP (বক্স, কঙ্কাল, স্বাস্থ্য, নাম, ট্রাসার), এইমবট, লক্ষ্য FOV, মসৃণতা, ম্যাজিক বুলেট, নো রিকোয়েল, নো স্প্রেড।
// @description:pt Deadshot.io ESP (Caixas, Esqueleto, Saúde, Nomes, Traçadores), Aimbot, Aim FOV, Suavização, Magic Bullet, Sem Recuo, Sem Dispersão.
// @description:id Deadshot.io ESP (Kotak, Kerangka, Kesehatan, Nama, Tracer), Aimbot, Aim FOV, Smoothing, Magic Bullet, No Recoil, No Spread.
// @description:ur Deadshot.io ESP (باکس، کنکال، صحت، نام، ٹریسر)، ایمبوٹ، ایم ایف او وی، ہموار کرنا، میجک بلٹ، نو ریکوائل، نو سپریڈ۔
// @description:ru Deadshot.io ESP (Боксы, Скелеты, Здоровье, Имена, Трейсеры), Аимбот, FOV, Сглаживание, Магические пули, Без отдачи, Без разброса.
// @description:de Deadshot.io ESP (Boxen, Skelett, Gesundheit, Namen, Tracer), Aimbot, Aim FOV, Smoothing, Magic Bullet, No Recoil, No Spread.
// @description:ja Deadshot.io ESP (ボックス、スケルトン、ヘルス、名前、トレーサー)、エイムボット、エイムFOV、スムージング、マジックブレット、ノーリコイル、ノースプレッド。
// @description:yo Deadshot.io ESP (Boxes, Skeleton, Health, Names, Tracers), Aimbot, Aim FOV, Smoothing, Magic Bullet, No Recoil, No Spread.
// @description:mr Deadshot.io ESP (बॉक्स, सांगाडा, आरोग्य, नावे, ट्रेसर), एमबॉट, एम एफओव्ही, स्मूथिंग, मॅजिक बुलेट, नो रिकॉइल, नो स्प्रेड.
// @description:vi Deadshot.io ESP (Hộp, Bộ xương, Máu, Tên, Đường kẻ), Aimbot, Aim FOV, Làm mượt, Magic Bullet, Không giật, Không tản đạn.
// @description:te Deadshot.io ESP (బాక్సులు, అస్థిపంజరం, ఆరోగ్యం, పేర్లు, ట్రేసర్లు), ఐమ్బాట్, ఐమ్ FOV, స్మూత్ చేయడం, మ్యాజిక్ బుల్లెట్, నో రికోయిల్, నో స్ప్రెడ్.
// @description:sw Deadshot.io ESP (Boxes, Skeleton, Afya, Majina, Tracers), Aimbot, Aim FOV, Smoothing, Magic Bullet, No Recoil, No Spread.
// @description:ha Deadshot.io ESP (Boxes, Skeleton, Lafiya, Suna, Tracers), Aimbot, Aim FOV, Smoothing, Magic Bullet, No Recoil, No Spread.
// @description:tr Deadshot.io ESP (Kutular, İskelet, Sağlık, İsimler, İzleyiciler), Aimbot, Aim FOV, Yumuşatma, Sihirli Mermi, Geri Tepme Yok, Yayılma Yok.
// @author xenona
// @match *://deadshot.io/*
// @run-at document-start
// @grant none
// @license mit
// @icon https://thumbnails.gamenora.com/DeadShot.io.webp
// ==/UserScript==
(() => {
(() => {
'use strict';
const decoder = new TextDecoder();
const domHost = () => document.fullscreenElement || document.webkitFullscreenElement || document.body || document.documentElement;
const identRe = String.raw`[A-Za-z_$][\w$]*`;
const anyPropRe = String.raw`(?:\.[A-Za-z_$][\w$]*|\[[^\]]+\])`;
const strPropRe = (name) => String.raw`(?:\.${name}|\[['"]${name}['"]\])`;
const reEsp = /(?<anchorVec>[A-Za-z_$][\w$]*)\['copy'\]\((?<entityVar>[A-Za-z_$][\w$]*)\[[^\]]+\]\['backup'\]\[(?<coordIndexVar>[A-Za-z_$][\w$]*)\]\),\k<anchorVec>\['y'\]\+=2\.79,\k<anchorVec>\['y'\]\+=0\.45,\k<anchorVec>\['y'\]-=\k<entityVar>\[[^\]]+\]\*1\.8;[\s\S]{0,500}?(?<visibleVar>[A-Za-z_$][\w$]*)=!!\[\],(?<offsetExpr>[A-Za-z_$][\w$]*)=-0\.7,\k<anchorVec>\['y'\]\+=\k<offsetExpr>,[A-Za-z_$][\w$]*=0x0;[\s\S]{0,3200}?\k<anchorVec>\['y'\]-=\k<offsetExpr>,\k<anchorVec>\['(?<projectMethod>[A-Za-z_$][\w$]*)'\]\((?<worldToCameraExpr>[\s\S]*?)\)\['\k<projectMethod>'\]\((?<projectionExpr>[\s\S]*?)\);var (?<screenVar>[A-Za-z_$][\w$]*)=\k<entityVar>\[[^\]]+\]\[\k<coordIndexVar>\],(?<nearVar>[A-Za-z_$][\w$]*)=0\.999,(?<farVar>[A-Za-z_$][\w$]*)=0x1;\k<anchorVec>\['z'\]<0x1\?\((?<body>[\s\S]{0,1800}?)\):/g;
const reIdPkt = /(?<clanArr>[A-Za-z_$][\w$]*)\[(?<idExpr>(?<packetVar>[A-Za-z_$][\w$]*)\['id'\])\]=undefined,\k<packetVar>\[[^\]]+\]\[[^\]]+\]\(','\)!=-(?:0x1|1)&&\(\k<clanArr>\[\k<idExpr>\]=\k<packetVar>\[[^\]]+\]\[[^\]]+\]\(','\)\[(?:0x0|0)\],\k<packetVar>\[[^\]]+\]=\k<packetVar>\[[^\]]+\]\[[^\]]+\]\(','\)\[(?:0x1|1)\]\),(?<nameArr>[A-Za-z_$][\w$]*)\[\k<idExpr>\]=\k<packetVar>\[[^\]]+\],[A-Za-z_$][\w$]*\[\k<idExpr>\]=\k<packetVar>\[[^\]]+\],(?<nameplateFn>[A-Za-z_$][\w$]*)\((?<lookupFn>[A-Za-z_$][\w$]*)\(\k<idExpr>\),\k<nameArr>\[\k<idExpr>\]\),[A-Za-z_$][\w$]*\(\);/g;
const reSpawn = /(?<entityVar>[A-Za-z_$][\w$]*)\[[^\]]+\]!==undefined&&(?<nameplateFn>[A-Za-z_$][\w$]*)\(\k<entityVar>,(?<nameArr>[A-Za-z_$][\w$]*)\[\k<entityVar>\[(?<serverIdExpr>[^\]]+)\]\]\);var (?<pushArrayVar>[A-Za-z_$][\w$]*)=(?<upVar>[A-Za-z_$][\w$]*),(?<lenVar>[A-Za-z_$][\w$]*)=\k<upVar>\['length'\];/g;
const reShot = /[A-Za-z_$][\w$]*&&[A-Za-z_$][\w$]*!=null&&\((?<tick>[A-Za-z_$][\w$]*)=Math\[[^\]]+\]\(\k<tick>\),(?<packetObj>[A-Za-z_$][\w$]*)(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)=[A-Za-z_$][\w$]*,\k<packetObj>(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)=\k<tick>,\k<packetObj>(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)=[A-Za-z_$][\w$]*\+[A-Za-z_$][\w$]*\([^)]+\),\k<packetObj>(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)=[A-Za-z_$][\w$]*\[[A-Za-z_$][\w$]*\]\['y'\],(?<hit>[A-Za-z_$][\w$]*)!=undefined&&\(\k<packetObj>(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)=\k<hit>\['array'\]\[0x0\]\['point'\]\['x'\],\k<packetObj>(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)=\k<hit>\['array'\]\[0x0\](?:\['point'\]|\[[^\]]+\])\['y'\],\k<packetObj>(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)=\k<hit>\['array'\]\[0x0\]\['point'\]\['z'\]\),(?<sendFn>[A-Za-z_$][\w$]*)\(\k<packetObj>(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*),[A-Za-z_$][\w$]*\),[A-Za-z_$][\w$]*(?:\['push'\]|\.push)\([A-Za-z_$][\w$]*\),[A-Za-z_$][\w$]*\(\)\)|(?<packetRoot>[A-Za-z_$][\w$]*)&&(?<hitRoot>[A-Za-z_$][\w$]*)!=null&&\((?<frameTick>[A-Za-z_$][\w$]*)=Math\['[^']+'\]\(\k<frameTick>\),(?<packetStore>[A-Za-z_$][\w$]*)\['[^']+'\]\['[^']+'\]=[A-Za-z_$][\w$]*,\k<packetStore>\[[A-Za-z_$][\w$]*\(0xde6\)\]\['[^']+'\]=\k<frameTick>,\k<packetStore>\['[^']+'\]\[[A-Za-z_$][\w$]*\(0x93d\)\]=[A-Za-z_$][\w$]*\+[A-Za-z_$][\w$]*\(Si\['[^']+'\],Si\['[^']+'\],[A-Za-z_$][\w$]*\),\k<packetStore>\['[^']+'\]\['[^']+'\]=[A-Za-z_$][\w$]*\[[A-Za-z_$][\w$]*\]\['y'\],\k<hitRoot>!=undefined&&\(\k<packetStore>\[[A-Za-z_$][\w$]*\(0xde6\)\]\[[A-Za-z_$][\w$]*\(0x7cb\)\]=\k<hitRoot>\['array'\]\[0x0\]\['point'\]\['x'\],\k<packetStore>\[[A-Za-z_$][\w$]*\(0xde6\)\]\[[A-Za-z_$][\w$]*\(0xadf\)\]=\k<hitRoot>\['array'\]\[0x0\](?:\['point'\]|\[[A-Za-z_$][\w$]*\(0x49e\)\])\['y'\],\k<packetStore>\['[^']+'\]\['[^']+'\]=\k<hitRoot>\['array'\]\[0x0\]\['point'\]\['z'\]\),(?<rawSendFn>[A-Za-z_$][\w$]*)\(\k<packetStore>\['[^']+'\],[A-Za-z_$][\w$]*\),[A-Za-z_$][\w$]*(?:\['push'\]|\.push)\([A-Za-z_$][\w$]*\),[A-Za-z_$][\w$]*\(\)\)/g;
const reAim = /(?<anchor>Si\[[^\]]+\]=Wn,Si\[[^\]]+\]=Wk;while\(Wn\[Rl\]\['y'\]>=Q1\)\{Wn\[Rl\]\['y'\]-=Q1;\}while\(Wn\[Rl\]\['y'\]<0x0\)\{Wn\[Rl\]\['y'\]\+=Q1;\}Ww=Math\[[^\]]+\]\(Math\['max'\]\(-Wj,Math\[[^\]]+\]\(Wj,Ww\)\)\),Wn\[Rl\]\['y'\]=Math\[[^\]]+\]\(Wn\[Rl\]\['y'\]\);)/g;
const reChatSend = /(?<ready>[A-Za-z_$][\w$]*\['readyState'\]==0x1)&&(?<socket>[A-Za-z_$][\w$]*)\['send'\]\((?<serializer>[A-Za-z_$][\w$]*)\((?<packetRoot>[A-Za-z_$][\w$]*)(?<packetAccess>(?:\.[A-Za-z_$][\w$]*|\[[^\]]+\])*)\)\)/g;
const escRe = (value) => value.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
const makeProjBodyRe = ({ anchorVec, entityVar, screenVar, nearVar, farVar }) => new RegExp(String.raw`${escRe(entityVar)}\[[^\]]+\]\[[^\]]+\]=(?<sizeExpr>(?<zoomExpr>(?:[A-Za-z_$][\w$]*)\[[^\]]+\])\/0xa\*\(0x1-\(${escRe(anchorVec)}\['z'\]-${escRe(nearVar)}\)\/\(${escRe(farVar)}-${escRe(nearVar)}\)\)),${escRe(screenVar)}\['x'\]=${escRe(anchorVec)}\['x'\]\*[A-Za-z_$][\w$]*,${escRe(screenVar)}\['y'\]=${escRe(anchorVec)}\['y'\]\*[A-Za-z_$][\w$]*,${escRe(entityVar)}\[[^\]]+\]\[[^\]]+\]\(${escRe(screenVar)}\['x'\],${escRe(screenVar)}\['y'\],${escRe(entityVar)}\[[^\]]+\]\['size'\]\),${escRe(entityVar)}\[[^\]]+\]\[[^\]]+\]\((?<hpExpr>.+?),(?<maxHpExpr>.+?)\),`);
const makeProjMetaRe = ({ entityVar, visibleVar }) => new RegExp(String.raw`\(${escRe(entityVar)}\[[^\]]+\]\[[^\]]+\]\|\|(?<previousDeadExpr>${escRe(entityVar)}\[[^\]]+\]\[[^\]]+\])\)&&[\s\S]{0,900}?if\(${escRe(visibleVar)}&&!(?<currentDeadExpr>${escRe(entityVar)}\[[^\]]+\]\[[^\]]+\])&&![A-Za-z_$][\w$]*\[[^\]]+\]&&\((?<teamExpr>${escRe(entityVar)}\[[^\]]+\])==(?:0x0|0)\|\|${escRe(entityVar)}\[[^\]]+\]!=(?<localTeamVar>[A-Za-z_$][\w$]*)\)\)\{`);
const idPatch = { arrays: null };
const normYaw = (value) => {
if (!Number.isFinite(value)) return null;
const fullTurn = Math.PI * 2;
let next = value % fullTurn;
if (next < 0) next += fullTurn;
return next;
};
const aimAngles = ({ origin, point }) => {
if (!origin || !point || ![origin.x, origin.y, origin.z, point.x, point.y, point.z].every(Number.isFinite)) return null;
const x = point.x - origin.x;
const y = point.y - origin.y;
const z = point.z - origin.z;
const horizontalDistance = Math.hypot(x, z);
if (!Number.isFinite(horizontalDistance) || horizontalDistance <= 1e-5) return null;
const yaw = normYaw(Math.atan2(-x, -z));
const pitch = Math.max(-Math.PI / 2 + 0.001, Math.min(Math.PI / 2 - 0.001, Math.atan2(y, horizontalDistance)));
return [yaw, pitch].every(Number.isFinite)
? {
yaw,
pitch,
horizontalDistance
}
: null;
};
const inAimWindow = ({ point, width, height, marginRatio = 0.2 }) => {
if (!point || !Number.isFinite(point.x) || !Number.isFinite(point.y)) return null;
const marginX = width * marginRatio;
const marginY = height * marginRatio;
return point.x >= -marginX && point.x <= width + marginX && point.y >= -marginY && point.y <= height + marginY;
};
const setupFlags = () => {
if (globalThis.ichhabgarnixgemacht_features) return globalThis.ichhabgarnixgemacht_features;
const state = {
esp: true,
espBoxes: true,
espSkeleton: true,
espHealth: true,
espNames: true,
espTracers: true,
aimTarget: 'head',
aimTargetOpen: false,
aimbot: false,
aimFov: 150,
aimSmooth: 10,
magicBullet: false,
noRecoil: true,
noSpread: true
};
const items = [
{ key: 'esp', label: 'Master ESP' },
{ key: 'espBoxes', label: 'Player Boxes' },
{ key: 'espSkeleton', label: 'Skeletons' },
{ key: 'espHealth', label: 'Health Bars' },
{ key: 'espNames', label: 'Player Names' },
{ key: 'espTracers', label: 'Tracer Lines' },
{ key: 'aimbot', label: 'Aimbot' },
{ key: 'aimFov', label: 'Aim FOV', type: 'slider', min: 10, max: 800 },
{ key: 'aimSmooth', label: 'Aim Smoothing', type: 'slider', min: 0, max: 50 },
{ key: 'magicBullet', label: 'Magic Bullet' },
{ key: 'noRecoil', label: 'No Recoil' },
{ key: 'noSpread', label: 'No Spread' },
{ key: 'aimTarget', label: 'Aim Target', type: 'target' }
];
const syncFeature = ({ key }) => {
if (key === 'aimbot' && globalThis.ichhabgarnixgemacht_aimbot?.state) globalThis.ichhabgarnixgemacht_aimbot.state.enabled = state.aimbot;
};
const isEnabled = (key) => state[key] !== false;
const setFeature = ({ key, enabled }) => {
if (!Object.hasOwn(state, key) || key === 'espMode' || key === 'espModeOpen' || key === 'aimTarget' || key === 'aimTargetOpen') return false;
state[key] = Boolean(enabled);
syncFeature({ key });
return true;
};
const toggleFeature = (key) =>
setFeature({
key,
enabled: !isEnabled(key)
});
const setAimTarget = (target) => {
if (!['head', 'body'].includes(target)) return state.aimTarget;
state.aimTarget = target;
state.aimTargetOpen = false;
return state.aimTarget;
};
const toggleAimTargetOpen = () => {
state.aimTargetOpen = !state.aimTargetOpen;
return state.aimTargetOpen;
};
const setSlider = (key, value) => {
if (!Object.hasOwn(state, key)) return;
state[key] = value;
return state[key];
};
const api = {
state,
items,
isEnabled,
setFeature,
toggleFeature,
setAimTarget,
toggleAimTargetOpen,
setSlider
};
globalThis.ichhabgarnixgemacht_features = api;
return api;
};
const setupEsp = () => {
if (globalThis.ichhabgarnixgemacht_esp) return globalThis.ichhabgarnixgemacht_esp;
const features = setupFlags();
const state = {
canvas: null,
menuInput: null,
menuIcon: null,
ctx: null,
host: null,
dpr: 1,
menuCollapsed: false,
menuPosition: {
x: 18,
y: 80
},
menuDrag: {
active: false,
pointerId: null,
startX: 0,
startY: 0,
originX: 0,
originY: 0,
moved: false,
hit: null
},
menuBounds: null,
menuRects: [],
pointer: {
x: 0,
y: 0,
inside: false
},
ids: new WeakMap(),
models: new WeakMap(),
boneMaps: new WeakMap(),
identityByServerId: new Map(),
entries: new Map(),
nextId: 1,
rafId: 0,
hidden: document.hidden === true,
camera: {
worldToCamera: null,
projection: null,
zoom: 1,
updatedAt: 0,
inverse: null,
inverseUpdatedAt: 0
},
trace: {
world: null,
ray: null,
raySnapshot: null,
losRay: null,
shotOrigin: null,
shotOriginSnapshot: null,
losFn: null,
losDistanceFn: null,
updatedAt: 0
},
localTeam: null,
localTeamUpdatedAt: 0,
entityServerIdKey: null
};
const losCacheMs = 50;
const traceMs = 8;
const clamp = ({ value, min, max }) => Math.min(max, Math.max(min, value));
const normId = (value) => {
if (value === null) return null;
if (Number.isFinite(value)) return value;
if (typeof value === 'string') return value.trim() || null;
return null;
};
const normText = (value) => {
const normalized = normId(value);
return typeof normalized === 'string' ? normalized : normalized === null ? null : `${normalized}`;
};
const view = () => ({
width: window.innerWidth || document.documentElement?.clientWidth || 1,
height: window.innerHeight || document.documentElement?.clientHeight || 1
});
const canvasHost = () => domHost();
const canvasScale = () => {
const { height } = view();
return (height + 1) / 1080;
};
const canvasPt = ({ x, y, size }) => {
const { width, height } = view();
const scale = canvasScale();
return {
x: x * scale + (width + 1) / 2,
y: (height + 1) / 2 - y * scale,
size: size * scale
};
};
const matrixElementCache = new WeakMap();
const matEls = (matrix) => {
const { elements } = matrix || {};
if (!elements || typeof elements.length !== 'number' || elements.length < 16) return null;
if (elements instanceof Float32Array) return elements;
let typed = matrixElementCache.get(matrix);
if (!typed) {
typed = new Float32Array(16);
matrixElementCache.set(matrix, typed);
}
for (let index = 0; index < 16; index += 1) typed[index] = elements[index];
return typed;
};
const worldPt = (matrix) => {
const elements = matEls(matrix);
if (!elements) return null;
const point = {
x: elements[12],
y: elements[13],
z: elements[14]
};
if (![point.x, point.y, point.z].every(Number.isFinite)) return null;
return point;
};
const xformPoint = ({ elements, x, y, z, w = 1 }) => ({
x: elements[0] * x + elements[4] * y + elements[8] * z + elements[12] * w,
y: elements[1] * x + elements[5] * y + elements[9] * z + elements[13] * w,
z: elements[2] * x + elements[6] * y + elements[10] * z + elements[14] * w,
w: elements[3] * x + elements[7] * y + elements[11] * z + elements[15] * w
});
const invMat4 = (elements) => {
if (!Array.isArray(elements) && !(elements instanceof Float32Array) && !(elements instanceof Float64Array)) return null;
if (elements.length < 16) return null;
const te = elements;
const inv = new Array(16);
inv[0] = te[5] * te[10] * te[15] - te[5] * te[11] * te[14] - te[9] * te[6] * te[15] + te[9] * te[7] * te[14] + te[13] * te[6] * te[11] - te[13] * te[7] * te[10];
inv[4] = -te[4] * te[10] * te[15] + te[4] * te[11] * te[14] + te[8] * te[6] * te[15] - te[8] * te[7] * te[14] - te[12] * te[6] * te[11] + te[12] * te[7] * te[10];
inv[8] = te[4] * te[9] * te[15] - te[4] * te[11] * te[13] - te[8] * te[5] * te[15] + te[8] * te[7] * te[13] + te[12] * te[5] * te[11] - te[12] * te[7] * te[9];
inv[12] = -te[4] * te[9] * te[14] + te[4] * te[10] * te[13] + te[8] * te[5] * te[14] - te[8] * te[6] * te[13] - te[12] * te[5] * te[10] + te[12] * te[6] * te[9];
inv[1] = -te[1] * te[10] * te[15] + te[1] * te[11] * te[14] + te[9] * te[2] * te[15] - te[9] * te[3] * te[14] - te[13] * te[2] * te[11] + te[13] * te[3] * te[10];
inv[5] = te[0] * te[10] * te[15] - te[0] * te[11] * te[14] - te[8] * te[2] * te[15] + te[8] * te[3] * te[14] + te[12] * te[2] * te[11] - te[12] * te[3] * te[10];
inv[9] = -te[0] * te[9] * te[15] + te[0] * te[11] * te[13] + te[8] * te[1] * te[15] - te[8] * te[3] * te[13] - te[12] * te[1] * te[11] + te[12] * te[3] * te[9];
inv[13] = te[0] * te[9] * te[14] - te[0] * te[10] * te[13] - te[8] * te[1] * te[14] + te[8] * te[2] * te[13] + te[12] * te[1] * te[10] - te[12] * te[2] * te[9];
inv[2] = te[1] * te[6] * te[15] - te[1] * te[7] * te[14] - te[5] * te[2] * te[15] + te[5] * te[3] * te[14] + te[13] * te[2] * te[7] - te[13] * te[3] * te[6];
inv[6] = -te[0] * te[6] * te[15] + te[0] * te[7] * te[14] + te[4] * te[2] * te[15] - te[4] * te[3] * te[14] - te[12] * te[2] * te[7] + te[12] * te[3] * te[6];
inv[10] = te[0] * te[5] * te[15] - te[0] * te[7] * te[13] - te[4] * te[1] * te[15] + te[4] * te[3] * te[13] + te[12] * te[1] * te[7] - te[12] * te[3] * te[5];
inv[14] = -te[0] * te[5] * te[14] + te[0] * te[6] * te[13] + te[4] * te[1] * te[14] - te[4] * te[2] * te[13] - te[12] * te[1] * te[6] + te[12] * te[2] * te[5];
inv[3] = -te[1] * te[6] * te[11] + te[1] * te[7] * te[10] + te[5] * te[2] * te[11] - te[5] * te[3] * te[10] - te[9] * te[2] * te[7] + te[9] * te[3] * te[6];
inv[7] = te[0] * te[6] * te[11] - te[0] * te[7] * te[10] - te[4] * te[2] * te[11] + te[4] * te[3] * te[10] + te[8] * te[2] * te[7] - te[8] * te[3] * te[6];
inv[11] = -te[0] * te[5] * te[11] + te[0] * te[7] * te[9] + te[4] * te[1] * te[11] - te[4] * te[3] * te[9] - te[8] * te[1] * te[7] + te[8] * te[3] * te[5];
inv[15] = te[0] * te[5] * te[10] - te[0] * te[6] * te[9] - te[4] * te[1] * te[10] + te[4] * te[2] * te[9] + te[8] * te[1] * te[6] - te[8] * te[2] * te[5];
const det = te[0] * inv[0] + te[1] * inv[4] + te[2] * inv[8] + te[3] * inv[12];
if (!Number.isFinite(det) || Math.abs(det) < 1e-8) return null;
const detInv = 1 / det;
for (let index = 0; index < 16; index += 1) inv[index] *= detInv;
return inv;
};
const project = ({ x, y, z }) => {
const worldToCamera = matEls(state.camera.worldToCamera);
const projection = matEls(state.camera.projection);
if (!worldToCamera || !projection) return null;
if (![x, y, z].every(Number.isFinite)) return null;
const cameraPt = xformPoint({
elements: worldToCamera,
x,
y,
z
});
const clip = xformPoint({
elements: projection,
x: cameraPt.x,
y: cameraPt.y,
z: cameraPt.z,
w: cameraPt.w
});
if (!Number.isFinite(clip.w) || Math.abs(clip.w) < 1e-6) return null;
const depth = clip.z / clip.w;
const ndcX = clip.x / clip.w;
const ndcY = clip.y / clip.w;
if (![ndcX, ndcY, depth].every(Number.isFinite) || depth >= 1) return null;
const { width, height } = view();
return {
x: ((ndcX + 1) * (width + 1)) / 2,
y: ((1 - ndcY) * (height + 1)) / 2,
depth
};
};
const hasNativeScreen = ({ entry }) => [entry.x, entry.y, entry.size].every(Number.isFinite) && Number.isFinite(entry.screenUpdatedAt) && (!Number.isFinite(entry.worldUpdatedAt) || entry.screenUpdatedAt >= entry.worldUpdatedAt);
const nativeScreen = ({ entry }) => {
if (!hasNativeScreen({ entry })) return null;
return {
...canvasPt({
x: entry.x,
y: entry.y,
size: entry.size
}),
depth: entry.depth
};
};
const worldScreen = ({ entry }) => {
const projected = project({
x: entry.worldX,
y: entry.worldY,
z: entry.worldZ
});
if (!projected) return null;
const zoom = Number.isFinite(state.camera.zoom) ? state.camera.zoom : 1;
const virtualSize =
nativeScreen({ entry })?.size ||
clamp({
value: zoom * 100 * (1 - projected.depth),
min: 0.4,
max: 4
}) * canvasScale();
return {
...projected,
size: virtualSize
};
};
const entryScreen = ({ entry }) => {
const native = nativeScreen({ entry });
if (native) return native;
return worldScreen({ entry });
};
const num = (...values) => {
for (const value of values) if (Number.isFinite(value)) return value;
return null;
};
const entryLabel = ({ entry }) => {
const identity = entryId({ entry });
const displayName = identity.displayName;
const serverId = identity.serverId;
if (displayName) return displayName;
if (serverId !== null) return `@${serverId}`;
return `#${entry?.id ?? '?'}`;
};
const learnSidKey = () => {
const keyMatches = new Map();
let knownEntryCount = 0;
for (const entry of state.entries.values()) {
const explicitServerId = normId(entry?.serverId);
const { entity } = entry || {};
if (!Number.isFinite(explicitServerId) || !entity || (typeof entity !== 'object' && typeof entity !== 'function')) continue;
knownEntryCount += 1;
for (const [key, value] of Object.entries(entity)) {
if (normId(value) !== explicitServerId) continue;
keyMatches.set(key, (keyMatches.get(key) || 0) + 1);
}
}
let bestKey = state.entityServerIdKey;
let bestCount = 0;
for (const [key, count] of keyMatches.entries())
if (count > bestCount) {
bestCount = count;
bestKey = key;
}
if (bestKey && bestCount >= Math.min(knownEntryCount, 2)) state.entityServerIdKey = bestKey;
};
const entitySid = ({ entity }) => {
if (!state.entityServerIdKey || !entity || (typeof entity !== 'object' && typeof entity !== 'function')) return null;
return normId(entity[state.entityServerIdKey]);
};
const entryId = ({ entry }) => {
const inferredServerId = normId(entry?.serverId) ?? entitySid({ entity: entry?.entity });
const storedIdentity = inferredServerId === null ? null : state.identityByServerId.get(`${inferredServerId}`);
return {
serverId: inferredServerId,
displayName: normText(entry?.displayName) ?? normText(storedIdentity?.displayName),
clan: normText(entry?.clan) ?? normText(storedIdentity?.clan)
};
};
const deadFlag = (flagLike) => flagLike === true;
const teamOf = ({ entry }) => num(entry?.team);
const curDead = ({ entry }) => entry?.currentDead;
const prevDead = ({ entry }) => entry?.previousDead;
const isDead = ({ entry }) => {
const currentAnimState = curDead({ entry });
const previousAnimState = prevDead({ entry });
const hp = num(entry?.hp);
if (deadFlag(currentAnimState)) return true;
if (!currentAnimState && deadFlag(previousAnimState)) return true;
return Number.isFinite(hp) ? hp <= 0 : false;
};
const isEnemy = ({ entry }) => {
const team = teamOf({ entry });
if (!Number.isFinite(team) || !Number.isFinite(state.localTeam)) return false;
return team === 0 || team !== state.localTeam;
};
const shouldDraw = ({ entry }) => features.isEnabled('esp') && (entry.team === 0 || entry.team !== state.localTeam);
const drawFov = ({ ctx }) => {
if (!features.isEnabled('aimbot')) return;
const fov = features.state.aimFov;
if (fov <= 0) return;
ctx.save();
ctx.beginPath();
ctx.arc(window.innerWidth / 2, window.innerHeight / 2, fov, 0, Math.PI * 2);
ctx.strokeStyle = 'rgba(0, 210, 255, 0.3)';
ctx.lineWidth = 1.5;
ctx.setLineDash([5, 5]);
ctx.stroke();
ctx.restore();
};
const isVec3 = (value) => Boolean(value && typeof value === 'object' && typeof value.x === 'number' && typeof value.y === 'number' && typeof value.z === 'number');
const cloneVec = (value) => {
if (!isVec3(value)) return null;
if (typeof value.clone === 'function')
try {
const cloned = value.clone();
if (isVec3(cloned)) return cloned;
} catch { }
return {
x: value.x,
y: value.y,
z: value.z
};
};
const cloneRay = (ray) => {
if (!ray || typeof ray !== 'object') return null;
const cloneValue = (value) => {
if (value && typeof value.clone === 'function')
try {
return value.clone();
} catch { }
if (Array.isArray(value)) return value.slice();
return value;
};
const next = {};
for (const key of Reflect.ownKeys(ray))
try {
next[key] = cloneValue(ray[key]);
} catch { }
if (!isVec3(next.origin) || !isVec3(next.lC6FfRUZOep61) || typeof next.avKYldbMbArS !== 'function') return null;
return next;
};
const cloneVal = (value) => {
if (value && typeof value.clone === 'function')
try {
return value.clone();
} catch { }
if (Array.isArray(value)) return value.slice();
if (isVec3(value))
return {
x: value.x,
y: value.y,
z: value.z
};
return value;
};
const snapObj = (value) => {
if (!value || typeof value !== 'object') return null;
const snapshot = new Map();
for (const key of Reflect.ownKeys(value))
try {
snapshot.set(key, cloneVal(value[key]));
} catch { }
return snapshot;
};
const restoreObj = ({ target, snapshot }) => {
if (!target || typeof target !== 'object' || !(snapshot instanceof Map)) return;
for (const [key, savedValue] of snapshot.entries())
try {
const currentValue = target[key];
if (currentValue && savedValue && typeof currentValue.copy === 'function' && typeof savedValue === 'object') {
currentValue.copy(savedValue);
continue;
}
if (Array.isArray(currentValue) && Array.isArray(savedValue)) {
currentValue.length = 0;
currentValue.splice(0, 0, ...savedValue);
continue;
}
target[key] = savedValue;
} catch { }
};
const keepObj = ({ target, work }) => {
const snapshot = snapObj(target);
try {
return work();
} finally {
restoreObj({
target,
snapshot
});
}
};
const dist3 = (left, right) => {
if (!isVec3(left) || !isVec3(right)) return null;
return Math.hypot(left.x - right.x, left.y - right.y, left.z - right.z);
};
const maxTraceDrift = 3;
const isNode = (value) => Boolean(value && typeof value === 'object' && Array.isArray(value.children) && isVec3(value.position) && matEls(value.matrixWorld));
const walk = ({ root, visit }) => {
if (!isNode(root)) return;
const stack = [root];
while (stack.length > 0) {
const node = stack.pop();
visit(node);
if (!Array.isArray(node.children) || node.children.length === 0) continue;
for (let index = node.children.length - 1; index >= 0; index -= 1) {
const child = node.children[index];
if (child && typeof child === 'object') stack[stack.length] = child;
}
}
};
const isBone = (value) => Boolean(isNode(value) && (value.type === 'Bone' || value.isBone === true));
const boneSlot = ({ node }) => {
const name = (typeof node?.name === 'string' ? node.name : '').toLowerCase();
const compactName = name.replaceAll(/[^a-z0-9]/g, '');
if (!name) return null;
if (compactName.includes('bottomshoel')) return 'leftFootBottom';
if (compactName.includes('bottomshoer')) return 'rightFootBottom';
if (compactName.includes('shoel') && !compactName.includes('shoulder')) return 'leftFoot';
if (compactName.includes('shoer') && !compactName.includes('shoulder')) return 'rightFoot';
if (compactName.includes('calfl')) return 'leftCalf';
if (compactName.includes('calfr')) return 'rightCalf';
if (compactName.includes('thighl')) return 'leftThigh';
if (compactName.includes('thighr')) return 'rightThigh';
if (compactName.includes('handl')) return 'leftHand';
if (compactName.includes('handr')) return 'rightHand';
if (compactName.includes('arml') || compactName.includes('bicepl')) return 'leftArm';
if (compactName.includes('armr') || compactName.includes('bicepr')) return 'rightArm';
if (compactName.includes('shoulderl')) return 'leftShoulder';
if (compactName.includes('shoulderr')) return 'rightShoulder';
if (compactName.includes('topchest')) return 'topChest';
if (compactName.includes('chest')) return 'chest';
if (compactName.includes('stomach')) return 'stomach';
if (compactName.includes('hip')) return 'hip';
if (compactName.includes('neck')) return 'neck';
if (compactName.includes('head')) return 'head';
if (compactName.includes('gun')) return 'gun';
return null;
};
const pushNode = ({ list, node }) => {
if (!isBone(node) || list.includes(node)) return;
list[list.length] = node;
};
const skeletonBones = ({ model }) => {
const bones = [];
walk({
root: model,
visit: (node) => {
const skeletonBones = Array.isArray(node?.skeleton?.bones) ? node.skeleton.bones : null;
if (!skeletonBones) return;
for (const bone of skeletonBones)
pushNode({
list: bones,
node: bone
});
}
});
return bones;
};
const mapBone = ({ map, node }) => {
if (!isBone(node)) return;
map.all ||= [];
if (!map.all.includes(node)) map.all[map.all.length] = node;
const slot = boneSlot({ node });
if (slot && !map[slot]) map[slot] = node;
};
const boneMap = ({ model }) => {
if (!isNode(model)) return null;
const cached = state.boneMaps.get(model);
if (cached) return cached;
const next = {};
for (const bone of skeletonBones({ model }))
mapBone({
map: next,
node: bone
});
for (const value of Object.values(model))
mapBone({
map: next,
node: value
});
walk({
root: model,
visit: (node) => {
if (isBone(node))
mapBone({
map: next,
node
});
}
});
state.boneMaps.set(model, next);
return next;
};
const modelScore = ({ model }) => {
if (!isNode(model)) return 0;
const bones = boneMap({ model });
const skelBones = skeletonBones({ model });
return [bones?.head, bones?.stomach, bones?.leftShoulder, bones?.rightShoulder, bones?.leftFootBottom, bones?.rightFootBottom, bones?.leftFoot, bones?.rightFoot, bones?.leftCalf, bones?.rightCalf].filter(Boolean).length * 10 + skelBones.length;
};
const maxAnchorDist = 6;
const anchorDist = ({ model, entry }) => {
if (!isNode(model)) return Number.POSITIVE_INFINITY;
try {
if (typeof model.updateWorldMatrix === 'function') model.updateWorldMatrix(true, true);
} catch { }
try {
if (typeof model.updateMatrixWorld === 'function') model.updateMatrixWorld(true);
} catch { }
const modelWorld = worldPt(model.matrixWorld);
const entryX = num(entry?.worldX);
const entryZ = num(entry?.worldZ);
if (!modelWorld || !Number.isFinite(entryX) || !Number.isFinite(entryZ)) return Number.POSITIVE_INFINITY;
return Math.hypot(modelWorld.x - entryX, modelWorld.z - entryZ);
};
const scoreModel = ({ candidate, entry }) => {
const baseScore = modelScore({ model: candidate });
if (baseScore <= 0) return null;
return {
candidate,
baseScore,
anchorDistance: anchorDist({
model: candidate,
entry
})
};
};
const rankModels = ({ candidates, entry, alignedOnly = true }) => {
const scored = [];
for (const candidate of candidates) {
const evaluated = scoreModel({
candidate,
entry
});
if (!evaluated) continue;
scored[scored.length] = evaluated;
}
const ranked = alignedOnly ? scored.filter(({ anchorDistance }) => Number.isFinite(anchorDistance) && anchorDistance <= maxAnchorDist) : scored;
ranked.sort((left, right) => right.baseScore - left.baseScore || left.anchorDistance - right.anchorDistance);
return ranked;
};
const objVals = (value) => {
if (!value || (typeof value !== 'object' && typeof value !== 'function')) return [];
const values = [];
for (const key of Reflect.ownKeys(value))
try {
values[values.length] = value[key];
} catch { }
return values;
};
const canReachModel = ({ entity, model }) => {
if (!entity || (typeof entity !== 'object' && typeof entity !== 'function') || !isNode(model)) return false;
const seen = new WeakSet();
const stack = [
{
value: entity,
depth: 0
}
];
const maxDepth = 6;
const maxVisited = 1600;
let visited = 0;
while (stack.length > 0 && visited < maxVisited) {
const current = stack.pop();
const value = current?.value;
const depth = current?.depth || 0;
if (!value || (typeof value !== 'object' && typeof value !== 'function')) continue;
if (value === model) return true;
if (seen.has(value)) continue;
seen.add(value);
visited += 1;
if (depth >= maxDepth) continue;
for (const child of objVals(value)) {
if (!child || (typeof child !== 'object' && typeof child !== 'function')) continue;
stack[stack.length] = {
value: child,
depth: depth + 1
};
}
}
return false;
};
const directModels = ({ entity }) => {
if (!entity || (typeof entity !== 'object' && typeof entity !== 'function')) return [];
const candidates = [];
for (const key of Reflect.ownKeys(entity)) {
let value;
try {
value = entity[key];
} catch {
continue;
}
if (!isNode(value) || candidates.includes(value)) continue;
candidates[candidates.length] = value;
}
return candidates;
};
const allModels = ({ entity }) => {
if (!entity || (typeof entity !== 'object' && typeof entity !== 'function')) return [];
const candidates = [];
const seen = new WeakSet();
const stack = [
{
value: entity,
depth: 0
}
];
const maxDepth = 6;
const maxVisited = 1600;
const maxCandidates = 96;
let visited = 0;
while (stack.length > 0 && visited < maxVisited && candidates.length < maxCandidates) {
const current = stack.pop();
const value = current?.value;
const depth = current?.depth || 0;
if (!value || (typeof value !== 'object' && typeof value !== 'function')) continue;
if (seen.has(value)) continue;
seen.add(value);
visited += 1;
if (isNode(value) && !candidates.includes(value)) candidates[candidates.length] = value;
if (depth >= maxDepth) continue;
for (const child of objVals(value)) {
if (!child || (typeof child !== 'object' && typeof child !== 'function')) continue;
stack[stack.length] = {
value: child,
depth: depth + 1
};
}
}
return candidates;
};
const validModel = ({ entity, entry, model }) => {
if (!isNode(model)) return false;
if (modelScore({ model }) <= 0) return false;
const anchorDistance = anchorDist({
model,
entry
});
if (!Number.isFinite(anchorDistance) || anchorDistance > maxAnchorDist) return false;
return canReachModel({
entity,
model
});
};
const entityModel = ({ entry }) => {
const { entity } = entry;
if (!entity || (typeof entity !== 'object' && typeof entity !== 'function')) return null;
const directCandidates = directModels({ entity });
const bestDirectModel =
rankModels({
candidates: directCandidates,
entry
})[0]?.candidate || null;
const hasDirect = directCandidates.some((candidate) => modelScore({ model: candidate }) > 0);
if (bestDirectModel) {
state.models.set(entity, bestDirectModel);
return bestDirectModel;
}
const cached = state.models.get(entity);
if (
!hasDirect &&
validModel({
entity,
entry,
model: cached
})
)
return cached;
state.models.delete(entity);
if (hasDirect) return null;
const bestModel = rankModels({
candidates: allModels({ entity }),
entry
})[0]?.candidate;
if (!bestModel) return null;
state.models.set(entity, bestModel);
return bestModel;
};
const syncNode = ({ node }) => {
if (!isNode(node)) return;
try {
if (typeof node.updateWorldMatrix === 'function') node.updateWorldMatrix(true, true);
} catch { }
try {
if (typeof node.updateMatrixWorld === 'function') node.updateMatrixWorld(true);
} catch { }
};
const camInv = () => {
const worldToCamera = matEls(state.camera.worldToCamera);
if (!worldToCamera) return null;
if (state.camera.inverse && state.camera.inverseUpdatedAt === state.camera.updatedAt) return state.camera.inverse;
state.camera.inverse = invMat4(worldToCamera);
state.camera.inverseUpdatedAt = state.camera.updatedAt;
return state.camera.inverse;
};
const camPos = () => {
const inverse = camInv();
if (!inverse) return null;
return worldPt({ elements: inverse });
};
const camDir = () => {
const inverse = camInv();
if (!inverse) return null;
const x = -inverse[8];
const y = -inverse[9];
const z = -inverse[10];
const length = Math.hypot(x, y, z);
if (!Number.isFinite(length) || length <= 1e-6) return null;
return {
x: x / length,
y: y / length,
z: z / length
};
};
const modelBones = ({ entry }) => {
if (!entry?.entity) return null;
const model = entityModel({ entry });
if (!model) return null;
const modelDist = anchorDist({
model,
entry
});
if (!Number.isFinite(modelDist) || modelDist > maxAnchorDist) return null;
syncNode({ node: model });
return {
model,
bones: boneMap({ model })
};
};
const footPoint = ({ bones }) =>
[bones?.leftFootBottom, bones?.rightFootBottom, bones?.leftFoot, bones?.rightFoot]
.map((node) => worldPt(node?.matrixWorld))
.filter((point) => point && Number.isFinite(point.y))
.reduce((lowest, point) => (!lowest || point.y < lowest.y ? point : lowest), null);
const head = ({ entry }) => {
return worldPt(modelBones({ entry })?.bones?.head?.matrixWorld);
};
const aimWorld = ({ entry }) => {
const bones = modelBones({ entry })?.bones;
const head = worldPt(bones?.head?.matrixWorld);
if (!head) return null;
if (features.state.aimTarget === 'body') {
const stomach = worldPt(bones?.stomach?.matrixWorld);
const chest = worldPt(bones?.chest?.matrixWorld);
const neck = worldPt(bones?.neck?.matrixWorld);
return (
stomach ||
(chest && neck
? {
x: (chest.x + neck.x) / 2,
y: (chest.y + neck.y) / 2,
z: (chest.z + neck.z) / 2
}
: chest || neck) ||
head
);
}
const foot = footPoint({ bones });
const bodyHeight = Number.isFinite(foot?.y) ? head.y - foot.y : null;
const headOffset = Number.isFinite(bodyHeight)
? clamp({
value: bodyHeight * 0.075,
min: 0.12,
max: 0.18
})
: 0.16;
return {
x: head.x,
y: head.y + headOffset,
z: head.z
};
};
const screenBox = ({ entry, fallbackScreen }) => {
const bones = modelBones({ entry })?.bones;
const head = worldPt(bones?.head?.matrixWorld);
if (!head) return null;
const foot =
[bones?.leftFootBottom, bones?.rightFootBottom, bones?.leftFoot, bones?.rightFoot, bones?.leftCalf, bones?.rightCalf]
.map((node) => worldPt(node?.matrixWorld))
.filter((point) => point && Number.isFinite(point.y))
.reduce((lowest, point) => (!lowest || point.y < lowest.y ? point : lowest), null) || footPoint({ bones });
if (!foot) return null;
const worldHeight = head.y - foot.y;
if (!Number.isFinite(worldHeight) || worldHeight <= 0.25) return null;
const topScreen = project({
x: head.x,
y:
head.y +
clamp({
value: worldHeight * 0.12,
min: 0.12,
max: 0.22
}),
z: head.z
});
const bottomScreen = project(foot);
if (!topScreen || !bottomScreen || ![topScreen.x, topScreen.y, bottomScreen.x, bottomScreen.y].every(Number.isFinite)) return null;
const rawHeight = bottomScreen.y - topScreen.y;
if (!Number.isFinite(rawHeight) || rawHeight <= 16) return null;
const boxPoints = [
topScreen,
bottomScreen,
...[bones?.head, bones?.neck, bones?.stomach, bones?.leftShoulder, bones?.rightShoulder, bones?.leftHand, bones?.rightHand, bones?.leftFootBottom, bones?.rightFootBottom]
.map((node) => worldPt(node?.matrixWorld))
.map((point) => (point ? project(point) : null))
.filter((point) => point && [point.x, point.y].every(Number.isFinite))
];
const minX = Math.min(...boxPoints.map((point) => point.x));
const maxX = Math.max(...boxPoints.map((point) => point.x));
const { height: viewportHeight } = view();
const boxHeight = clamp({
value: rawHeight,
min: 28,
max: clamp({
value: viewportHeight * 0.82,
min: 260,
max: 720
})
});
const boxWidth = clamp({
value: Math.max(maxX - minX, boxHeight * 0.36),
min: 18,
max: 110
});
const centerX = Number.isFinite(minX) && Number.isFinite(maxX) ? (minX + maxX) / 2 : fallbackScreen?.x;
const top = topScreen.y;
if (![centerX, top, boxWidth, boxHeight].every(Number.isFinite)) return null;
return {
left: centerX - boxWidth / 2,
top,
width: boxWidth,
height: boxHeight
};
};
const skeletonOverlay = ({ entry }) => {
const bones = modelBones({ entry })?.bones;
if (!bones?.head || !bones?.neck) return null;
const points = {};
for (const slot of ['head', 'neck', 'topChest', 'chest', 'stomach', 'hip', 'leftShoulder', 'leftArm', 'leftHand', 'rightShoulder', 'rightArm', 'rightHand', 'leftThigh', 'leftCalf', 'leftFoot', 'leftFootBottom', 'rightThigh', 'rightCalf', 'rightFoot', 'rightFootBottom', 'gun']) {
const world = worldPt(bones?.[slot]?.matrixWorld);
const projected = world ? project(world) : null;
if (projected && [projected.x, projected.y].every(Number.isFinite)) points[slot] = projected;
}
const lines = [
['head', 'neck'],
['neck', 'topChest'],
['topChest', 'chest'],
['chest', 'stomach'],
['stomach', 'hip'],
['neck', 'leftShoulder'],
['leftShoulder', 'leftArm'],
['leftArm', 'leftHand'],
['neck', 'rightShoulder'],
['rightShoulder', 'rightArm'],
['rightArm', 'rightHand'],
['hip', 'leftThigh'],
['leftThigh', 'leftCalf'],
['leftCalf', 'leftFoot'],
['leftFoot', 'leftFootBottom'],
['hip', 'rightThigh'],
['rightThigh', 'rightCalf'],
['rightCalf', 'rightFoot'],
['rightFoot', 'rightFootBottom'],
['rightHand', 'gun']
].filter(([from, to]) => points[from] && points[to]);
if (lines.length < 4) return null;
const values = Object.values(points);
const minX = Math.min(...values.map((point) => point.x));
const maxX = Math.max(...values.map((point) => point.x));
const minY = Math.min(...values.map((point) => point.y));
const maxY = Math.max(...values.map((point) => point.y));
if (![minX, maxX, minY, maxY].every(Number.isFinite)) return null;
return {
points,
lines,
bounds: {
left: minX,
top: minY,
width: maxX - minX,
height: maxY - minY
}
};
};
const resize = () => {
if (!state.canvas || !state.ctx) return;
const { width, height } = view();
state.dpr = Math.max(1, window.devicePixelRatio || 1);
state.canvas.width = Math.floor(width * state.dpr);
state.canvas.height = Math.floor(height * state.dpr);
state.ctx.setTransform(state.dpr, 0, 0, state.dpr, 0, 0);
state.ctx.imageSmoothingEnabled = true;
};
const syncPointer = () => {
if (!state.canvas) return;
state.canvas.style.pointerEvents = 'none';
if (!state.menuInput) return;
const bounds = state.menuBounds;
if (!bounds) {
state.menuInput.style.display = 'none';
state.menuInput.style.pointerEvents = 'none';
return;
}
state.menuInput.style.display = 'block';
state.menuInput.style.left = `${state.menuPosition.x}px`;
state.menuInput.style.top = `${state.menuPosition.y}px`;
state.menuInput.style.width = `${bounds.width}px`;
state.menuInput.style.height = `${bounds.height}px`;
state.menuInput.style.pointerEvents = 'auto';
};
const setMenuPosition = ({ x: nx, y: ny, width: nw, height: nh }) => {
const { width, height } = view();
state.menuPosition.x = clamp({ value: nx, min: 0, max: width - nw });
state.menuPosition.y = clamp({ value: ny, min: 0, max: height - nh });
};
const applyMenuHit = (hit, pos) => {
if (!hit) return;
if (hit.type === 'collapse') return toggleMenuCollapsed();
if (hit.type === 'telegram') return window.open(hit.value, '_blank', 'noopener,noreferrer');
if (hit.type === 'header') return;
if (hit.type === 'target') return features.toggleAimTargetOpen();
if (hit.type === 'targetOption') return features.setAimTarget(hit.value);
if (hit.type === 'slider' && pos) {
const slider = hit.slider;
const pct = Math.max(0, Math.min(1, (pos.x - slider.x) / slider.width));
const val = slider.min + pct * (slider.max - slider.min);
return features.setSlider(hit.key, val);
}
features.state.aimTargetOpen = false;
features.toggleFeature(hit.key);
};
const menuHit = ({ x, y }) => {
const rect = state.menuRects.find((r) => x >= r.x && x <= r.x + r.width && y >= r.y && y <= r.y + r.height);
if (rect) return { hit: rect, pos: { x, y } };
return null;
};
const onPointerMove = (e) => {
if (!state.menuInput) return;
state.pointer.x = e.clientX;
state.pointer.y = e.clientY;
state.pointer.inside = true;
if (state.menuDragging) {
const dx = e.clientX - state.menuDragOrigin.x;
const dy = e.clientY - state.menuDragOrigin.y;
setMenuPosition({
x: state.menuPosition.x + dx,
y: state.menuPosition.y + dy,
width: state.menuBounds?.width || 280,
height: state.menuBounds?.height || 400
});
state.menuDragOrigin = { x: e.clientX, y: e.clientY };
return;
}
if (state.menuSliderDragging) {
const hit = state.menuSliderDragging;
applyMenuHit(hit, { x: e.clientX, y: e.clientY });
return;
}
};
const onPointerDown = (e) => {
if (!state.menuInput) return;
const x = e.clientX;
const y = e.clientY;
const result = menuHit({ x, y });
if (result) {
const { hit, pos } = result;
if (hit.type === 'slider') {
state.menuSliderDragging = hit;
applyMenuHit(hit, pos);
return;
}
if (hit.type === 'header' || hit.type === 'collapse') {
state.menuDragging = true;
state.menuDragOrigin = { x: e.clientX, y: e.clientY };
}
applyMenuHit(hit, pos);
}
};
const onPointerUp = () => {
state.menuDragging = false;
state.menuSliderDragging = null;
};
const onPointerLeave = () => {
state.menuDragging = false;
state.menuSliderDragging = null;
};
const toggleMenuCollapsed = () => {
state.menuCollapsed = !state.menuCollapsed;
syncPointer();
return state.menuCollapsed;
};
const onHotkey = (event) => {
if (event.repeat || event.altKey || event.ctrlKey || event.metaKey) return;
if (event.code === 'Insert') {
event.preventDefault();
toggleMenuCollapsed();
}
};
const onVisibility = () => {
state.hidden = document.hidden === true;
};
const ensureMenuIcon = () => {
if (state.menuIcon) return state.menuIcon;
const icon = new Image();
icon.src = 'https://github.com/ichhabgarnixgemacht.png';
state.menuIcon = icon;
return icon;
};
const drawMenu = ({ ctx }) => {
state.menuRects = [];
state.menuBounds = null;
let { x, y } = state.menuPosition;
const collapsedSize = 64;
const width = 280;
const rowHeight = 36;
const headerHeight = 70;
const getRowHeight = (item) => {
if (item.type === 'target' && features.state.aimTargetOpen) return rowHeight + 2 * rowHeight;
return rowHeight;
};
const colors = {
bg: 'rgba(10, 11, 16, 0.95)',
header: 'rgba(18, 20, 28, 0.98)',
accent: '#00d2ff',
accentGlow: 'rgba(0, 210, 255, 0.4)',
text: '#f0f0f5',
textDim: '#71717a',
rowEven: 'rgba(255, 255, 255, 0.02)',
rowOdd: 'rgba(255, 255, 255, 0.03)',
border: 'rgba(255, 255, 255, 0.08)',
hover: 'rgba(0, 210, 255, 0.06)'
};
ctx.shadowBlur = 0;
ctx.shadowColor = 'transparent';
if (state.menuCollapsed) {
setMenuPosition({ x, y, width: collapsedSize, height: collapsedSize });
({ x, y } = state.menuPosition);
state.menuBounds = { x, y, width: collapsedSize, height: collapsedSize };
state.menuRects.push({ type: 'collapse', x, y, width: collapsedSize, height: collapsedSize });
ctx.save();
ctx.beginPath();
ctx.arc(x + 32, y + 32, 26, 0, Math.PI * 2);
ctx.shadowBlur = 15;
ctx.shadowColor = colors.accentGlow;
ctx.fillStyle = colors.bg;
ctx.fill();
ctx.beginPath();
ctx.arc(x + 32, y + 32, 26, 0, Math.PI * 2);
ctx.strokeStyle = colors.accent;
ctx.lineWidth = 2;
ctx.stroke();
ctx.fillStyle = colors.accent;
ctx.font = 'bold 22px "Outfit", sans-serif';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText('D', x + 32, y + 32);
ctx.restore();
return;
}
const targetOptions = [{ label: 'Head Only', value: 'head' }, { label: 'Body Prioritized', value: 'body' }];
const footerHeight = 32;
const contentHeight = features.items.reduce((acc, item) => acc + getRowHeight(item), 0);
const height = headerHeight + contentHeight + footerHeight;
setMenuPosition({ x, y, width, height });
({ x, y } = state.menuPosition);
state.menuBounds = { x, y, width, height };
state.menuRects.push({ type: 'header', x, y, width, height: headerHeight });
ctx.save();
const r = 14;
ctx.beginPath();
ctx.roundRect ? ctx.roundRect(x, y, width, height, r) : ctx.rect(x, y, width, height);
ctx.clip();
ctx.fillStyle = colors.bg;
ctx.fillRect(x, y, width, height);
const time = performance.now() / 1000;
const grad = ctx.createLinearGradient(x, y, x + width, y + headerHeight);
grad.addColorStop(0, '#1a1d26');
grad.addColorStop(1, '#0f1117');
ctx.fillStyle = grad;
ctx.fillRect(x, y, width, headerHeight);
const scanY = y + ((time * 40) % headerHeight);
ctx.fillStyle = 'rgba(0, 210, 255, 0.03)';
ctx.fillRect(x, scanY, width, 2);
ctx.strokeStyle = colors.border;
ctx.lineWidth = 1;
ctx.strokeRect(x, y, width, height);
ctx.textAlign = 'left';
ctx.textBaseline = 'middle';
ctx.font = '700 20px "Outfit", sans-serif';
ctx.fillStyle = colors.text;
ctx.fillText('DEADSHOT', x + 24, y + 34);
ctx.font = '600 10px "Outfit", sans-serif';
ctx.fillStyle = colors.accent;
ctx.letterSpacing = '1px';
ctx.fillText('PREMIUM CHEAT SYSTEM', x + 24, y + 54);
ctx.letterSpacing = '0px';
ctx.textAlign = 'right';
ctx.font = '500 10px "JetBrains Mono", monospace';
ctx.fillStyle = colors.textDim;
ctx.fillText('VER 1.0', x + width - 24, y + 34);
let rowY = y + headerHeight;
features.items.forEach((item, index) => {
const enabled = features.isEnabled(item.key);
const isTarget = item.type === 'target';
const isSlider = item.type === 'slider';
const isOpen = isTarget && features.state.aimTargetOpen;
const isHovered = state.pointer.inside &&
state.pointer.x >= x && state.pointer.x <= x + width &&
state.pointer.y >= rowY && state.pointer.y <= rowY + rowHeight;
state.menuRects.push({ key: item.key, type: item.type, x, y: rowY, width, height: rowHeight });
if (isHovered) {
ctx.fillStyle = colors.hover;
} else {
ctx.fillStyle = index % 2 === 0 ? colors.rowEven : colors.rowOdd;
}
ctx.fillRect(x, rowY, width, rowHeight);
ctx.textAlign = 'left';
ctx.font = '500 14px "Outfit", sans-serif';
ctx.fillStyle = enabled ? colors.text : colors.textDim;
ctx.fillText(item.label, x + 24, rowY + rowHeight / 2);
if (isTarget) {
const val = features.state.aimTarget === 'body' ? 'Body' : 'Head';
ctx.textAlign = 'right';
ctx.font = '600 13px "Outfit", sans-serif';
ctx.fillStyle = colors.accent;
ctx.fillText(val + (isOpen ? ' ▲' : ' ▼'), x + width - 24, rowY + rowHeight / 2);
} else if (isSlider) {
const val = features.state[item.key];
const sW = 80, sH = 3;
const sX = x + width - 104, sY = rowY + (rowHeight - sH) / 2;
ctx.fillStyle = 'rgba(255, 255, 255, 0.05)';
ctx.roundRect ? ctx.roundRect(sX, sY, sW, sH, 2) : ctx.rect(sX, sY, sW, sH);
ctx.fill();
const pct = (val - item.min) / (item.max - item.min);
ctx.fillStyle = colors.accent;
ctx.fillRect(sX, sY, sW * pct, sH);
ctx.beginPath();
ctx.arc(sX + sW * pct, sY + sH / 2, 5, 0, Math.PI * 2);
ctx.fillStyle = '#ffffff';
ctx.fill();
ctx.textAlign = 'right';
ctx.font = '600 11px "JetBrains Mono", monospace';
ctx.fillText(Math.round(val), sX - 12, rowY + rowHeight / 2 + 1);
state.menuRects[state.menuRects.length - 1].slider = { min: item.min, max: item.max, x: sX, width: sW };
} else {
const swW = 30, swH = 14;
const swX = x + width - 54, swY = rowY + (rowHeight - swH) / 2;
ctx.beginPath();
ctx.roundRect ? ctx.roundRect(swX, swY, swW, swH, 7) : ctx.rect(swX, swY, swW, swH);
ctx.fillStyle = enabled ? 'rgba(0, 210, 255, 0.1)' : 'rgba(255, 255, 255, 0.03)';
ctx.fill();
ctx.strokeStyle = enabled ? colors.accent : 'rgba(255,255,255,0.1)';
ctx.stroke();
ctx.beginPath();
const knobX = enabled ? swX + swW - 9 : swX + 9;
ctx.arc(knobX, swY + swH / 2, 5, 0, Math.PI * 2);
ctx.fillStyle = enabled ? colors.accent : colors.textDim;
ctx.fill();
}
rowY += rowHeight;
if (isTarget && isOpen) {
targetOptions.forEach((opt) => {
const selected = opt.value === features.state.aimTarget;
const subHover = state.pointer.inside &&
state.pointer.x >= x + 10 && state.pointer.x <= x + width - 10 &&
state.pointer.y >= rowY && state.pointer.y <= rowY + rowHeight;
state.menuRects.push({ type: 'targetOption', value: opt.value, x: x + 10, y: rowY, width: width - 20, height: rowHeight });
if (selected) ctx.fillStyle = 'rgba(0, 210, 255, 0.08)';
else if (subHover) ctx.fillStyle = 'rgba(255, 255, 255, 0.03)';
else ctx.fillStyle = 'transparent';
ctx.fillRect(x + 10, rowY + 2, width - 20, rowHeight - 4);
ctx.textAlign = 'left';
ctx.font = '500 13px "Outfit", sans-serif';
ctx.fillStyle = selected ? colors.accent : colors.textDim;
ctx.fillText(opt.label, x + 36, rowY + rowHeight / 2);
rowY += rowHeight;
});
}
});
ctx.fillStyle = 'rgba(255, 255, 255, 0.02)';
ctx.fillRect(x, y + height - footerHeight, width, footerHeight);
ctx.textAlign = 'center';
ctx.font = '600 10px "Outfit", sans-serif';
ctx.fillStyle = colors.textDim;
ctx.fillText('v1.0 - press INSERT to toggle', x + width / 2, y + height - footerHeight / 2 + 2);
ctx.restore();
};
const drawEntity = ({ entry, now }) => {
if (!state.ctx) return;
if (now - entry.lastSeen > 50) return;
if (!shouldDraw({ entry })) return;
const { hp, maxHp, visible } = entry;
const f = features.state;
const screen = entryScreen({ entry });
const skeleton = f.espSkeleton ? skeletonOverlay({ entry }) : null;
const boneBox =
f.espBoxes
? screenBox({
entry,
fallbackScreen: screen
}) || null
: null;
if (!skeleton && !boneBox && (!screen || ![screen.x, screen.y, screen.size].every(Number.isFinite))) return;
const ctx = state.ctx;
const boxHeight =
skeleton?.bounds?.height ||
boneBox?.height ||
clamp({
value: (screen?.size || 12) * 2.35,
min: 28,
max: 170
});
const boxWidth =
skeleton?.bounds?.width ||
boneBox?.width ||
clamp({
value: boxHeight * 0.42,
min: 18,
max: 90
});
const left = skeleton?.bounds?.left ?? boneBox?.left ?? screen.x - boxWidth / 2;
const top = skeleton?.bounds?.top ?? boneBox?.top ?? screen.y + (screen?.size || 0) * 0.35;
const overlayWidth = skeleton?.bounds?.width || boxWidth;
const overlayHeight = skeleton?.bounds?.height || boxHeight;
const centerX = left + overlayWidth / 2;
const ratio =
Number.isFinite(maxHp) && maxHp > 0
? clamp({
value: hp / maxHp,
min: 0,
max: 1
})
: 0;
const mainColor = visible ? 'rgba(0,255,140,0.95)' : 'rgba(255,92,92,0.95)';
const fillColor = visible ? 'rgba(0,255,140,0.12)' : 'rgba(255,92,92,0.10)';
ctx.save();
ctx.lineWidth = 1.5;
ctx.strokeStyle = mainColor;
ctx.fillStyle = fillColor;
if (skeleton) {
ctx.lineCap = 'round';
ctx.lineJoin = 'round';
ctx.beginPath();
for (const [from, to] of skeleton.lines) {
const start = skeleton.points[from];
const end = skeleton.points[to];
ctx.moveTo(start.x, start.y);
ctx.lineTo(end.x, end.y);
}
ctx.stroke();
} else {
ctx.fillRect(left, top, boxWidth, boxHeight);
ctx.strokeRect(left, top, boxWidth, boxHeight);
}
if (f.espTracers) {
ctx.beginPath();
ctx.moveTo(window.innerWidth / 2, window.innerHeight - 20);
ctx.lineTo(centerX, top + overlayHeight * 0.5);
ctx.strokeStyle = visible ? 'rgba(0, 255, 140, 0.3)' : 'rgba(255, 92, 92, 0.25)';
ctx.stroke();
}
if (f.espHealth && Number.isFinite(maxHp) && maxHp > 0) {
const ratio = clamp({ value: hp / maxHp, min: 0, max: 1 });
const hpBarX = left - 7;
const hpBarY = top;
ctx.fillStyle = 'rgba(10, 10, 10, 0.8)';
ctx.fillRect(hpBarX, hpBarY, 4, overlayHeight);
ctx.fillStyle = ratio > 0.5 ? '#00ff88' : ratio > 0.25 ? '#ffd54a' : '#ff5c5c';
ctx.fillRect(hpBarX, hpBarY + overlayHeight * (1 - ratio), 4, overlayHeight * ratio);
}
if (f.espNames) {
ctx.font = '600 12px Outfit, Inter, Consolas, monospace';
ctx.textAlign = 'center';
ctx.textBaseline = 'bottom';
ctx.fillStyle = '#ffffff';
ctx.strokeStyle = 'rgba(0,0,0,0.8)';
ctx.lineWidth = 3;
const identityLabel = entryLabel({ entry });
ctx.strokeText(identityLabel, centerX, top - 6);
ctx.fillText(identityLabel, centerX, top - 6);
}
ctx.restore();
};
const loop = (timestamp) => {
ensureCanvas();
if (state.ctx && !state.hidden) {
const now = timestamp;
state.ctx.clearRect(0, 0, window.innerWidth, window.innerHeight);
if (features.isEnabled('esp'))
for (const [id, entry] of state.entries) {
if (now - entry.lastSeen > 80) {
state.entries.delete(id);
continue;
}
drawEntity({
entry,
now
});
}
drawFov({ ctx: state.ctx });
drawMenu({ ctx: state.ctx });
syncPointer();
}
state.rafId = requestAnimationFrame(loop);
};
const ensureMenuInput = ({ host }) => {
if (state.menuInput) {
if (!host.contains(state.menuInput)) host.append(state.menuInput);
return state.menuInput;
}
const menuInput = document.createElement('div');
menuInput.id = 'menu-input';
menuInput.style.position = 'fixed';
menuInput.style.display = 'none';
menuInput.style.background = 'transparent';
menuInput.style.zIndex = '2147483647';
menuInput.style.pointerEvents = 'none';
menuInput.style.touchAction = 'none';
state.menuInput = menuInput;
menuInput.addEventListener('pointerdown', onPointerDown, true);
menuInput.addEventListener('pointermove', onPointerMove, true);
menuInput.addEventListener('pointerup', onPointerUp, true);
menuInput.addEventListener('pointercancel', onPointerUp, true);
menuInput.addEventListener('pointerleave', onPointerLeave, true);
host.append(menuInput);
return menuInput;
};
const ensureCanvas = () => {
const host = canvasHost();
if (!host) return null;
if (state.canvas && state.ctx) {
if (state.host !== host || !host.contains(state.canvas)) {
host.append(state.canvas);
state.host = host;
resize();
}
ensureMenuInput({ host });
syncPointer();
return state.canvas;
}
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d', { alpha: true });
if (!ctx) return null;
canvas.id = 'canvas-esp';
canvas.style.position = 'fixed';
canvas.style.inset = '0';
canvas.style.width = '100vw';
canvas.style.height = '100vh';
canvas.style.display = 'block';
canvas.style.pointerEvents = 'none';
canvas.style.zIndex = '2147483647';
canvas.style.opacity = '1';
canvas.style.background = 'transparent';
state.canvas = canvas;
state.ctx = ctx;
state.host = host;
host.append(canvas);
ensureMenuInput({ host });
resize();
syncPointer();
if (!state.rafId) state.rafId = requestAnimationFrame(loop);
return canvas;
};
const entityId = ({ entity }) => {
if (!entity || (typeof entity !== 'object' && typeof entity !== 'function')) return null;
let id = state.ids.get(entity);
if (!id) {
id = state.nextId++;
state.ids.set(entity, id);
}
return id;
};
const setCam = (worldToCamera, projection, zoom) => {
if (!matEls(worldToCamera) || !matEls(projection)) return;
state.camera.worldToCamera = worldToCamera;
state.camera.projection = projection;
state.camera.zoom = Number.isFinite(zoom) ? zoom : state.camera.zoom;
state.camera.updatedAt = performance.now();
state.camera.inverse = null;
state.camera.inverseUpdatedAt = 0;
};
const setTrace = (world, ray, shotOrigin, losFn, losDistanceFn) => {
const nextWorld = world?.et7PY4ZbEwYcUADq ? world : state.trace.world?.et7PY4ZbEwYcUADq ? state.trace.world : world || null;
const nextRay = ray || state.trace.ray || null;
const nextShotOrigin = isVec3(shotOrigin) ? shotOrigin : state.trace.shotOrigin || null;
const nextLosFn = typeof losFn === 'function' ? losFn : null;
const nextLosDistanceFn = typeof losDistanceFn === 'function' ? losDistanceFn : null;
const now = performance.now();
if (state.trace.world === nextWorld && state.trace.ray === nextRay && state.trace.shotOrigin === nextShotOrigin && state.trace.losFn === nextLosFn && state.trace.losDistanceFn === nextLosDistanceFn && now - state.trace.updatedAt < traceMs) return;
state.trace.world = nextWorld;
state.trace.ray = nextRay;
state.trace.raySnapshot = nextRay
? {
origin: cloneVec(nextRay.origin),
direction: cloneVec(nextRay.lC6FfRUZOep61),
dest: cloneVec(nextRay.dest),
near: Number.isFinite(nextRay.near) ? nextRay.near : null,
far: Number.isFinite(nextRay.far) ? nextRay.far : null
}
: null;
state.trace.losRay = cloneRay(nextRay);
state.trace.shotOrigin = nextShotOrigin;
state.trace.shotOriginSnapshot = cloneVec(nextShotOrigin);
state.trace.losFn = nextLosFn;
state.trace.losDistanceFn = nextLosDistanceFn;
state.trace.updatedAt = now;
};
const shotFallback = () => {
const fallbackOrigin = isVec3(state.trace.shotOriginSnapshot) ? state.trace.shotOriginSnapshot : isVec3(state.trace.shotOrigin) ? state.trace.shotOrigin : null;
if (fallbackOrigin && [fallbackOrigin.x, fallbackOrigin.y, fallbackOrigin.z].every(Number.isFinite)) return fallbackOrigin;
return camPos();
};
const shotOrigin = () => {
const traceOrigin = isVec3(state.trace.raySnapshot?.origin) ? state.trace.raySnapshot.origin : isVec3(state.trace.ray?.origin) ? state.trace.ray.origin : null;
const fallbackOrigin = shotFallback();
const traceOriginDelta = dist3(traceOrigin, fallbackOrigin);
if (traceOrigin && [traceOrigin.x, traceOrigin.y, traceOrigin.z].every(Number.isFinite) && (!Number.isFinite(traceOriginDelta) || traceOriginDelta <= maxTraceDrift)) return traceOrigin;
return fallbackOrigin;
};
const losDist = ({ point, entry = null, now = performance.now() }) => {
if (entry && Number.isFinite(entry.losCacheAt) && now - entry.losCacheAt < losCacheMs) return entry.losCache;
const { world, ray, losRay, losFn, losDistanceFn } = state.trace;
const origin = shotOrigin();
const traceRay = ray || losRay;
const setCachedDistance = (distance) => {
if (entry) {
entry.losCache = distance;
entry.losCacheAt = now;
}
return distance;
};
if (!point || ![point.x, point.y, point.z].every(Number.isFinite) || !isVec3(origin) || !traceRay) return setCachedDistance(Number.POSITIVE_INFINITY);
if (typeof losDistanceFn === 'function')
try {
const distance = keepObj({
target: traceRay,
work: () => losDistanceFn(world, origin, point, traceRay, false)
});
if (Number.isFinite(distance)) return setCachedDistance(distance);
} catch { }
if (typeof losFn === 'function')
try {
return setCachedDistance(
keepObj({
target: traceRay,
work: () => (losFn(world, origin, point, traceRay, false) === true ? 0 : Number.POSITIVE_INFINITY)
})
);
} catch { }
return setCachedDistance(Number.POSITIVE_INFINITY);
};
const magicBulletShot = () => {
if (!features.isEnabled('magicBullet')) return null;
const now = performance.now();
const zoom = Number.isFinite(state.camera?.zoom) ? state.camera.zoom : 1;
const origin = shotOrigin() || camPos();
const camForward = camDir();
const width = window.innerWidth || 1;
const height = window.innerHeight || 1;
const centerX = width / 2;
const centerY = height / 2;
const localTeam = Number.isFinite(state.localTeam) ? state.localTeam : null;
const zoomThreshold = 1.02;
const losThresholdSq = 0.1;
const hiddenMinTargetDot = 0.05;
const aimMargin = 0.2;
let best = null;
if (zoom <= zoomThreshold) return null;
if (!origin) return null;
for (const entry of state.entries.values()) {
if (!entry?.entity) continue;
if (entry.currentDead === true || entry.previousDead === true || (Number.isFinite(entry.hp) && entry.hp <= 0)) continue;
if (localTeam !== null && entry.team === localTeam && localTeam !== 0) continue;
const aimPoint = aimWorld({ entry });
if (!aimPoint) continue;
const losSq = losDist({
point: aimPoint,
entry,
now
});
const hasRaycastResult = Number.isFinite(losSq);
const losFallbackVisible = !hasRaycastResult && entry.visible === true;
const losScore = hasRaycastResult ? losSq : losFallbackVisible ? losThresholdSq : Number.POSITIVE_INFINITY;
if (!(hasRaycastResult ? losSq <= losThresholdSq : losFallbackVisible)) continue;
const aim = aimAngles({
origin,
point: aimPoint
});
if (!aim) continue;
const screen = project(aimPoint);
const screenDist = screen && Number.isFinite(screen.x) && Number.isFinite(screen.y) ? Math.hypot(screen.x - centerX, screen.y - centerY) : 0;
if (
inAimWindow({
point: screen,
width,
height,
marginRatio: aimMargin
}) === false
)
continue;
const targetVector = {
x: aimPoint.x - origin.x,
y: aimPoint.y - origin.y,
z: aimPoint.z - origin.z
};
const targetLength = Math.hypot(targetVector.x, targetVector.y, targetVector.z);
const dot = camForward && Number.isFinite(targetLength) && targetLength > 1e-5 ? (camForward.x * targetVector.x + camForward.y * targetVector.y + camForward.z * targetVector.z) / targetLength : 0;
if (entry.visible !== true && Number.isFinite(dot) && dot <= hiddenMinTargetDot) continue;
const score = screenDist + (Number.isFinite(screen?.depth) ? Math.max(screen.depth, -1) * 80 : 0) + Math.max(0, 1 - dot) * 600 + Math.min(aim.horizontalDistance, 240) * 0.02 + losScore * 600;
if (!best || score < best.score)
best = {
yaw: aim.yaw,
pitch: aim.pitch,
point: aimPoint,
score
};
}
return best
? {
yaw: best.yaw,
pitch: best.pitch,
point: best.point
}
: null;
};
const setTeam = (team) => {
if (!Number.isFinite(team)) return;
state.localTeam = team;
state.localTeamUpdatedAt = performance.now();
};
const setId = (entity, serverId, displayName, clan) => {
ensureCanvas();
const id = entityId({ entity });
if (!id) return;
const sid = normId(serverId);
const name = normText(displayName);
const clanTag = normText(clan);
const previous = state.entries.get(id) || { id };
const now = performance.now();
if (sid !== null) {
const idKey = `${sid}`;
const oldId = state.identityByServerId.get(idKey) || {};
state.identityByServerId.set(idKey, {
serverId: sid,
displayName: name ?? oldId.displayName ?? null,
clan: clanTag ?? oldId.clan ?? null
});
}
state.entries.set(id, {
...previous,
entity,
serverId: serverId === void 0 ? (previous.serverId ?? null) : sid,
displayName: displayName === void 0 ? (previous.displayName ?? null) : name,
clan: clan === void 0 ? (previous.clan ?? null) : clanTag,
identityUpdatedAt: now,
lastSeen: Number.isFinite(previous.lastSeen) ? Math.max(previous.lastSeen, now) : now
});
learnSidKey();
};
const upsert = (entity, x, y, size, hp, maxHp, depth, visible, team, currentDead, previousDead) => {
ensureCanvas();
const id = entityId({ entity });
if (!id) return;
if (![x, y, size, depth].every(Number.isFinite)) return;
if (Number.isFinite(hp) && hp <= 0) return;
const previous = state.entries.get(id) || { id };
state.entries.set(id, {
...previous,
entity,
x,
y,
size,
hp: Number.isFinite(hp) ? hp : previous.hp || 0,
maxHp: Number.isFinite(maxHp) ? maxHp : previous.maxHp || 100,
depth,
visible: Boolean(visible),
team: Number.isFinite(team) ? team : (previous.team ?? null),
currentDead: currentDead === true,
previousDead: previousDead === true,
screenUpdatedAt: performance.now(),
lastSeen: performance.now()
});
};
const upsertWorld = (entity, worldX, worldY, worldZ, hp, maxHp, visible, team, currentDead, previousDead) => {
ensureCanvas();
const id = entityId({ entity });
if (!id) return;
if (![worldX, worldY, worldZ].every(Number.isFinite)) return;
if (Number.isFinite(hp) && hp <= 0) return;
const previous = state.entries.get(id) || { id };
state.entries.set(id, {
...previous,
entity,
worldX,
worldY,
worldZ,
hp: Number.isFinite(hp) ? hp : previous.hp || 0,
maxHp: Number.isFinite(maxHp) ? maxHp : previous.maxHp || 100,
visible: Boolean(visible),
team: Number.isFinite(team) ? team : (previous.team ?? null),
currentDead: currentDead === true,
previousDead: previousDead === true,
worldUpdatedAt: performance.now(),
lastSeen: performance.now()
});
};
const api = {
setCam,
setTrace,
setTeam,
setId,
upsertWorld,
upsert,
project,
camPos,
camDir,
shotOrigin,
head,
aimWorld,
losDist,
magicBulletShot,
resize,
syncPointer,
state
};
globalThis.ichhabgarnixgemacht_esp = api;
globalThis.addEventListener('keydown', onHotkey, true);
window.addEventListener('resize', resize, { passive: true });
document.addEventListener('fullscreenchange', ensureCanvas, { passive: true });
document.addEventListener('webkitfullscreenchange', ensureCanvas, { passive: true });
document.addEventListener('mozfullscreenchange', ensureCanvas, { passive: true });
document.addEventListener('pointerlockchange', ensureCanvas, { passive: true });
document.addEventListener('webkitpointerlockchange', ensureCanvas, { passive: true });
document.addEventListener('mozpointerlockchange', ensureCanvas, { passive: true });
document.addEventListener('visibilitychange', onVisibility, { passive: true });
document.addEventListener('DOMContentLoaded', ensureCanvas, { once: true });
ensureCanvas();
return api;
};
const setupAim = () => {
if (globalThis.ichhabgarnixgemacht_aimbot) return globalThis.ichhabgarnixgemacht_aimbot;
const features = setupFlags();
const state = {
enabled: features.isEnabled('aimbot'),
visibleOnly: true,
zoomThreshold: 1.02,
losThresholdSq: 0.1,
hiddenMinTargetDot: 0.05,
aimMargin: 0.2
};
const pickBest = (left, right) => {
if (!left) return right || null;
if (!right) return left;
return left.score <= right.score ? left : right;
};
const pickTarget = () => {
const esp = globalThis.ichhabgarnixgemacht_esp;
if (!esp?.state?.entries) return null;
if ((Number.isFinite(esp.state.camera?.zoom) ? esp.state.camera.zoom : 1) <= state.zoomThreshold) return null;
const camOrigin = esp.camPos?.();
const origin = esp.shotOrigin?.() || camOrigin;
const camForward = esp.camDir?.();
if (!origin) return null;
const now = performance.now();
const width = window.innerWidth || 1;
const height = window.innerHeight || 1;
const centerX = width / 2;
const centerY = height / 2;
const localTeam = Number.isFinite(esp.state.localTeam) ? esp.state.localTeam : null;
let bestScreenVis = null;
let bestScreenHid = null;
let bestAngleVis = null;
let bestAngleHid = null;
for (const entry of esp.state.entries.values()) {
if (!entry?.entity) continue;
if (entry.currentDead === true || entry.previousDead === true || (Number.isFinite(entry.hp) && entry.hp <= 0)) continue;
if (localTeam !== null && entry.team === localTeam && localTeam !== 0) continue;
const targetPoint = esp.aimWorld?.({ entry }) || esp.head?.({ entry });
if (!targetPoint) continue;
const losSq = esp.losDist?.({
point: targetPoint,
entry,
now
});
const hasRaycastResult = Number.isFinite(losSq);
const losFallbackVisible = !hasRaycastResult && entry.visible === true;
const losScore = hasRaycastResult ? losSq : losFallbackVisible ? state.losThresholdSq : Number.POSITIVE_INFINITY;
if (!(hasRaycastResult ? losSq <= state.losThresholdSq : losFallbackVisible)) continue;
const world = targetPoint;
const screen = esp.project?.(world);
const screenDist = screen && [screen.x, screen.y].every(Number.isFinite) ? Math.hypot(screen.x - centerX, screen.y - centerY) : null;
if (features.isEnabled('aimbot') && features.state.aimFov > 0) {
if (!screenDist || screenDist > features.state.aimFov) continue;
}
const worldDx = world.x - origin.x;
const worldDy = world.y - origin.y;
const worldDz = world.z - origin.z;
const targetDist = Math.hypot(worldDx, worldDy, worldDz);
if (!Number.isFinite(targetDist) || targetDist <= 1e-5) continue;
const aim = aimAngles({
origin,
point: world
});
if (!aim) continue;
const dot = camForward && [camForward.x, camForward.y, camForward.z].every(Number.isFinite) ? (camForward.x * worldDx + camForward.y * worldDy + camForward.z * worldDz) / targetDist : null;
if (entry.visible !== true && Number.isFinite(dot) && dot <= state.hiddenMinTargetDot) continue;
const depthCost = Number.isFinite(screen?.depth) ? Math.max(screen.depth, -1) * 80 : 0;
const isVis = entry.visible === true;
const screenCandidate = Number.isFinite(screenDist)
? {
yaw: aim.yaw,
pitch: aim.pitch,
score: screenDist + depthCost + Math.min(aim.horizontalDistance, 240) * 0.02 + losScore * 600
}
: null;
const dotCandidate = Number.isFinite(dot)
? {
yaw: aim.yaw,
pitch: aim.pitch,
score: (1 - dot) * 1e3 + Math.min(aim.horizontalDistance, 240) * 0.03 + losScore * 600
}
: null;
const fallback =
!dotCandidate && Number.isFinite(screenDist)
? {
yaw: aim.yaw,
pitch: aim.pitch,
score: screenDist + depthCost + losScore * 600
}
: null;
const angleCandidate = dotCandidate || fallback;
if (![screenCandidate?.score, angleCandidate?.score].some(Number.isFinite)) continue;
if (screenCandidate)
if (isVis) bestScreenVis = pickBest(bestScreenVis, screenCandidate);
else bestScreenHid = pickBest(bestScreenHid, screenCandidate);
if (angleCandidate)
if (isVis) bestAngleVis = pickBest(bestAngleVis, angleCandidate);
else bestAngleHid = pickBest(bestAngleHid, angleCandidate);
}
if (!state.visibleOnly) {
const bestProjected = pickBest(bestScreenVis, bestScreenHid);
if (bestProjected) return bestProjected;
return pickBest(bestAngleVis, bestAngleHid);
}
if (bestScreenVis) return bestScreenVis;
if (bestScreenHid) return bestScreenHid;
if (bestAngleVis) return bestAngleVis;
if (bestAngleHid) return bestAngleHid;
return null;
};
const tick = (applyAngles, currentYaw, currentPitch) => {
const now = performance.now();
if (!features.isEnabled('aimbot') || !state.enabled || typeof applyAngles !== 'function') {
if (state.isFiring) {
dispatchMouse(false);
state.isFiring = false;
}
return false;
}
const picked = pickTarget();
if (!picked) return false;
let nextYaw = picked.yaw;
let nextPitch = picked.pitch;
const smooth = features.state.aimSmooth;
if (smooth > 0 && Number.isFinite(currentYaw) && Number.isFinite(currentPitch)) {
const smoothFactor = 1 / (smooth + 1);
let yawDiff = nextYaw - currentYaw;
while (yawDiff > Math.PI) yawDiff -= Math.PI * 2;
while (yawDiff < -Math.PI) yawDiff += Math.PI * 2;
nextYaw = currentYaw + yawDiff * smoothFactor;
const pitchDiff = nextPitch - currentPitch;
nextPitch = currentPitch + pitchDiff * smoothFactor;
}
applyAngles(nextYaw, nextPitch);
return true;
};
const api = {
state,
tick
};
globalThis.ichhabgarnixgemacht_aimbot = api;
return api;
};
const patchEsp = (match, ...args) => {
const groups = args.at(-1);
if (match.includes('ichhabgarnixgemacht_esp')) return match;
const bodyPattern = groups
? makeProjBodyRe({
anchorVec: groups.anchorVec,
entityVar: groups.entityVar,
screenVar: groups.screenVar,
nearVar: groups.nearVar,
farVar: groups.farVar
})
: null;
const metaPattern = groups
? makeProjMetaRe({
entityVar: groups.entityVar,
visibleVar: groups.visibleVar
})
: null;
const bodyMatch = bodyPattern ? groups?.body?.match(bodyPattern) : null;
const metaMatch = metaPattern ? match.match(metaPattern) : null;
if (!bodyMatch?.groups || !metaMatch?.groups) return match;
const { sizeExpr, hpExpr, maxHpExpr, zoomExpr } = bodyMatch.groups;
const { teamExpr, currentDeadExpr, previousDeadExpr, localTeamVar } = metaMatch.groups;
const projectionAnchor = `${groups.anchorVec}['y']-=${groups.offsetExpr},${groups.anchorVec}['${groups.projectMethod}'](`;
const worldHook = `globalThis.ichhabgarnixgemacht_esp&&globalThis.ichhabgarnixgemacht_esp.setTeam(typeof ${localTeamVar}!=='undefined'?${localTeamVar}:null);globalThis.ichhabgarnixgemacht_esp&&globalThis.ichhabgarnixgemacht_esp.setCam(${groups.worldToCameraExpr},${groups.projectionExpr},${zoomExpr});globalThis.ichhabgarnixgemacht_esp&&globalThis.ichhabgarnixgemacht_esp.setTrace(typeof Qb!=='undefined'?Qb:null,typeof Zn!=='undefined'?Zn:null,typeof Wn!=='undefined'&&Wn&&Wn[${groups.coordIndexVar}]?Wn[${groups.coordIndexVar}]:null,typeof Eq==='function'?Eq:null,typeof Ep==='function'?Ep:null);globalThis.ichhabgarnixgemacht_esp&&globalThis.ichhabgarnixgemacht_esp.upsertWorld(${groups.entityVar},${groups.anchorVec}['x'],${groups.anchorVec}['y'],${groups.anchorVec}['z'],${hpExpr},${maxHpExpr},${groups.visibleVar},${teamExpr},${currentDeadExpr},${previousDeadExpr});`;
const screenHook = `globalThis.ichhabgarnixgemacht_esp&&globalThis.ichhabgarnixgemacht_esp.upsert(${groups.entityVar},${groups.screenVar}['x'],${groups.screenVar}['y'],${sizeExpr},${hpExpr},${maxHpExpr},${groups.anchorVec}['z'],${groups.visibleVar},${teamExpr},${currentDeadExpr},${previousDeadExpr}),`;
const nextBody = groups.body.replace(bodyMatch[0], `${bodyMatch[0]}${screenHook}`);
return match.replace(projectionAnchor, `${groups.anchorVec}['y']-=${groups.offsetExpr};${worldHook}${groups.anchorVec}['${groups.projectMethod}'](`).replace(groups.body, nextBody);
};
const patchIdPkt = (match, ...args) => {
const groups = args.at(-1);
if (!groups || match.includes('ichhabgarnixgemacht_esp')) return match;
idPatch.arrays = {
nameArr: groups.nameArr,
clanArr: groups.clanArr
};
const anchor = `${groups.nameplateFn}(${groups.lookupFn}(${groups.idExpr}),${groups.nameArr}[${groups.idExpr}]),`;
const hook = `globalThis.ichhabgarnixgemacht_esp&&globalThis.ichhabgarnixgemacht_esp.setId(${groups.lookupFn}(${groups.idExpr}),${groups.idExpr},${groups.nameArr}[${groups.idExpr}],typeof ${groups.clanArr}[${groups.idExpr}]==='undefined'?null:${groups.clanArr}[${groups.idExpr}]);`;
if (!match.includes(anchor)) return match;
return match.replace(anchor, `${hook}${anchor}`);
};
const patchSpawn = (match, ...args) => {
const groups = args.at(-1);
if (!groups || match.includes('ichhabgarnixgemacht_esp')) return match;
const nameArr = idPatch.arrays?.nameArr || groups.nameArr;
const clanArr = idPatch.arrays?.clanArr;
const serverIdExpr = `${groups.entityVar}[${groups.serverIdExpr}]`;
const nameExpr = `${nameArr}[${serverIdExpr}]`;
const clanExpr = clanArr ? `typeof ${clanArr}[${serverIdExpr}]==='undefined'?void 0:${clanArr}[${serverIdExpr}]` : 'void 0';
const anchor = `${groups.nameplateFn}(${groups.entityVar},${groups.nameArr}[${serverIdExpr}]);var ${groups.pushArrayVar}=${groups.upVar},${groups.lenVar}=${groups.upVar}['length'];`;
const hook = `globalThis.ichhabgarnixgemacht_esp&&globalThis.ichhabgarnixgemacht_esp.setId(${groups.entityVar},${serverIdExpr},${nameExpr},${clanExpr});`;
if (!match.includes(anchor)) return match;
return match.replace(anchor, `${groups.nameplateFn}(${groups.entityVar},${groups.nameArr}[${serverIdExpr}]);${hook}var ${groups.pushArrayVar}=${groups.upVar},${groups.lenVar}=${groups.upVar}['length'];`);
};
const patchShot = (match, ...args) => {
const groups = args.at(-1);
if (!groups || match.includes('ichhabgarnixgemacht_esp.magicBulletShot')) return match;
const packetObj = groups.packetObj || groups.packetStore;
const sendFn = groups.sendFn || groups.rawSendFn;
if (!packetObj || !sendFn) return match;
const packetSlotPattern = new RegExp(String.raw`${escRe(packetObj)}(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)(?:\[[^\]]+\]|\.[A-Za-z_$][\w$]*)=`, 'g');
const [, , pitchSlot, yawSlot, xSlot, ySlot, zSlot] = [...match.matchAll(packetSlotPattern)].map((slotMatch) => slotMatch[0].slice(0, -1));
if (![yawSlot, pitchSlot, xSlot, ySlot, zSlot].every(Boolean)) return match;
const hook = `(()=>{const shot=globalThis.ichhabgarnixgemacht_esp&&globalThis.ichhabgarnixgemacht_esp.magicBulletShot&&globalThis.ichhabgarnixgemacht_esp.magicBulletShot();shot&&(${yawSlot}=shot.yaw,${pitchSlot}=shot.pitch,${xSlot}=shot.point.x,${ySlot}=shot.point.y,${zSlot}=shot.point.z);})(),`;
return match.replace(`${sendFn}(`, `${hook}${sendFn}(`);
};
const patchAim = (match, ...args) => {
const groups = args.at(-1);
if (!groups || match.includes('ichhabgarnixgemacht_aimbot.tick')) return match;
return match.replace(groups.anchor, `globalThis.ichhabgarnixgemacht_aimbot&&globalThis.ichhabgarnixgemacht_aimbot.tick((nextYaw,nextPitch)=>{Number.isFinite(nextYaw)&&(Wn[Rl]['y']=nextYaw);Number.isFinite(nextPitch)&&(Ww=Math.max(-Wj,Math.min(Wj,nextPitch)));}, Wn[Rl]['y'], Ww);${groups.anchor}`);
};
let chatSendPatch = null;
const collectChatSendPatch = (code) => {
reChatSend.lastIndex = 0;
let match = reChatSend.exec(code);
while (match) {
const { groups } = match;
if (groups && !match[0].includes('ichhabgarnixgemacht_chat'))
chatSendPatch = {
packetExpr: `${groups.packetRoot}${groups.packetAccess}`,
serializer: groups.serializer,
socket: groups.socket,
readyCheck: groups.ready.trim().replaceAll(/&&\s*$/g, '')
};
match = reChatSend.exec(code);
}
};
const chatSendHook = ({ packetExpr, serializer, socket, readyCheck }) => {
const readyExpr = readyCheck || `${socket}&&${socket}['readyState']==0x1`;
return `globalThis.ichhabgarnixgemacht_chat={send:(value)=>{const msg=String(value??'').slice(0,100);if(!msg.length)return false;const packet=${packetExpr},buffer=new ArrayBuffer(packet['preStrSize']+msg['length']+0x2),view=new DataView(buffer);packet['string']=msg;${serializer}(packet,view);if(${readyExpr}){${socket}['send'](buffer);return true;}return false;}}`;
};
const setupChatHotkey = () => {
};
const injectChatSendHook = (code) => {
if (!chatSendPatch || code.includes('ichhabgarnixgemacht_chat')) return code;
const hook = chatSendHook(chatSendPatch);
const socketBinaryTypeRe = new RegExp(String.raw`(${escRe(chatSendPatch.socket)}(?:\.binaryType|\[['"]binaryType['"]\])\s*=\s*[^,;]+)([,;]?)`);
if (socketBinaryTypeRe.test(code)) return code.replace(socketBinaryTypeRe, (_, assignment, separator) => (separator === ',' ? `${assignment},${hook},` : `${assignment};${hook};`));
return code;
};
const patchRecoil = (match) => {
const f = setupFlags();
return f.isEnabled('noRecoil') ? '=0' : match;
};
const patchSpread = (match, recoilVar, tail) => {
const f = setupFlags();
return f.isEnabled('noSpread') ? `var ${recoilVar}=0${tail}` : match;
};
const patchFov = (match, fovVar, extraFovTarget) => {
return `var ${fovVar}=0;${extraFovTarget}=0;`;
};
const patches = [
{
pattern: /=\([^;]*0\.025-t4\[[^\]]+\]\([^;]*\/0x4\)\)\*0\.7/g,
replace: patchRecoil
},
{
pattern: /var ([A-Za-z_$][\w$]*)=[^;]+(;if\([^;]+==0x1\)var [A-Za-z_$][\w$]*=[^;]+;else var [A-Za-z_$][\w$]*=[^;]+;var [A-Za-z_$][\w$]*=\1\*Math\['sqrt'\])/g,
replace: patchSpread
},
{
pattern: /var ([A-Za-z_$][\w$]*)=WR\([^;]+\);([^]{0,1200}?\['extraFOV'\])=\1;/g,
replace: patchFov
},
{
pattern: reIdPkt,
replace: patchIdPkt
},
{
pattern: reSpawn,
replace: patchSpawn
},
{
pattern: reEsp,
replace: patchEsp
},
{
pattern: reShot,
replace: patchShot
},
{
pattern: reAim,
replace: patchAim
}
];
const patchCode = (code) => {
let nextCode = code;
chatSendPatch = null;
collectChatSendPatch(nextCode);
for (const { pattern, replace } of patches) {
pattern.lastIndex = 0;
if (!pattern.test(nextCode)) continue;
pattern.lastIndex = 0;
nextCode = nextCode.replace(pattern, replace);
}
return injectChatSendHook(nextCode);
};
const wasmInstantiate = WebAssembly.instantiate;
const hasEspSig = (code) => new RegExp(reEsp.source).test(code);
setupEsp();
setupAim();
setupChatHotkey();
WebAssembly.instantiate = async (buffer, importObject) => {
if (importObject?.wbg) {
const evalKey = Object.keys(importObject.wbg).find((key) => key.includes('eval'));
if (evalKey) {
const originalEval = importObject.wbg[evalKey];
importObject.wbg[evalKey] = async (arg0, arg1) => {
if (!globalThis.wasmMemory) globalThis.wasmMemory = importObject.wbg.memory || importObject.env?.memory;
let code = '';
try {
const mem = new Uint8Array(globalThis.wasmMemory.buffer);
code = decoder.decode(mem.slice(arg0, arg0 + arg1));
} catch {
return Reflect.apply(originalEval, importObject.wbg, [arg0, arg1]);
}
if (!code.includes('/ws?name=hi')) return Reflect.apply(originalEval, importObject.wbg, [arg0, arg1]);
if (!hasEspSig(code)) return Reflect.apply(originalEval, importObject.wbg, [arg0, arg1]);
const modifiedCode = patchCode(code);
try {
return (0, eval)(modifiedCode);
} catch {
return Reflect.apply(originalEval, importObject.wbg, [arg0, arg1]);
}
};
}
}
const result = await Reflect.apply(wasmInstantiate, WebAssembly, [buffer, importObject]);
if (result.instance?.exports?.memory) globalThis.wasmMemory = result.instance.exports.memory;
return result;
};
if (WebAssembly.instantiateStreaming)
WebAssembly.instantiateStreaming = async (source, importObject) => {
const res = await source;
return WebAssembly.instantiate(await res.arrayBuffer(), importObject);
};
})();
})();