Created
August 9, 2024 09:06
-
-
Save LuanRT/5792d7e9b1d74210362530058151762e to your computer and use it in GitHub Desktop.
Loads a program into botguard and returns the function needed to generate a PoToken.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ej = function () { | |
var a = this; | |
this.promise = new Promise(function (b, c) { | |
a.resolve = b; | |
a.reject = c; | |
}); | |
}; | |
var baa = function (a) { | |
var b = 0; | |
return function () { | |
return b < a.length ? { | |
done: false, | |
value: a[b++] | |
} : { | |
done: true | |
}; | |
}; | |
}; | |
var w = function (a) { | |
var b = typeof Symbol !== "undefined" && Symbol.iterator && a[Symbol.iterator]; | |
if (b) | |
return b.call(a); | |
if (typeof a.length === "number") | |
return { | |
next: baa(a) | |
}; | |
throw Error(String(a) + " is not an iterable or ArrayLike"); | |
}; | |
async function initBg(program) { | |
let C; | |
let BC; | |
let d = { | |
j: 0, | |
Uf: { | |
nG: function (p, q) { | |
// Never gets called. Not sure what it does. | |
console.info("Hm?", p, q); | |
} | |
} | |
}; | |
function b(p, q, r, t) { | |
Promise.resolve().then(function () { | |
// Some of these are used to create att tokens for the stats endpoint. Only E7 is used for the potoken. | |
m.resolve({ | |
E7: p, | |
Aea: q, | |
cda: r, | |
Xma: t | |
}); | |
}); | |
} | |
function c(p, q, r, t) { | |
var u = "k"; | |
q ? u = "h" : r && (u = "u"); | |
u !== "k" ? t !== 0 && d.Uf.nG(u, p) : d.j <= 0 ? (d.Uf.nG(u, p), | |
d.j = Math.floor(Math.random() * 200)) : d.j--; | |
} | |
var m = new ej(); | |
const B = m.promise; | |
const j = Math.floor(Math.random() * 200); | |
try { | |
C = w((0, trayride.a)(program, b, true, undefined, c)).next().value; | |
BC = m.promise.then(function () { }); | |
} catch (p) { | |
console.log(p); | |
} | |
console.log('Botguard init done', C); | |
let data = { | |
zl: undefined, | |
eU: undefined, | |
e4: [], // the potoken function is added to this array | |
hU: undefined | |
}; | |
let e4 = []; | |
const bgF1Res = B.then(function (l) { | |
var d = l.E7; | |
return new Promise(function (resolve) { | |
d(function (h) { | |
// h is GenerateTI's payload token | |
resolve(h); | |
}, [data.zl, data.eU, e4, data.hU]); | |
}); | |
}); | |
return { bgF1Res, e4, B, BC }; | |
} | |
const bg = initBg("yourvalidprogramhere"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment