25
26interface fakeLocalStorage {
27 [key: string]: string | Function;
28 setItem: Function;
29}
30
47const fake_window: fakeWindow = {
48 localStorage: {
49 setItem: function(item: string, value: string) {
50 fake_window.localStorage[item] = value;
51 },
83let script_url = "https://rabbitstream.net/v2/embed-4/z1AOmWCJVgcy?z=";
84
85function get(index: number) {
86 return arr[index];
87}
93
94// fix this
95function getMemBuff(): Uint8Array {
96 return memoryBuff = null !== memoryBuff && 0 !== memoryBuff.byteLength
97 ? memoryBuff
100
101const encoder = new TextEncoder();
102const encode = function(text: string, array: Uint8Array) {
103 return encoder.encodeInto(text, array);
104};
105
106function parse(text: string, func: Function, func2: Function) {
107 console.log("parse call: ", text, func, func2);
108 if (void 0 === func2) {
136let arr32: Int32Array | null;
137
138function isNull(test: any) {
139 console.log("is null call: ", null == test);
140 return null == test;
141}
142
143function getArr32() {
144 return arr32 = null !== arr32 && 0 !== arr32.byteLength ? arr32 : new Int32Array(wasm.memory.buffer);
145}
147let pointer = arr.length;
148
149function shift(QP: number) {
150 QP < 132 || (arr[QP] = pointer, pointer = QP);
151}
152
153function shiftGet(QP: number) {
154 console.log("shiftGet call: ", QP);
155 var Qn = get(QP);
162});
163
164function decodeSub(index: number, offset: number) {
165 return index >>>= 0, decoder.decode(getMemBuff().subarray(index, index + offset));
166}
167
168function addToStack(item: any) {
169 pointer === arr.length && arr.push(arr.length + 1);
170 var Qn = pointer;
172}
173
174function args(QP: any, Qn: number, QT: number, func: Function) {
175 const Qx = {
176 "a": QP,
190}
191
192function export3(QP: any, Qn: any) {
193 wasm.__wbindgen_export_3(QP, Qn);
194}
195
196function export4(QP: any, Qn: any) {
197 return shiftGet(wasm.__wbindgen_export_4(QP, Qn));
198}
199
200function export5(QP: any, Qn: any, QT: any) {
201 wasm.__wbindgen_export_5(QP, Qn, addToStack(QT));
202}
203
204function applyToWindow(func: Function, args: ArrayLike<Object>) {
205 console.log("arguments: ", args);
206 try {
211}
212
213function Qj(QP: ArrayLike<number>, Qn: any) {
214 return Qn = Qn(+QP.length, 1) >>> 0, (getMemBuff().set(QP, Qn), size = QP.length, Qn);
215}
216
217async function QN(QP: Response, Qn: WebAssembly.Imports) {
218 let QT: ArrayBuffer, Qt: any;
219 return "function" == typeof Response && QP instanceof Response
220 ? (QT = await QP.arrayBuffer(), Qt = await WebAssembly.instantiate(QT, Qn), Object.assign(Qt, { "bytes": QT }))
221 : (Qt = await WebAssembly.instantiate(QP, Qn)) instanceof WebAssembly.Instance
227}
228
229function initWasm() {
230 const wasmObj = {
231 "wbg": {
232 "__wbindgen_string_get": function(offset: number, index: number) {
233 let str = get(index);
234 let val = parse(str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
236 getArr32()[offset / 4 + 0] = val;
237 },
238 "__wbindgen_object_drop_ref": function(index: number) {
239 shiftGet(index);
240 },
241 "__wbindgen_cb_drop": function(index: number) {
242 let org = shiftGet(index).original;
243 return 1 == org.cnt-- && !(org.a = 0);
244 },
245 "__wbindgen_string_new": function(index: number, offset: number) {
246 console.log("string_new call: ", decodeSub(index, offset));
247 return addToStack(decodeSub(index, offset));
248 },
249 "__wbindgen_is_null": function(index: number) {
250 return null === get(index);
251 },
252 "__wbindgen_is_undefined": function(index: number) {
253 console.log("is_undefined call: ", void 0 === get(index));
254 return void 0 === get(index);
255 },
256 "__wbindgen_boolean_get": function(index: number) {
257 let bool = get(index);
258 return "boolean" == typeof bool ? bool ? 1 : 0 : 2;
259 },
260 "__wbg_instanceof_CanvasRenderingContext2d_4ec30ddd3f29f8f9": function() {
261 return true;
262 },
263 "__wbg_setfillStyle_59f426135f52910f": function() {},
264 "__wbg_setshadowBlur_229c56539d02f401": function() {},
265 "__wbg_setshadowColor_340d5290cdc4ae9d": function() {},
266 "__wbg_setfont_16d6e31e06a420a5": function() {},
267 "__wbg_settextBaseline_c3266d3bd4a6695c": function() {},
268 "__wbg_drawImage_cb13768a1bdc04bd": function() {},
269 "__wbg_getImageData_66269d289f37d3c7": function() {
270 return applyToWindow(function() {
271 console.log("get image data call: ", image_data);
272 return addToStack(image_data);
273 }, arguments);
274 },
275 "__wbg_rect_2fa1df87ef638738": function() {},
276 "__wbg_fillRect_4dd28e628381d240": function() {},
277 "__wbg_fillText_07e5da9e41652f20": function() {},
278 "__wbg_setProperty_5144ddce66bbde41": function() {},
279 "__wbg_createElement_03cf347ddad1c8c0": function() {
280 return applyToWindow(function(index, decodeIndex: number, decodeIndexOffset: number) {
281 console.log("createElement call: ", index);
282 return addToStack(canvas);
283 }, arguments);
284 },
285 "__wbg_querySelector_118a0639aa1f51cd": function() {
286 return applyToWindow(function(index: number, decodeIndex: number, decodeOffset: number) {
287 // let item = get(index).querySelector(decodeSub(decodeIndex, decodeOffset));
288 // return isNull(item) ? 0 : addToStack(item);
291 }, arguments);
292 },
293 "__wbg_querySelectorAll_50c79cd4f7573825": function() {
294 return applyToWindow(function() {
295 return addToStack(nodeList);
296 }, arguments);
297 },
298 "__wbg_getAttribute_706ae88bd37410fa": function(
299 offset: number,
300 index: number,
310 getArr32()[offset / 4 + 0] = todo;
311 },
312 "__wbg_target_6795373f170fd786": function(index: number) {
313 let target = get(index).target;
314 return isNull(target) ? 0 : addToStack(target);
315 },
316 "__wbg_addEventListener_f984e99465a6a7f4": function() {},
317 "__wbg_instanceof_HtmlCanvasElement_1e81f71f630e46bc": function() {
318 return true;
319 },
320 "__wbg_setwidth_233645b297bb3318": function(index: number, set: number) {
321 get(index).width = set >>> 0;
322 },
323 "__wbg_setheight_fcb491cf54e3527c": function(index: number, set: number) {
324 get(index).height = set >>> 0;
325 },
326 "__wbg_getContext_dfc91ab0837db1d1": function() {
327 return applyToWindow(function(index: number) {
328 console.log("getContext call: ");
329 return addToStack(get(index).context2d);
330 }, arguments);
331 },
332 "__wbg_toDataURL_97b108dd1a4b7454": function() {
333 return applyToWindow(function(offset: number) {
334 let _dataUrl = parse(dataURL, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
335 getArr32()[offset / 4 + 1] = size;
337 }, arguments);
338 },
339 "__wbg_instanceof_HtmlDocument_1100f8a983ca79f9": function() {
340 return true;
341 },
342 "__wbg_cookie_0ad89e781441fb95": function() {
343 return applyToWindow(function(offset: number, index: number) {
344 let _cookie = parse(get(index).cookie, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
345 console.log("cookie: ", _cookie);
348 }, arguments);
349 },
350 "__wbg_style_ca229e3326b3c3fb": function(index: number) {
351 console.log("style call: ", get(index).style);
352 addToStack(get(index).style);
353 },
354 "__wbg_instanceof_HtmlImageElement_9c82d4e3651a8533": function() {
355 return true;
356 },
357 "__wbg_src_87a0e38af6229364": function(offset: number, index: number) {
358 let _src = parse(get(index).src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
359 getArr32()[offset / 4 + 1] = size;
360 getArr32()[offset / 4 + 0] = _src;
361 },
362 "__wbg_width_e1a38bdd483e1283": function(index: number) {
363 return get(index).width;
364 },
365 "__wbg_height_e4cc2294187313c9": function(index: number) {
366 return get(index).height;
367 },
368 "__wbg_complete_1162c2697406af11": function(index: number) {
369 return get(index).complete;
370 },
371 "__wbg_data_d34dc554f90b8652": function(offset: number, index: number) {
372 console.log("data call: ", get(index).data);
373 var _data = Qj(get(index).data, wasm.__wbindgen_export_0);
375 getArr32()[offset / 4 + 0] = _data;
376 },
377 "__wbg_origin_305402044aa148ce": function() {
378 return applyToWindow(function(offset: number, index: number) {
379 let _origin = parse(get(index).origin, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
380 getArr32()[offset / 4 + 1] = size;
382 }, arguments);
383 },
384 "__wbg_length_8a9352f7b7360c37": function(index: number) {
385 return get(index).length;
386 },
387 "__wbg_get_c30ae0782d86747f": function(index: number) {
388 let _image = get(index).image;
389 return isNull(_image) ? 0 : addToStack(_image);
390 },
391 "__wbg_timeOrigin_f462952854d802ec": function(index: number) {
392 return get(index).timeOrigin;
393 },
394 "__wbg_instanceof_Window_cee7a886d55e7df5": function() {
395 return true;
396 },
397 "__wbg_document_eb7fd66bde3ee213": function(index: number) {
398 let _document = get(index).document;
399 console.log("document call: ", _document);
400 return isNull(_document) ? 0 : addToStack(_document);
401 },
402 "__wbg_location_b17760ac7977a47a": function(index: number) {
403 return addToStack(get(index).location);
404 },
405 "__wbg_performance_4ca1873776fdb3d2": function(index: number) {
406 let _performance = get(index).performance;
407 return isNull(_performance) ? 0 : addToStack(_performance);
408 },
409 "__wbg_origin_e1f8acdeb3a39a2b": function(offset: number, index: number) {
410 let _origin = parse(get(index).origin, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
411 getArr32()[offset / 4 + 1] = size;
412 getArr32()[offset / 4 + 0] = _origin;
413 },
414 "__wbg_get_8986951b1ee310e0": function(index: number) {
415 let _xrax = get(index).xrax;
416 return isNull(_xrax) ? 0 : addToStack(_xrax);
417 },
418 "__wbg_setTimeout_6ed7182ebad5d297": function() {
419 return applyToWindow(function() {
420 return 10;
421 }, arguments);
422 },
423 "__wbg_self_05040bd9523805b9": function() {
424 return applyToWindow(function() {
425 return addToStack(fake_window);
426 }, arguments);
427 },
428 "__wbg_window_adc720039f2cb14f": function() {
429 return applyToWindow(function() {
430 return addToStack(fake_window);
431 }, arguments);
432 },
433 "__wbg_globalThis_622105db80c1457d": function() {
434 return applyToWindow(function() {
435 return addToStack(fake_window);
436 }, arguments);
437 },
438 "__wbg_global_f56b013ed9bcf359": function() {
439 return applyToWindow(function() {
440 return addToStack(fake_window);
441 }, arguments);
442 },
443 "__wbg_newnoargs_cfecb3965268594c": function(index: number, offset: number) {
444 return addToStack(new Function(decodeSub(index, offset)));
445 },
446 "__wbindgen_object_clone_ref": function(index: number) {
447 return addToStack(get(index));
448 },
449 "__wbg_eval_c824e170787ad184": function() {
450 return applyToWindow(function(index: number, offset: number) {
451 const payload = decodeSub(index, offset);
452 const match = payload.match(/^(window\.\w+\.\w+)(?:\('([^']*)',\s'([^']*)'\))?$/);
453 const spoofFunctions: { [key: string]: Function } = {
454 "window.navigator.webdriver": () => fake_window.navigator.webdriver,
455 "window.navigator.userAgent": () => fake_window.navigator.userAgent,
459 if (match) {
460 const [_, funcKey, key, value] = match;
461 if (funcKey && spoofFunctions[funcKey]) {
462 if (key && value) {
463 (spoofFunctions[funcKey] as (key: string, value: string) => void)(key, value);
464 } else {
465 const result = (spoofFunctions[funcKey] as () => any)();
466 return addToStack(result);
467 }
468 } else {
469 console.error(`Function for ${funcKey} not found in spoofFunctions.`);
470 }
471 } else {
476 }, arguments);
477 },
478 "__wbg_call_3f093dd26d5569f8": function() {
479 return applyToWindow(function(index: number, index2: number) {
480 return addToStack(get(index).call(get(index2)));
481 }, arguments);
482 },
483 "__wbg_set_961700853a212a39": function() {
484 return applyToWindow(function(index: number, index2: number, index3: number) {
485 console.log("set96: ", get(index), get(index2), get(index3));
486 return Reflect.set(get(index), get(index2), get(index3));
487 }, arguments);
488 },
489 "__wbg_buffer_b914fb8b50ebbc3e": function(index: number) {
490 return addToStack(get(index).buffer);
491 },
492 "__wbg_newwithbyteoffsetandlength_0de9ee56e9f6ee6e": function(index: number, val: number, val2: number) {
493 return addToStack(new Uint8Array(get(index), val >>> 0, val2 >>> 0));
494 },
495 "__wbg_new_b1f2d6842d615181": function(index: number) {
496 return addToStack(new Uint8Array(get(index)));
497 },
498 "__wbg_buffer_67e624f5a0ab2319": function(index: number) {
499 return addToStack(get(index).buffer);
500 },
501 "__wbg_length_21c4b0ae73cba59d": function(index: number) {
502 return get(index).length;
503 },
504 "__wbg_set_7d988c98e6ced92d": function(index: number, index2: number, val: number) {
505 get(index).set(get(index2), val >>> 0);
506 },
507 "__wbindgen_debug_string": function() {},
508 "__wbindgen_throw": function(index: number, offset: number) {
509 throw new Error(decodeSub(index, offset));
510 },
511 "__wbindgen_memory": function() {
512 return addToStack(wasm.memory);
513 },
514 "__wbindgen_closure_wrapper93": function(Qn: any, QT: any) {
515 return addToStack(args(Qn, QT, 2, export3));
516 },
517 "__wbindgen_closure_wrapper95": function(Qn: any, QT: any) {
518 return addToStack(args(Qn, QT, 2, export4));
519 },
520 "__wbindgen_closure_wrapper97": function(Qn: any, QT: any) {
521 let test = addToStack(args(Qn, QT, 2, export4));
522 return test;
523 },
524 "__wbindgen_closure_wrapper99": function(Qn: any, QT: any) {
525 return addToStack(args(Qn, QT, 2, export5));
526 },
527 "__wbindgen_closure_wrapper101": function(Qn: any, QT: any) {
528 return;
529 },
533}
534
535function assignWasm(resp: any) {
536 wasm = resp.exports;
537 arr32 = null, memoryBuff = null, wasm;
538}
539
540function QZ(QP: any) {
541 let Qn: any;
542 return void 0 !== wasm
548
549// todo!
550async function loadWasm(url: any) {
551 let mod: any, buffer: any;
552 return void 0 !== wasm ? wasm : (mod = initWasm(),
561
562const greetLoader = {
563 greet: function() {
564 wasm.greet();
565 },
587};
588
589function r(z: number) {
590 return [
591 (4278190080 & z) >> 24,