Commit 2e2c8da8 authored by wangmingming's avatar wangmingming

7777

parent 954d1d03
......@@ -27,6 +27,7 @@
"http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0",
"is-potential-custom-element-name": "^1.0.1",
"isolated-vm": "^4.6.0",
"nwsapi": "^2.2.0",
"parse5": "6.0.1",
"saxes": "^5.0.1",
......@@ -223,6 +224,25 @@
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/bezier-js": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/bezier-js/-/bezier-js-6.1.4.tgz",
......@@ -232,6 +252,16 @@
"url": "https://github.com/Pomax/bezierjs/blob/master/FUNDING.md"
}
},
"node_modules/bl": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
"dependencies": {
"buffer": "^5.5.0",
"inherits": "^2.0.4",
"readable-stream": "^3.4.0"
}
},
"node_modules/body-parser": {
"version": "1.20.1",
"resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-1.20.1.tgz",
......@@ -286,6 +316,29 @@
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
},
"node_modules/buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
},
"node_modules/bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.1.2.tgz",
......@@ -496,6 +549,14 @@
"node": ">=8"
}
},
"node_modules/deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
......@@ -587,6 +648,14 @@
"node": ">= 0.8"
}
},
"node_modules/end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dependencies": {
"once": "^1.4.0"
}
},
"node_modules/escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.1.1.tgz",
......@@ -656,6 +725,14 @@
"node": ">= 0.6"
}
},
"node_modules/expand-template": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
"integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",
"engines": {
"node": ">=6"
}
},
"node_modules/express": {
"version": "4.18.2",
"resolved": "https://registry.npmmirror.com/express/-/express-4.18.2.tgz",
......@@ -756,6 +833,11 @@
"node": ">= 0.6"
}
},
"node_modules/fs-constants": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
},
"node_modules/fs-minipass": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
......@@ -836,6 +918,11 @@
"bezier-js": "^6.1.3"
}
},
"node_modules/github-from-package": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
},
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
......@@ -1005,6 +1092,25 @@
"node": ">=0.10.0"
}
},
"node_modules/ieee754": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
......@@ -1019,6 +1125,11 @@
"resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/ini": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
},
"node_modules/ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
......@@ -1048,6 +1159,18 @@
"resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
"integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ=="
},
"node_modules/isolated-vm": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/isolated-vm/-/isolated-vm-4.6.0.tgz",
"integrity": "sha512-MEnfC/54q5PED3VJ9UJYJPOlU6mYFHS3ivR9E8yeNNBEFRFUNBnY0xO4Rj3D/SOtFKPNmsQp9NWUYSKZqAoZiA==",
"hasInstallScript": true,
"dependencies": {
"prebuild-install": "^7.1.1"
},
"engines": {
"node": ">=16.0.0"
}
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmmirror.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
......@@ -1159,6 +1282,14 @@
"node": "*"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/minipass": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
......@@ -1201,6 +1332,11 @@
"node": ">=10"
}
},
"node_modules/mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
},
"node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz",
......@@ -1211,6 +1347,11 @@
"resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz",
"integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ=="
},
"node_modules/napi-build-utils": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
"integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
},
"node_modules/negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-0.6.3.tgz",
......@@ -1219,6 +1360,17 @@
"node": ">= 0.6"
}
},
"node_modules/node-abi": {
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz",
"integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==",
"dependencies": {
"semver": "^7.3.5"
},
"engines": {
"node": ">=10"
}
},
"node_modules/node-fetch": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz",
......@@ -1370,6 +1522,80 @@
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
},
"node_modules/prebuild-install": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz",
"integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==",
"dependencies": {
"detect-libc": "^2.0.0",
"expand-template": "^2.0.3",
"github-from-package": "0.0.0",
"minimist": "^1.2.3",
"mkdirp-classic": "^0.5.3",
"napi-build-utils": "^1.0.1",
"node-abi": "^3.3.0",
"pump": "^3.0.0",
"rc": "^1.2.7",
"simple-get": "^4.0.0",
"tar-fs": "^2.0.0",
"tunnel-agent": "^0.6.0"
},
"bin": {
"prebuild-install": "bin.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/prebuild-install/node_modules/decompress-response": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
"integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
"dependencies": {
"mimic-response": "^3.1.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/prebuild-install/node_modules/mimic-response": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/prebuild-install/node_modules/simple-get": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
"integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"dependencies": {
"decompress-response": "^6.0.0",
"once": "^1.3.1",
"simple-concat": "^1.0.0"
}
},
"node_modules/proxy-addr": {
"version": "2.0.7",
"resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz",
......@@ -1387,6 +1613,15 @@
"resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag=="
},
"node_modules/pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dependencies": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"node_modules/punycode": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
......@@ -1433,6 +1668,20 @@
"node": ">= 0.8"
}
},
"node_modules/rc": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
"dependencies": {
"deep-extend": "^0.6.0",
"ini": "~1.3.0",
"minimist": "^1.2.0",
"strip-json-comments": "~2.0.1"
},
"bin": {
"rc": "cli.js"
}
},
"node_modules/readable-stream": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
......@@ -1645,6 +1894,14 @@
"node": ">=8"
}
},
"node_modules/strip-json-comments": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
"integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/symbol-tree": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
......@@ -1666,6 +1923,37 @@
"node": ">=10"
}
},
"node_modules/tar-fs": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
"dependencies": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.1.4"
}
},
"node_modules/tar-fs/node_modules/chownr": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
},
"node_modules/tar-stream": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
"dependencies": {
"bl": "^4.0.3",
"end-of-stream": "^1.4.1",
"fs-constants": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^3.1.1"
},
"engines": {
"node": ">=6"
}
},
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",
......@@ -1704,6 +1992,17 @@
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.6.1.tgz",
"integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig=="
},
"node_modules/tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
"dependencies": {
"safe-buffer": "^5.0.1"
},
"engines": {
"node": "*"
}
},
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmmirror.com/type-is/-/type-is-1.6.18.tgz",
......
var _random = Math.random
var v_saf;
!function () {
var n = Function.toString, t = [], i = [], o = [].indexOf.bind(t), e = [].push.bind(t), r = [].push.bind(i);
......@@ -52,8 +54,8 @@ print = console.log
dtavm.log = console.log
con3 = console.log
con4 = console.log
// con3 = function (){}
// con4 = function (){}
con3 = function (){}
con4 = function (){}
......@@ -720,39 +722,7 @@ requestAnimationFrame = v_saf(function requestAnimationFrame() {
})
File = v_saf(function File() {
})
webkitRTCPeerConnection = v_saf(function webkitRTCPeerConnection() {
;
});
_inherits(webkitRTCPeerConnection, EventTarget)
Object.defineProperties(webkitRTCPeerConnection.prototype, {
onicecandidate: {
set() {
print(" [*] webkitRTCPeerConnection -> onicecandidate[set]", [].slice.call(arguments));
}
},
createDataChannel: {
value: v_saf(function createDataChannel() {
print(" [*] webkitRTCPeerConnection -> createDataChannel[func]", [].slice.call(arguments));
})
},
createOffer: {
value: v_saf(function createOffer() {
print(" [*] webkitRTCPeerConnection -> createOffer[func]", [].slice.call(arguments));
})
},
setLocalDescription: {
value: v_saf(function setLocalDescription() {
print(" [*] webkitRTCPeerConnection -> setLocalDescription[func]", [].slice.call(arguments));
})
},
[Symbol.toStringTag]: {value: "webkitRTCPeerConnection", writable: false, enumerable: false, configurable: true},
})
RTCPeerConnection = v_saf(function RTCPeerConnection() {
;
});
_inherits(RTCPeerConnection, EventTarget)
RTCDataChannel = v_saf(function RTCDataChannel() {
;
});
......@@ -3619,34 +3589,37 @@ Object.defineProperties(Image.prototype, {
[Symbol.toStringTag]: {value: "Image", writable: false, enumerable: false, configurable: true},
})
publicDescription = undefined;
class RTCPeerConnection {
constructor(args) {
console.log('RTCPeerConnection.new', args)
}
}
Object.defineProperties(RTCPeerConnection.prototype, {
localDescription: {
value: {
get: v_saf(function get() {
print('get localDescription')
return publicDescription
})
return this._publicDescription
}),
set: function (arg) {
this._publicDescription = arg
}
}
},
onicecandidate: {
set() {
print(" [*] RTCPeerConnection -> onicecandidate[set]", [].slice.call(arguments));
this._onicecandidate = arguments[0]
}
},
createDataChannel: {
value: v_saf(function createDataChannel(label, option) {
print(" [*] RTCPeerConnection -> createDataChannel[func]", [].slice.call(arguments));
return {
'onopen': function onopen() {
print(" [*] RTCPeerConnection -> createDataChannel[func] onopen", [].slice.call(arguments));
},
'onmessage': function onmessage() {
print(" [*] RTCPeerConnection -> createDataChannel[func] onmessage", [].slice.call(arguments));
},
}
let res = new RTCDataChannel(label);
return proxy(res, 'dataChannel')
})
},
createOffer: {
......@@ -3654,18 +3627,22 @@ Object.defineProperties(RTCPeerConnection.prototype, {
print(" [*] RTCPeerConnection -> createOffer[func]", [].slice.call(arguments));
let p = new Promise(function (resolve, reject) {
// 2. 执行异步操作任务
print('RTCPeerConnection createOffer');
let res = v_new(RTCSessionDescription)
res.sdp = RTCSessionDescription.prototype.sdp
res.type = RTCSessionDescription.prototype.type
resolve(res)
print('RTCPeerConnection createOffer', resolve, reject);
let res = new RTCSessionDescription()
// resolve(proxy(res, 'newRTCSessionDescription'))
resolve({
then: function (arg1, arg2) {
arg1(proxy(res, 'newRTCSessionDescription'))
arg2(proxy(res, 'newRTCSessionDescription'))
}
})
})
return p;
// return {
// then: function (func, func2) {
// v_console_log(" [*] RTCPeerConnection -> createOffer[func] then", [].slice.call(arguments));
// // func2(v_new(RTCSessionDescription));
// // func(v_new(RTCSessionDescription));
// func2(v_new(RTCSessionDescription));
// func(v_new(RTCSessionDescription));
// return func(v_new(RTCSessionDescription));
// }, catch: function () {
// }
......@@ -3674,27 +3651,26 @@ Object.defineProperties(RTCPeerConnection.prototype, {
},
setLocalDescription: {
value: v_saf(function setLocalDescription() {
// print(" [*] RTCPeerConnection -> setLocalDescription[func]", [].slice.call(arguments));
var _this = this;
print(" [*] RTCPeerConnection -> setLocalDescription[func]", [].slice.call(arguments));
_this._onicecandidate(new RTCPeerConnectionIceEvent())
this.localDescription = arguments[0]
_this._onicecandidate(this.localDescription)
let p = new Promise(function (resolve, reject) {
// 2. 执行异步操作任务
// let res = this.setLocalDescription(v_new(RTCSessionDescription))
// console.log('RTCPeerConnection create',res);
_this._onicecandidate(new RTCPeerConnectionIceEvent())
print(" [*] RTCPeerConnection -> setLocalDescription[func] then", [].slice.call(arguments));
publicDescription = arguments[0]
// window.debug = true
resolve(publicDescription)
resolve(new RTCSessionDescription())
// return res
})
return p;
// return {
// then: function (func, func2) {
// print(" [*] RTCPeerConnection -> setLocalDescription[func] then", [].slice.call(arguments));
//
// return this
// }, catch: function () {
// }
// }
})
}),
enumerable: true,
configurable: true
},
[Symbol.toStringTag]: {value: "RTCPeerConnection", writable: false, enumerable: false, configurable: true},
})
......@@ -3763,14 +3739,52 @@ Object.defineProperties(WebSocket.prototype, {
CLOSED: {"value": 3, "writable": false, "enumerable": true, "configurable": false},
[Symbol.toStringTag]: {value: "WebSocket", writable: false, enumerable: false, configurable: true},
})
let t1 = parseInt(_random() * 2430043322 / 2 + 1430043322);
let t2 = parseInt(_random() * 2430043322 / 2 + 1430043322);
let t3 = parseInt(_random() * 5000 + 60199);
let ip = `192.168.${parseInt(_random() * 150 + 1)}.${parseInt(_random() * 150 + 1)}`
function guid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = _random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
var candidateGetTimes = 0;
Object.defineProperties(RTCPeerConnectionIceEvent.prototype, {
candidate: {
get() {
v_console_log(" [*] RTCPeerConnectionIceEvent -> candidate[get]", {});
return {}
}
get: function () {
let res = `candidate:${t1} 1 udp ${t2} ${guid()}.local ${t3} typ host generation 0 ufrag MiWK network-cost 999`
res = `candidate:${t1} 1 udp ${t2} ${ip} ${t3} typ host generation 0 ufrag 5M7j network-id 1`
// res = `candidate:${t1} 1 tcp ${t2} ${ip} 9 typ host tcptype active generation 0 ufrag ZZHV network-id 1`
// res = 'candidate:2594513701 1 udp 2122260223 192.168.50.235 54336 typ host generation 0 ufrag 5M7j network-id 1 '
// res = 'candidate:1678768049 1 tcp 1518280447 192.168.50.235 9 typ host tcptype active generation 0 ufrag 5M7j network-id 1 '
console.log('RTCPeerConnectionIceEvent.candidate.get', res)
let rrr = proxy(new RTCIceCandidate(
ip, res, "rtp", t1, t2, t3, 'tcp', null, null, 0, "0", 'active', 'host', '5M7j'
), 'candidate[new]');
candidateGetTimes++
if (candidateGetTimes > 3) {
rrr.candidate = null
// return null
}
return rrr;
},
enumerable: true, configurable: true
},
type: {
value: 'icecandidate'
},
isTrusted: {
value: true,
},
[Symbol.toStringTag]: {value: "RTCPeerConnectionIceEvent", writable: false, enumerable: false, configurable: true},
})
Object.defineProperties(MessageEvent.prototype, {
data: {
......@@ -5712,8 +5726,7 @@ window.Document = Document;
window.DOMException = DOMException;
window.DOMMatrixReadOnly = DOMMatrixReadOnly;
window.RTCPeerConnection = RTCPeerConnection;
window.webkitRTCPeerConnection = webkitRTCPeerConnection;
window.mozRTCPeerConnection = mozRTCPeerConnection;
window.webkitRTCPeerConnection = RTCPeerConnection;
window.DOMParser = DOMParser;
window.FileReader = FileReader;
window.FormData = FormData;
......@@ -5977,3 +5990,4 @@ let reProxy = function (tt, name) {
};
No preview for this file type
var _random = Math.random
var v_saf;
!function () {
var n = Function.toString, t = [], i = [], o = [].indexOf.bind(t), e = [].push.bind(t), r = [].push.bind(i);
......@@ -52,8 +54,8 @@ print = console.log
dtavm.log = console.log
con3 = console.log
con4 = console.log
// con3 = function (){}
// con4 = function (){}
con3 = function (){}
con4 = function (){}
......@@ -720,39 +722,7 @@ requestAnimationFrame = v_saf(function requestAnimationFrame() {
})
File = v_saf(function File() {
})
webkitRTCPeerConnection = v_saf(function webkitRTCPeerConnection() {
;
});
_inherits(webkitRTCPeerConnection, EventTarget)
Object.defineProperties(webkitRTCPeerConnection.prototype, {
onicecandidate: {
set() {
print(" [*] webkitRTCPeerConnection -> onicecandidate[set]", [].slice.call(arguments));
}
},
createDataChannel: {
value: v_saf(function createDataChannel() {
print(" [*] webkitRTCPeerConnection -> createDataChannel[func]", [].slice.call(arguments));
})
},
createOffer: {
value: v_saf(function createOffer() {
print(" [*] webkitRTCPeerConnection -> createOffer[func]", [].slice.call(arguments));
})
},
setLocalDescription: {
value: v_saf(function setLocalDescription() {
print(" [*] webkitRTCPeerConnection -> setLocalDescription[func]", [].slice.call(arguments));
})
},
[Symbol.toStringTag]: {value: "webkitRTCPeerConnection", writable: false, enumerable: false, configurable: true},
})
RTCPeerConnection = v_saf(function RTCPeerConnection() {
;
});
_inherits(RTCPeerConnection, EventTarget)
RTCDataChannel = v_saf(function RTCDataChannel() {
;
});
......@@ -3619,34 +3589,37 @@ Object.defineProperties(Image.prototype, {
[Symbol.toStringTag]: {value: "Image", writable: false, enumerable: false, configurable: true},
})
publicDescription = undefined;
class RTCPeerConnection {
constructor(args) {
console.log('RTCPeerConnection.new', args)
}
}
Object.defineProperties(RTCPeerConnection.prototype, {
localDescription: {
value: {
get: v_saf(function get() {
print('get localDescription')
return publicDescription
})
return this._publicDescription
}),
set: function (arg) {
this._publicDescription = arg
}
}
},
onicecandidate: {
set() {
print(" [*] RTCPeerConnection -> onicecandidate[set]", [].slice.call(arguments));
this._onicecandidate = arguments[0]
}
},
createDataChannel: {
value: v_saf(function createDataChannel(label, option) {
print(" [*] RTCPeerConnection -> createDataChannel[func]", [].slice.call(arguments));
return {
'onopen': function onopen() {
print(" [*] RTCPeerConnection -> createDataChannel[func] onopen", [].slice.call(arguments));
},
'onmessage': function onmessage() {
print(" [*] RTCPeerConnection -> createDataChannel[func] onmessage", [].slice.call(arguments));
},
}
let res = new RTCDataChannel(label);
return proxy(res, 'dataChannel')
})
},
createOffer: {
......@@ -3654,18 +3627,22 @@ Object.defineProperties(RTCPeerConnection.prototype, {
print(" [*] RTCPeerConnection -> createOffer[func]", [].slice.call(arguments));
let p = new Promise(function (resolve, reject) {
// 2. 执行异步操作任务
print('RTCPeerConnection createOffer');
let res = v_new(RTCSessionDescription)
res.sdp = RTCSessionDescription.prototype.sdp
res.type = RTCSessionDescription.prototype.type
resolve(res)
print('RTCPeerConnection createOffer', resolve, reject);
let res = new RTCSessionDescription()
// resolve(proxy(res, 'newRTCSessionDescription'))
resolve({
then: function (arg1, arg2) {
arg1(proxy(res, 'newRTCSessionDescription'))
arg2(proxy(res, 'newRTCSessionDescription'))
}
})
})
return p;
// return {
// then: function (func, func2) {
// v_console_log(" [*] RTCPeerConnection -> createOffer[func] then", [].slice.call(arguments));
// // func2(v_new(RTCSessionDescription));
// // func(v_new(RTCSessionDescription));
// func2(v_new(RTCSessionDescription));
// func(v_new(RTCSessionDescription));
// return func(v_new(RTCSessionDescription));
// }, catch: function () {
// }
......@@ -3674,27 +3651,26 @@ Object.defineProperties(RTCPeerConnection.prototype, {
},
setLocalDescription: {
value: v_saf(function setLocalDescription() {
// print(" [*] RTCPeerConnection -> setLocalDescription[func]", [].slice.call(arguments));
var _this = this;
print(" [*] RTCPeerConnection -> setLocalDescription[func]", [].slice.call(arguments));
_this._onicecandidate(new RTCPeerConnectionIceEvent())
this.localDescription = arguments[0]
_this._onicecandidate(this.localDescription)
let p = new Promise(function (resolve, reject) {
// 2. 执行异步操作任务
// let res = this.setLocalDescription(v_new(RTCSessionDescription))
// console.log('RTCPeerConnection create',res);
_this._onicecandidate(new RTCPeerConnectionIceEvent())
print(" [*] RTCPeerConnection -> setLocalDescription[func] then", [].slice.call(arguments));
publicDescription = arguments[0]
// window.debug = true
resolve(publicDescription)
resolve(new RTCSessionDescription())
// return res
})
return p;
// return {
// then: function (func, func2) {
// print(" [*] RTCPeerConnection -> setLocalDescription[func] then", [].slice.call(arguments));
//
// return this
// }, catch: function () {
// }
// }
})
}),
enumerable: true,
configurable: true
},
[Symbol.toStringTag]: {value: "RTCPeerConnection", writable: false, enumerable: false, configurable: true},
})
......@@ -3763,14 +3739,52 @@ Object.defineProperties(WebSocket.prototype, {
CLOSED: {"value": 3, "writable": false, "enumerable": true, "configurable": false},
[Symbol.toStringTag]: {value: "WebSocket", writable: false, enumerable: false, configurable: true},
})
let t1 = parseInt(_random() * 2430043322 / 2 + 1430043322);
let t2 = parseInt(_random() * 2430043322 / 2 + 1430043322);
let t3 = parseInt(_random() * 5000 + 60199);
let ip = `192.168.${parseInt(_random() * 150 + 1)}.${parseInt(_random() * 150 + 1)}`
function guid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = _random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
var candidateGetTimes = 0;
Object.defineProperties(RTCPeerConnectionIceEvent.prototype, {
candidate: {
get() {
v_console_log(" [*] RTCPeerConnectionIceEvent -> candidate[get]", {});
return {}
}
get: function () {
let res = `candidate:${t1} 1 udp ${t2} ${guid()}.local ${t3} typ host generation 0 ufrag MiWK network-cost 999`
res = `candidate:${t1} 1 udp ${t2} ${ip} ${t3} typ host generation 0 ufrag 5M7j network-id 1`
// res = `candidate:${t1} 1 tcp ${t2} ${ip} 9 typ host tcptype active generation 0 ufrag ZZHV network-id 1`
// res = 'candidate:2594513701 1 udp 2122260223 192.168.50.235 54336 typ host generation 0 ufrag 5M7j network-id 1 '
// res = 'candidate:1678768049 1 tcp 1518280447 192.168.50.235 9 typ host tcptype active generation 0 ufrag 5M7j network-id 1 '
console.log('RTCPeerConnectionIceEvent.candidate.get', res)
let rrr = proxy(new RTCIceCandidate(
ip, res, "rtp", t1, t2, t3, 'tcp', null, null, 0, "0", 'active', 'host', '5M7j'
), 'candidate[new]');
candidateGetTimes++
if (candidateGetTimes > 3) {
rrr.candidate = null
// return null
}
return rrr;
},
enumerable: true, configurable: true
},
type: {
value: 'icecandidate'
},
isTrusted: {
value: true,
},
[Symbol.toStringTag]: {value: "RTCPeerConnectionIceEvent", writable: false, enumerable: false, configurable: true},
})
Object.defineProperties(MessageEvent.prototype, {
data: {
......@@ -5712,8 +5726,7 @@ window.Document = Document;
window.DOMException = DOMException;
window.DOMMatrixReadOnly = DOMMatrixReadOnly;
window.RTCPeerConnection = RTCPeerConnection;
window.webkitRTCPeerConnection = webkitRTCPeerConnection;
window.mozRTCPeerConnection = mozRTCPeerConnection;
window.webkitRTCPeerConnection = RTCPeerConnection;
window.DOMParser = DOMParser;
window.FileReader = FileReader;
window.FormData = FormData;
......
// Create a new isolate limited to 128MB
const ivm = require('isolated-vm');
const isolate = new ivm.Isolate({ memoryLimit: 128 });
// Create a new context within this isolate. Each context has its own copy of all the builtin
// Objects. So for instance if one context does Object.prototype.foo = 1 this would not affect any
// other contexts.
const context = isolate.createContextSync();
// Get a Reference{} to the global object within the context.
const jail = context.global;
// And let's test it out:
// > hello world
// Let's see what happens when we try to blow the isolate's memory
const hostile = isolate.compileScriptSync(`
const storage = [];
const twoMegabytes = 1024 * 1024 * 2;
while (true) {
const array = new Uint8Array(twoMegabytes);
for (let ii = 0; ii < twoMegabytes; ii += 4096) {
array[ii] = 1; // we have to put something in the array to flush to real memory
}
storage.push(array);
log('I\\'ve wasted '+ (storage.length * 2)+ 'MB');
}
`);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment