关于逆向工程:JS-逆向-03

hook eval && bypass native code check
return “function eval() { [native code] }”

经典hook

var a=eval+""
var _eval=eval
eval=function(arg){
    console.log(arg)
    return _eval(arg)
}
eval.toString=function(){return "function eval() { [native code] }"}
var _old=Function.prototype.toString.call;
console.log(_old);
Function.prototype.toString.call=function(arg){
    if(arg==eval){
        return "function eval() { [native code] }"
    }
    return _old.call(this,arg);

}
// console.log(Function.prototype.toString.call(eval))
console.log(Function.prototype.toString.call(RegExp))

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理