今天做一个纯分享,如何快速找到自己逆向过程中缺失的环境,:
废话不多说啊,直接上代码
function setProxy(proxyObjs) {
for (let i = 0; i < proxyObjs.length; i++) {
const handler = `{
get: function(target, property,receiver){
if (property!="Math" && property!="isNaN"){
if(target[property] && typeof target[property] != "string" && Object.keys(target[property]).length>10){
}else{
console.log("方法:","get ","对象:","${proxyObjs[i]}"," 属性:",property," 属性类型:",typeof property," 属性值:",target[property]);
}
}
return target[property];
},
set: function(target,property,value,receiver){
console.log("方法:","set ","对象:","${proxyObjs[i]}"," 属性:",property," 属性类型:",typeof target[property]," 属性值:",value);
return Reflect.set(...arguments);
}
}`;
eval(`try {
${proxyObjs[i]};
${proxyObjs[i]}=new Proxy(${proxyObjs[i]},${handler});
}catch(e){
${proxyObjs[i]}={};
${proxyObjs[i]}=new Proxy(${proxyObjs[i]},${handler});
}`);
}
}
setProxy(['wx','require',''])
直接复制即可使用简单方便。