不修改原有函数代码,输出新函数的功能,新函数覆盖原函数
//定义函数
function xxx(){
console.log("11111111")
}
//保存原函数功能
var xxx_=xxx;
//新函数
xxx = function(){
console.log("22222222")
};
//执行就函数将会输出 22222222
xxx();
//执行xxx_将会输出11111111
xxx_();
hook windows alert 方法
alert功能截图
hook后