Giter Site home page Giter Site logo

nodev8's Introduction

nodeV8 的使用 (去除了node的vm所有检测点,且可调试)

版本18.2.0

// 导入关键包
const cbb = require("cbb");

// 启动并执行v8, 并把node中的console导入了
var d = cbb.cbbnative.startv8("cyData.console.log(!new function(){eval(\"this.a=1\")}().a)",{console:console})

console.log(d)

vm2 检测点

console.log(!new function(){eval("this.a=1")}().a)

vm检测点

console.log(this.constructor.constructor('return process.env')())

"a = {}; a['b'] = ()=>{}; this.__proto__ = a; console.log(this.hasOwnProperty('b'))"

上面检测点都可过

新加功能

1.强行执行异步

const cbb = require("cbb")

setTimeout(()=>{
    console.log(1)
},0)

// 强制执行一轮循环
cbb.cbbnative.cbbasyncone()
// 或者
// cbb.cbbnative.asyncone()
console.log(2)
// 输出
// 1
// 2

2.把普通函数变native函数

const cbb = require("cbb")
a ={}
b = function (){
    console.log("is b");
}
//                      需要保存在什么对象  需要native化的函数   别名   是否删除多余属性   length的长度    是否为不可枚举
cbb.cbbnative.setNative(a,               b,                'isb', false,           0,            1);

console.log(a.isb.toString())
// 输出 function isb() { [native code] }

3.document.all解决

const cbb = require("cbb")
a = {};
cbb.cbbnative.undfObject(a);
document_all = new a.ldObj();
console.log(typeof document_all);
// 输出 undefined

4.强制删除

const cbb = require("cbb")
d = {"a":function (){}}
cbb.cbbnative.delete(d,"a");
console.log(d.a);
// 输出 undefined

5.堆栈调用拦截

cbbh = {}
cbbh.cbbHookStack=function (){
    console.log("拦截:",arguments[0]);
    return arguments[0];
}

try{
    dghasjd.dashdjkas
}catch (e){
    console.log(e)
}

作者: 陈不不

感谢 零点和海绵的帮助

邮箱:[email protected]

欢迎加入星球哦

星球连接https://t.zsxq.com/06bIUvBEM

nodev8's People

Contributors

2833844911 avatar

Stargazers

霍昕 avatar 今晚打打 avatar  avatar  avatar  avatar OSin avatar Chen avatar boda avatar  avatar  avatar  avatar  avatar  avatar miffy avatar Fallen avatar meao avatar 橙味益达 avatar prince avatar  avatar Heqiang avatar Kingking avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.