├── README.md ├── node_linux_64.7z ├── node_mac.7z └── node_win_64.7z /README.md: -------------------------------------------------------------------------------- 1 | ### nodeV8 的使用 (去除了node的vm所有检测点,且可调试) 2 | 3 | 版本18.2.0 4 | 5 | ```javascript 6 | // 导入关键包 7 | const cbb = require("cbb"); 8 | 9 | // 启动并执行v8, 并把node中的console导入了 10 | var d = cbb.cbbnative.startv8("cyData.console.log(!new function(){eval(\"this.a=1\")}().a)",{console:console}) 11 | 12 | console.log(d) 13 | ``` 14 | 15 | vm2 检测点 16 | 17 | ``console.log(!new function(){eval("this.a=1")}().a)`` 18 | 19 | vm检测点 20 | 21 | ``console.log(this.constructor.constructor('return process.env')())`` 22 | 23 | ``"a = {}; a['b'] = ()=>{}; this.__proto__ = a; console.log(this.hasOwnProperty('b'))"`` 24 | 25 | 26 | 上面检测点都可过 27 | 28 | 29 | ## 新加功能 30 | 31 | 1.强行执行异步 32 | ```javascript 33 | const cbb = require("cbb") 34 | 35 | setTimeout(()=>{ 36 | console.log(1) 37 | },0) 38 | 39 | // 强制执行一轮循环 40 | cbb.cbbnative.cbbasyncone() 41 | // 或者 42 | // cbb.cbbnative.asyncone() 43 | console.log(2) 44 | // 输出 45 | // 1 46 | // 2 47 | 48 | ``` 49 | 50 | 2.把普通函数变native函数 51 | 52 | ```javascript 53 | const cbb = require("cbb") 54 | a ={} 55 | b = function (){ 56 | console.log("is b"); 57 | } 58 | // 需要保存在什么对象 需要native化的函数 别名 是否删除多余属性 length的长度 是否为不可枚举 59 | cbb.cbbnative.setNative(a, b, 'isb', false, 0, 1); 60 | 61 | console.log(a.isb.toString()) 62 | // 输出 function isb() { [native code] } 63 | 64 | ``` 65 | 66 | 3.document.all解决 67 | ```javascript 68 | const cbb = require("cbb") 69 | a = {}; 70 | cbb.cbbnative.undfObject(a); 71 | document_all = new a.ldObj(); 72 | console.log(typeof document_all); 73 | // 输出 undefined 74 | ``` 75 | 76 | 4.强制删除 77 | ```javascript 78 | const cbb = require("cbb") 79 | d = {"a":function (){}} 80 | cbb.cbbnative.delete(d,"a"); 81 | console.log(d.a); 82 | // 输出 undefined 83 | 84 | ``` 85 | 86 | 5.堆栈调用拦截 87 | ```javascript 88 | cbbh = {} 89 | cbbh.cbbHookStack=function (){ 90 | console.log("拦截:",arguments[0]); 91 | return arguments[0]; 92 | } 93 | 94 | try{ 95 | dghasjd.dashdjkas 96 | }catch (e){ 97 | console.log(e) 98 | } 99 | 100 | ``` 101 | 102 | 103 | 104 | 作者: 陈不不 105 | 106 | 感谢 零点和海绵的帮助 107 | 108 | 邮箱:2833844911@qq.com 109 | 110 | ### 欢迎加入星球哦 111 | 112 | ``星球连接https://t.zsxq.com/06bIUvBEM`` 113 | -------------------------------------------------------------------------------- /node_linux_64.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2833844911/nodeV8/1474f3837fd6f25e058c028a1fedb0dc0ca32ffa/node_linux_64.7z -------------------------------------------------------------------------------- /node_mac.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2833844911/nodeV8/1474f3837fd6f25e058c028a1fedb0dc0ca32ffa/node_mac.7z -------------------------------------------------------------------------------- /node_win_64.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2833844911/nodeV8/1474f3837fd6f25e058c028a1fedb0dc0ca32ffa/node_win_64.7z --------------------------------------------------------------------------------