SHARE
TWEET

testing

Kep13 Dec 14th, 2019 (edited) 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let shared_state = new Map(Object.entries({functions_to_hide: new WeakMap(), strings_to_hide: [], hidden_globals: [], init: false}));
  2.  
  3. let conceal_function = function(original_Function, hook_Function) {
  4.     shared_state.get('functions_to_hide').set(hook_Function, original_Function);
  5. };
  6.  
  7. let conceal_string = function(original_string, hook_string) {
  8.     shared_state.get('strings_to_hide').push({from: new RegExp(hook_string.replace(/([\[|\]|\(|\)|\*|\\|\.|\+])/g,'\\$1'), 'g'), to: original_string});
  9. };
  10.  
  11. //
  12.  
  13. var distance, cnBSeen, canSee, pchObjc, objInstances, overhax, inputs, getWorldPosition;
  14. console.json = object => console.log(JSON.stringify(object, undefined, 2));
  15. const defined = object => typeof object !== "undefined";
  16.  
  17. const original_encode = TextEncoder.prototype.encode;
  18. let hook_encode = new Proxy(original_encode, {
  19.     apply: function(target, _this, _arguments) {
  20.         let game = false;
  21.         try {
  22.             if (_arguments[0].length > 1000) {
  23.                 cnBSeen = _arguments[0].match(/this\['recon']=!0x1,this\['(\w+)']=!0x1/)[1];
  24.                 //canSee = _arguments[0].match(/,this\['(\w+)'\]=function\(\w+,\w+,\w+,\w+,\w+\){if\(!\w+\)return!\w+;/)[1];
  25.                 pchObjc = _arguments[0].match(/\(\w+,\w+,\w+\),this\['(\w+)'\]=new \w+\['\w+'\]\(\)/)[1];
  26.                 objInstances = _arguments[0].match(/\[\w+\]\['\w+'\]=!\w+,this\['\w+'\]\[\w+\]\['\w+'\]&&\(this\['\w+'\]\[\w+\]\['(\w+)'\]\['\w+'\]=!\w+/)[1];
  27.                 inputs = _arguments[0].match(/\(\w+,\w*1\)\),\w+\['\w+'\]=\w*0,\w+\['\w+'\]=\w*0,!(\w+)\['\w+'\]&&\w+\['\w+'\]\['push'\]\((\w+)\),(\w+)\['\w+'\]/)[2];
  28.                 getWorldPosition = _arguments[0].match(/\['camera']\['(\w+)']\(\);if/)[1]
  29.  
  30.                 game = true;
  31.             }
  32.  
  33.         } catch (e) {
  34.             // modify stack trace to hide proxy
  35.             e.stack = e.stack.replace(/\n.*Object\.apply \(<.*/, '');
  36.             throw e;
  37.         }
  38.         if (game) TextEncoder.prototype.encode = original_encode;
  39.  
  40.         return Function.prototype.apply.apply(target, [_this, _arguments]);
  41.     }
  42. }); TextEncoder.prototype.encode = hook_encode;
  43. conceal_function(original_encode, hook_encode);
  44.  
  45. let render = function() {
  46.  
  47.     //DEFINES
  48.     const args = arguments.callee.caller.caller.arguments;
  49.     const me = args[3];
  50.     if (!me) return;
  51.     const scale = args[0];
  52.     const world = args[1];
  53.     const renderer = args[2];
  54.     const scale2 = args[4];
  55.     const canvas = document.getElementById('game-overlay');
  56.     const ctx = canvas.getContext("2d");
  57.  
  58.     console.dir(window)
  59.     let players = world.players.list;
  60.     let entities = players.filter(x => { return x.active && !x[overhax] });
  61.  
  62.  
  63.      //FUNCTIONS
  64.  
  65.     let get = (entity, string) => {
  66.         if (defined(entity) && entity && entity.active) {
  67.             switch (string) {
  68.                 case 'objInstances': return entity[objInstances];
  69.                 case 'isFriendly': return (me && me.team ? me.team : me.spectating ? 0x1 : 0x0) == entity.team;
  70.             }
  71.         }
  72.         return null;
  73.     }
  74.  
  75.     let getTarget = () => {
  76.         if (!defined (distance)) distance = Infinity;
  77.         for (const entity of players.filter(x => { return x.active && !get(x,"overhax") && get(x,"inView") && !get(x,"isFriendly") && x.health > 0})) {
  78.             if (defined(entity[objInstances])) {
  79.                 const entityPos = entity[objInstances].position;
  80.                 if (renderer.frustum.containsPoint(entityPos)) {
  81.                     const dist = entityPos.distanceTo(me);
  82.                     if (dist <= distance) {
  83.                         me.distance = dist;
  84.                         return entity;
  85.                     }
  86.                 }
  87.             }
  88.         }
  89.         distance = Infinity;
  90.         return null;
  91.     }
  92.  
  93.     let world2Screen = (camera, position) => {
  94.         let pos = position.clone();
  95.         pos.project(camera);
  96.         pos.x = (pos.x + 1) / 2;
  97.         pos.y = (-pos.y + 1) / 2;
  98.         return pos;
  99.     }
  100.  
  101.     let rect = (x, y, ox, oy, w, h, color, fill) => {
  102.         ctx.save();
  103.         ctx.beginPath();
  104.         fill ? ctx.fillStyle = color : ctx.strokeStyle = color;
  105.         ctx.rect(ox, oy, w, h);
  106.         fill ? ctx.fill() : ctx.stroke();
  107.         ctx.closePath();
  108.         ctx.restore();
  109.     }
  110.  
  111.     //ESP / Chams
  112.     entities.map((entity, index, array)=> {
  113.         if (defined(entity[objInstances])) {
  114.  
  115.                 //Chams
  116.                 entity[cnBSeen] = true;
  117.                 for (let i = 0; i < entity[objInstances].children.length; i++) {
  118.                     const object3d = entity[objInstances].children[i];
  119.                     for (let j = 0; j < object3d.children.length; j++) {
  120.                         const mesh = object3d.children[j];
  121.                         /*/if (mesh && mesh.type == "Mesh") {
  122.                             const material = mesh.material;
  123.                             material.depthTest = false;
  124.                             material.fog = false;
  125.                             material.emissive.g = 1;
  126.                             material.colorWrite = true;
  127.                             material.transparent = true;
  128.                             material.opacity = 1.0;
  129.                         }/*/ // Delete Both /*/ To get charms aswell
  130.                     }
  131.                 }
  132.             }
  133.         //}
  134.     });
  135. };
  136. const clearRect = CanvasRenderingContext2D.prototype.clearRect;
  137. const original_clearRect = CanvasRenderingContext2D.prototype.scale;
  138. let hook_clearRect = new Proxy(original_clearRect, {
  139.     apply: function(target, _this, _arguments) {
  140.         try {
  141.             var ret = Function.prototype.apply.apply(target, [_this, _arguments]);
  142.         } catch (e) {
  143.             // modify stack trace to hide proxy
  144.             e.stack = e.stack.replace(/\n.*Object\.apply \(<.*/, '');
  145.             throw e;
  146.         }
  147.  
  148.         render(_this);
  149.  
  150.         return ret;
  151.     }
  152. }); CanvasRenderingContext2D.prototype.scale = hook_clearRect;
  153. conceal_function(original_clearRect, hook_clearRect);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top