- 6
- 1
- Версия SA-MP
-
- Любая
- Другая
Кейспуф для https://kiznold.cc/xsoft/
Активация: Вставляете код в F12 - Console
На SHIFT вы можете допускать ошибки
Активация: Вставляете код в F12 - Console
На SHIFT вы можете допускать ошибки
В файле keyspoof v7
В файле keyspoof v6
В файле keyspoof v5
JavaScript:
(function () {
const frame = document.createElement('iframe');
frame.style.display = 'none';
document.head.appendChild(frame);
frame.remove();
let currentCaptcha = "";
let currentIndex = 0;
const OriginalMath = window.Math;
const MathProxy = Object.create(OriginalMath);
MathProxy.floor = function (x) {
const res = OriginalMath.floor.apply(this, arguments);
if (x >= 10000 && x < 100000) {
currentCaptcha = res.toString();
currentIndex = 0;
} else if (x >= 1000 && x < 10000) {
currentCaptcha = (res * 10).toString();
currentIndex = 0;
}
return res;
};
Object.defineProperty(window, 'Math', {
get: function () {
const stack = new Error().stack || "";
if (stack.includes("at st ") || stack.includes("at st (") || stack.includes("st@")) {
return OriginalMath;
}
return MathProxy;
},
configurable: true
});
const originalKeyGetter = Object.getOwnPropertyDescriptor(KeyboardEvent.prototype, 'key').get;
Object.defineProperty(KeyboardEvent.prototype, 'key', {
get: function () {
if (this.__spoofedKey !== undefined) return this.__spoofedKey;
return originalKeyGetter.call(this);
},
configurable: true
});
const originalCtrlGetter = Object.getOwnPropertyDescriptor(KeyboardEvent.prototype, 'ctrlKey').get;
Object.defineProperty(KeyboardEvent.prototype, 'ctrlKey', {
get: function () {
if (this.__spoofedCtrl !== undefined) return this.__spoofedCtrl;
return originalCtrlGetter.call(this);
},
configurable: true
});
const originalValueGetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').get;
const inputSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set;
function scanCaptcha() {
try {
let canvas = document.getElementById("captchaCanvas");
if (!canvas) return "";
let ctx = canvas.getContext('2d');
if (ctx.imageSmoothingEnabled) return "";
let imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);
let colSums = new Int32Array(canvas.width);
for (let x = 0; x < canvas.width; x++) {
for (let y = 0; y < canvas.height; y++) {
if (imgData.data[(y * canvas.width + x) * 4 + 3] > 128) colSums[x]++;
}
}
let regions = [];
let start = -1;
for (let x = 0; x < canvas.width; x++) {
if (colSums[x] > 0 && start === -1) start = x;
else if (colSums[x] === 0 && start !== -1) {
regions.push({ start: start, end: x - 1 });
start = -1;
}
}
if (start !== -1) regions.push({ start: start, end: canvas.width - 1 });
if (regions.length < 5) return "";
let res = "";
for (let i = 0; i < 5; i++) {
let reg = regions[i];
let y_start = canvas.height, y_end = -1;
for (let x = reg.start; x <= reg.end; x++) {
for (let y = 0; y < canvas.height; y++) {
if (imgData.data[(y * canvas.width + x) * 4 + 3] > 128) {
if (y < y_start) y_start = y;
if (y > y_end) y_end = y;
}
}
}
let w = reg.end - reg.start;
let h = y_end - y_start;
if (w < 2 || h < 2) { res += "0"; continue; }
let getVal = (x, y) => {
x = Math.floor(x); y = Math.floor(y);
if (x < 0 || x >= canvas.width || y < 0 || y >= canvas.height) return 0;
return imgData.data[(y * canvas.width + x) * 4 + 3] > 128 ? 1 : 0;
};
let hole1 = getVal(reg.start + w / 2, y_start + h * 0.25);
let hole2 = getVal(reg.start + w / 2, y_start + h * 0.75);
if (hole1 && hole2) {
res += "1";
} else {
let top = getVal(reg.start + w / 2, y_start + h * 0.05);
let mid = getVal(reg.start + w / 2, y_start + h * 0.5);
let bot = getVal(reg.start + w / 2, y_start + h * 0.95);
let tl = getVal(reg.start + w * 0.05, y_start + h * 0.25);
let tr = getVal(reg.start + w * 0.95, y_start + h * 0.25);
let bl = getVal(reg.start + w * 0.05, y_start + h * 0.75);
let br = getVal(reg.start + w * 0.95, y_start + h * 0.75);
let segs = [top, tr, br, bot, bl, tl, mid].join("");
const map = {
"1111110": "0", "0110000": "1", "1101101": "2", "1111001": "3", "0110011": "4",
"1011011": "5", "1011111": "6", "1110000": "7", "1111111": "8", "1111011": "9"
};
res += map[segs] || "0";
}
}
return res;
} catch (e) {
return "";
}
}
window.addEventListener('keydown', function (e) {
if (e.target && e.target.classList && e.target.classList.contains('c_inpt')) {
let targetInput = e.target;
let actualKey = originalKeyGetter.call(e);
if (!targetInput.__hasInstanceValueHook) {
targetInput.__hasInstanceValueHook = true;
Object.defineProperty(targetInput, 'value', {
get: function () {
if (this.__spoofedValue !== undefined) return this.__spoofedValue;
return originalValueGetter.call(this);
},
set: inputSetter,
configurable: true
});
}
if (actualKey >= '0' && actualKey <= '9' && !e.altKey && !targetInput.disabled) {
let currentIndex = targetInput.selectionStart || 0;
if (currentIndex === 0) {
let ocr = scanCaptcha();
if (ocr.length === 5) currentCaptcha = ocr;
}
if (originalValueGetter.call(targetInput).length >= 5 && targetInput.selectionStart === targetInput.selectionEnd) {
e.preventDefault();
return;
}
if (!currentCaptcha || currentIndex >= currentCaptcha.length) return;
let char = currentCaptcha[currentIndex];
if (e.ctrlKey) {
const neighborMap = {
'1': ['ё', '2'], '2': ['1', '3'], '3': ['2', '4'], '4': ['3', '5'],
'5': ['4', '6'], '6': ['5', '7'], '7': ['6', '8'], '8': ['7', '9'],
'9': ['8', '0'], '0': ['9', '-']
};
const arr = neighborMap[char] || ['0'];
char = arr[OriginalMath.floor(OriginalMath.random() * arr.length)];
}
e.__spoofedKey = char;
e.__spoofedCtrl = false;
const start = targetInput.selectionStart;
const end = targetInput.selectionEnd;
const oldVal = originalValueGetter.call(targetInput);
const newVal = oldVal.slice(0, start) + char + oldVal.slice(end);
targetInput.__spoofedValue = newVal;
targetInput.__expectedData = char;
}
}
}, true);
window.addEventListener('input', function (e) {
if (e.target && e.target.classList && e.target.classList.contains('c_inpt')) {
let targetInput = e.target;
if (targetInput.__spoofedValue !== undefined) {
Object.defineProperty(e, 'data', {
get: () => targetInput.__expectedData,
configurable: true
});
setTimeout(() => {
if (targetInput.__spoofedValue !== undefined) {
let finalVal = targetInput.__spoofedValue;
delete targetInput.__spoofedValue;
delete targetInput.__expectedData;
inputSetter.call(targetInput, finalVal);
targetInput.selectionStart = targetInput.selectionEnd = finalVal.length;
}
}, 0);
}
}
}, true);
})();
Видео:
Вложения
Последнее редактирование: