mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-19 18:24:51 +08:00
zy-补环境框架-实现-window补环境
This commit is contained in:
parent
81b0f74619
commit
cfed78a606
38
志远js逆向学习/zy-补环境框架-实现-window补环境/CatVm2/browser/document.js
Normal file
38
志远js逆向学习/zy-补环境框架-实现-window补环境/CatVm2/browser/document.js
Normal file
@ -0,0 +1,38 @@
|
||||
const Document =function Document()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
catvm.safefunction(Document);
|
||||
|
||||
Object.defineProperties(Document.prototype,{
|
||||
[Symbol.toStringTag]:{
|
||||
value:'Document',
|
||||
configurable:true,
|
||||
}
|
||||
})
|
||||
|
||||
document = {}
|
||||
document.__proto__ = Document.prototype
|
||||
document.cookie = ''
|
||||
document.referrer = location.href || ''
|
||||
document.getElementById = function getElementById(id){
|
||||
return null
|
||||
}
|
||||
catvm.safefunction(document.getElementById)
|
||||
document.addEventListener = function addEventListener(type,listener,useCapture){
|
||||
|
||||
}
|
||||
catvm.safefunction(document.addEventListener)
|
||||
|
||||
document.createElement = function createElement(tagName){
|
||||
let tagname = tagName.toLowerCase() + ''
|
||||
if(catvm.memory.htmlElements[tagname] == undefined){
|
||||
debugger
|
||||
}
|
||||
return catvm.proxy(catvm.memory.htmlElements[tagname]())
|
||||
|
||||
}
|
||||
catvm.safefunction(document.createElement)
|
||||
|
||||
document = catvm.proxy(document)
|
Loading…
x
Reference in New Issue
Block a user