diff --git a/志远js逆向学习/zy-补环境框架-实现-window补环境/CatVm2/browser/document.js b/志远js逆向学习/zy-补环境框架-实现-window补环境/CatVm2/browser/document.js new file mode 100644 index 0000000..3e8589a --- /dev/null +++ b/志远js逆向学习/zy-补环境框架-实现-window补环境/CatVm2/browser/document.js @@ -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) \ No newline at end of file