Skip to main content

Module splice

Module splice 

Source
Expand description

vQ(salt, payload, offsets) โ€” interleave salt characters into the base64 payload at byte positions produced by vN. Final step of the eT15wiaE sensor encryption stack.

JS reference (un-flattened from the switch/with/case VM at line 6065 of the captured init.js):

function vQ(salt, payload, offsets) {
  const bf = salt.split('');
  let bd = '', be = 0;
  for (let bg = 0; bg < salt.length; bg++) {
    bd += payload.substring(be, offsets[bg] - bg - 1) + bf[bg];
    be = offsets[bg] - bg - 1;
  }
  bd += payload.substring(be);
  return bd;
}

Functionsยง

v_q
Returns the spliced payload. Matches the JS String.prototype.substring semantics that the reference implementation relies on: arguments less than 0 become 0, greater than len become len, and if start > end they are swapped before slicing.