Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-shape
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wangmingming
lcc-shape
Commits
aeeaf207
Commit
aeeaf207
authored
Aug 07, 2023
by
wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4444
parent
965c45f1
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
86910 additions
and
3594 deletions
+86910
-3594
js_dom_run.js
js_dom_run.js
+62
-35
Window.js
jsdom/lib/jsdom/browser/Window.js
+3
-3
HTMLBodyElement.js
jsdom/lib/jsdom/living/generated/HTMLBodyElement.js
+4
-0
Navigator.js
jsdom/lib/jsdom/living/generated/Navigator.js
+14
-14
HTMLCanvasElement-impl.js
jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js
+32
-1
2.log
logs/2.log
+83800
-659
run.js
run.js
+58
-7
src_out.js
src_out.js
+2937
-2875
No files found.
js_dom_run.js
View file @
aeeaf207
...
...
@@ -12,12 +12,17 @@ proxy = function (tt, name) {
let
res
=
Reflect
.
get
(
target
,
p
,
receiver
);
if
(
p
!==
'debug'
&&
p
!==
'Object'
)
{
console
.
log
(
`
${
name
}
get`
,
p
,
typeof
res
)
}
// if (p === 'offsetHeight'){
// debugger;
// }
if
(
p
===
'exec'
)
{
return
function
(
args
){
console
.
log
(
`
${
name
}
exec`
,
args
)
return
/{
\s
*
\[\s
*native
\s
+code
\s
*]
\s
*}
\s
*$/
.
exec
(
args
)
}
}
// console.log(Reflect.get(target, '_cf_chl_ctx', receiver))
if
(
!
[
'_registeredHandlers'
,
'window'
,
'_currentEvent'
,
'debug'
,
'_eventListenerss'
,
'top'
,
'prototype'
].
includes
(
p
)
&&
res
&&
typeof
res
===
'object'
&&
typeof
p
!==
'symbol'
)
{
...
...
@@ -58,28 +63,28 @@ const crypto = require("crypto"); // 引入 jsdom
var
_random
=
Math
.
random
Date
.
now
=
function
now
()
{
return
1685096207545
};
Date
.
parse
=
function
()
{
return
1685096207545
};
Date
.
prototype
.
valueOf
=
function
()
{
return
1685096207545
};
Date
.
prototype
.
getTime
=
function
()
{
return
1685096207545
};
Date
.
prototype
.
toString
=
function
()
{
return
1685096207545
};
Performance
.
prototype
.
now
=
function
now
()
{
return
Number
(
'1685096207545'
.
slice
(
8
))
}
Math
.
random
=
function
random
()
{
return
0.08636862211354912
};
//
Date.now = function now() {
//
return 1685096207545
//
};
//
Date.parse = function () {
//
return 1685096207545
//
};
//
Date.prototype.valueOf = function () {
//
return 1685096207545
//
};
//
Date.prototype.getTime = function () {
//
return 1685096207545
//
};
//
Date.prototype.toString = function () {
//
return 1685096207545
//
};
//
Performance.prototype.now = function now() {
//
return Number('1685096207545'.slice(8))
//
}
//
//
Math.random = function random() {
//
return 0.08636862211354912
//
};
const
FingerprintGenerator
=
require
(
'fingerprint-generator'
).
FingerprintGenerator
;
...
...
@@ -479,8 +484,8 @@ const dom = new JSDOM(`
// document.referrer
contentType
:
"text/html"
,
// document.contentType
//
userAgent: fingerprint.navigator.userAgent,
userAgent
:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'
,
userAgent
:
fingerprint
.
navigator
.
userAgent
,
//
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
// UA
includeNodeLocations
:
true
// 保留由HTML解析器生成的位置信息,允许使用nodeLocation()方法
...
...
@@ -970,12 +975,23 @@ window.OffscreenCanvas = proxy(OffscreenCanvas, 'OffscreenCanvas')
RTCSessionDescription
=
v_saf
(
function
RTCSessionDescription
()
{
;
})
getRanHex
=
size
=>
{
let
result
=
[];
let
hexRef
=
[
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
];
for
(
let
n
=
0
;
n
<
size
;
n
++
)
{
result
.
push
(
hexRef
[
Math
.
floor
(
_random
()
*
16
)].
toUpperCase
()
+
hexRef
[
Math
.
floor
(
_random
()
*
16
)].
toUpperCase
());
}
return
result
;
}
Object
.
defineProperties
(
RTCSessionDescription
.
prototype
,
{
sdp
:
{
get
:
v_saf
(
function
get
()
{
print
(
" [*] RTCSessionDescription -> sdp[get]"
);
return
`v=0
o=- 7671951856866369796 2 IN IP4 127.0.0.1
let
t1
=
parseInt
(
Math
.
random
()
*
(
9145445486224659982
/
2
)
+
9145445486224659982
/
1.2
)
let
hex
=
getRanHex
(
32
).
join
(
':'
);
let
res
=
`v=0
o=-
${
t1
}
2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
...
...
@@ -983,14 +999,16 @@ a=extmap-allow-mixed
a=msid-semantic: WMS
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=ice-ufrag:
2PVz
a=ice-pwd:
UsK+8dfSl/7xZKq9bF6tSooX
a=ice-ufrag:
Pz1P
a=ice-pwd:
2RkyfgKRyILQtDZZ5mluUlPS
a=ice-options:trickle
a=fingerprint:sha-256
36:55:F4:0E:9E:97:80:5E:81:D7:8E:18:F0:EB:33:F4:10:88:93:20:AA:9E:35:61:6A:D3:15:5D:6F:73:76:DF
a=fingerprint:sha-256
${
hex
}
a=setup:actpass
a=mid:0
a=sctp-port:5000
a=max-message-size:262144`
print
(
" [*] RTCSessionDescription -> sdp[get]"
,
res
);
})
},
...
...
@@ -2039,7 +2057,7 @@ var stackTrace = {};
let
arggs
=
[];
window
.
videos
=
[];
window
.
fonts
=
[];
window
.
imageDatas
=
[];
(
function
a
(
R
)
{
var
M
=
{},
Z
=
{};
var
U
=
ReferenceError
,
j
=
TypeError
,
E
=
Object
,
I
=
RegExp
,
B
=
Number
,
c
=
String
,
f
=
Array
,
g
=
E
.
bind
,
...
...
@@ -4088,7 +4106,12 @@ window.fonts = [];
},
function
(
HZ
)
{
var
HU
=
z
[
Rh
[
HZ
.
Y
]
<<
8
|
Rh
[
HZ
.
Y
+
1
]];
HZ
.
Y
+=
2
;
HZ
.
n
[
HZ
.
n
.
length
]
=
I
(
HU
)
console
.
log
(
"regex2"
,
HU
)
let
res
=
I
(
HU
);
if
(
HU
===
'{
\\
s*
\\
[
\\
s*native
\\
s+code
\\
s*]
\\
s*}
\\
s*$'
)
{
res
=
proxy
(
res
,
'regexxx'
)
}
HZ
.
n
[
HZ
.
n
.
length
]
=
res
},
function
(
Hj
)
{
var
HE
=
Rh
[
Hj
.
Y
];
Hj
.
Y
+=
1
;
...
...
@@ -4670,6 +4693,7 @@ window.fonts = [];
tH
.
n
[
tH
.
n
.
length
-
2
]
=
delete
tH
.
n
[
tH
.
n
.
length
-
2
][
tH
.
n
[
tH
.
n
.
length
-
1
]];
tH
.
n
.
length
-=
1
},
function
(
tS
)
{
console
.
log
(
tS
.
n
[
tS
.
n
.
length
-
2
],
'ininin'
,
tS
.
n
[
tS
.
n
.
length
-
2
]
in
tS
.
n
[
tS
.
n
.
length
-
1
],
tS
.
n
[
tS
.
n
.
length
-
1
])
tS
.
n
[
tS
.
n
.
length
-
2
]
=
tS
.
n
[
tS
.
n
.
length
-
2
]
in
tS
.
n
[
tS
.
n
.
length
-
1
];
tS
.
n
.
length
-=
1
},
function
(
tk
)
{
...
...
@@ -5081,6 +5105,8 @@ window.fonts = [];
sP
.
n
[
sP
.
n
.
length
-
5
]
=
sP
.
p
.
O
(
ss
);
sP
.
n
.
length
-=
4
},
function
(
sW
)
{
console
.
log
(
"regex1"
,
sW
.
n
[
sW
.
n
.
length
-
1
],
sW
.
n
[
sW
.
n
.
length
-
2
])
sW
.
n
[
sW
.
n
.
length
-
2
]
=
I
(
sW
.
n
[
sW
.
n
.
length
-
1
],
sW
.
n
[
sW
.
n
.
length
-
2
]);
sW
.
n
.
length
-=
1
}];
...
...
@@ -5214,7 +5240,7 @@ setTimeout(() => {
xhr
.
send
(
"{
\"
tripType
\"
:
\"
oneWay
\"
,
\"
from
\"
:
\"
ZLA
\"
,
\"
to
\"
:
\"
NAS
\"
,
\"
depart
\"
:
\"
2023-04-11
\"
,
\"
cabin
\"
:
\"
economy
\"
,
\"
refundable
\"
:false,
\"
dates
\"
:{
\"
before
\"
:
\"
3
\"
,
\"
after
\"
:
\"
3
\"
},
\"
pax
\"
:{
\"
ADT
\"
:1,
\"
CHD
\"
:0,
\"
INF
\"
:0,
\"
UNN
\"
:0},
\"
redempoint
\"
:false,
\"
pointsBreakup
\"
:{
\"
option
\"
:
\"\"
,
\"
value
\"
:0},
\"
isMultiCity
\"
:false}"
)
xhr
.
setRequestHeader
(
'user-agent'
,
fingerprint
.
navigator
.
userAgent
)
print
(
JSON
.
stringify
(
xhr
.
headers
))
// print(JSON.stringify(window.
font
s))
// print(JSON.stringify(window.
imageData
s))
// process.exit(0)
},
1000
)
...
...
@@ -5222,6 +5248,7 @@ setTimeout(() => {
const
express
=
require
(
'express'
)
const
util
=
require
(
"util"
);
const
app
=
express
()
app
.
get
(
'/'
,
(
req
,
res
)
=>
{
...
...
jsdom/lib/jsdom/browser/Window.js
View file @
aeeaf207
...
...
@@ -269,9 +269,9 @@ function Window(options) {
// console.log('window get', p, typeof res)
}
// if (p === 'offsetHeigh
t'){
//
debugger;
//
}
if
(
p
===
'StyleShee
t'
){
debugger
;
}
// console.log(Reflect.get(target, '_cf_chl_ctx', receiver))
if
(
!
[
'_registeredHandlers'
,
'window'
,
'_currentEvent'
,
'debug'
,
'_eventListenerss'
,
'top'
,
'JSON'
,
'Math'
].
includes
(
p
)
&&
res
&&
typeof
res
===
'object'
&&
typeof
p
!==
'symbol'
)
{
...
...
jsdom/lib/jsdom/living/generated/HTMLBodyElement.js
View file @
aeeaf207
...
...
@@ -188,7 +188,10 @@ exports.install = (globalObject, globalNames) => {
ceReactionsPostSteps_helpers_custom_elements
(
globalObject
);
}
}
get
webkitRequestFullScreen
()
{
console
.
log
(
'body.webkitRequestFullScreen'
)
}
set
vLink
(
V
)
{
const
esValue
=
this
!==
null
&&
this
!==
undefined
?
this
:
globalObject
;
...
...
@@ -791,6 +794,7 @@ exports.install = (globalObject, globalNames) => {
onstorage
:
{
enumerable
:
true
},
onunhandledrejection
:
{
enumerable
:
true
},
onunload
:
{
enumerable
:
true
},
webkitRequestFullScreen
:
{
enumerable
:
true
},
[
Symbol
.
toStringTag
]:
{
value
:
"HTMLBodyElement"
,
configurable
:
true
}
});
if
(
globalObject
[
ctorRegistrySymbol
]
===
undefined
)
{
...
...
jsdom/lib/jsdom/living/generated/Navigator.js
View file @
aeeaf207
...
...
@@ -319,11 +319,10 @@ exports.install = (globalObject, globalNames) => {
}
return
{
then
:
function
()
{
return
r
}
}
return
Promise
((
resolve
,
reject
)
=>
{
resolve
(
r
)
});
}
}
}
...
...
@@ -645,6 +644,7 @@ exports.install = (globalObject, globalNames) => {
unregisterProtocolHandler
()
{
console
.
log
(
'navigator.unregisterProtocolHandler'
)
}
get
mimeTypes
()
{
const
esValue
=
this
!==
null
&&
this
!==
undefined
?
this
:
globalObject
;
...
...
jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js
View file @
aeeaf207
...
...
@@ -2376,7 +2376,19 @@ function randInt(a, b) {
return
parseInt
(
Math
.
random
()
*
(
b
-
a
)
+
a
)
}
class
CanvasRenderingContext2D
{
imageDatas
=
{
"18,90,1,1"
:
[
214
,
122
,
6
,
255
],
"38,77,1,1"
:
[
255
,
255
,
255
,
255
],
"48,28,1,1"
:
[
0
,
0
,
0
,
0
],
"94,23,1,1"
:
[
0
,
0
,
0
,
0
],
"26,46,1,1"
:
[
253
,
243
,
245
,
255
],
"47,23,1,1"
:
[
0
,
0
,
0
,
0
],
"37,17,1,1"
:
[
0
,
0
,
0
,
255
],
"62,28,1,1"
:
[
204
,
131
,
217
,
255
]
}
constructor
(
w
,
h
,
context
)
{
console
.
log
(
'OffscreenCanvasRenderingContext2D.new'
,
w
,
h
)
this
.
width
=
w
;
...
...
@@ -2554,6 +2566,7 @@ class CanvasRenderingContext2D {
get
font
()
{
console
.
log
(
'CanvasRenderingContext2D.font.get'
)
return
this
.
_context
.
font
;
}
get
textAlign
()
{
...
...
@@ -2566,6 +2579,7 @@ class CanvasRenderingContext2D {
get
textBaseline
()
{
console
.
log
(
'CanvasRenderingContext2D.textBaseline.get'
)
return
this
.
_context
.
textBaseline
}
set
textBaseline
(
args
)
{
...
...
@@ -2575,10 +2589,13 @@ class CanvasRenderingContext2D {
get
direction
()
{
console
.
log
(
'CanvasRenderingContext2D.direction.get'
)
return
this
.
_context
.
direction
;
}
set
direction
(
args
)
{
console
.
log
(
'CanvasRenderingContext2D.direction.set'
,
args
)
this
.
_context
.
direction
=
args
}
get
fontKerning
()
{
...
...
@@ -2671,6 +2688,7 @@ class CanvasRenderingContext2D {
fillText
()
{
console
.
log
(
'CanvasRenderingContext2D.fillText'
,
...
arguments
)
this
.
_context
.
fillText
(...
arguments
)
this
.
_fillText
=
[
arguments
[
0
],
arguments
[
1
],
arguments
[
2
]]
}
getContextAttributes
()
{
...
...
@@ -2679,6 +2697,19 @@ class CanvasRenderingContext2D {
getImageData
()
{
let
res
=
this
.
_context
.
getImageData
(...
arguments
)
window
.
imageDatas
.
push
({
font
:
this
.
_context
.
font
,
fillStyle
:
this
.
_context
.
fillStyle
,
fillText
:
this
.
_fillText
,
imageData
:
[
arguments
[
0
],
arguments
[
1
],
arguments
[
2
],
arguments
[
3
]]
})
let
tdata
=
this
.
imageDatas
[[
arguments
[
0
],
arguments
[
1
],
arguments
[
2
],
arguments
[
3
]]
+
''
];
if
(
tdata
){
res
.
data
[
0
]
=
tdata
[
0
]
res
.
data
[
1
]
=
tdata
[
1
]
res
.
data
[
2
]
=
tdata
[
2
]
res
.
data
[
3
]
=
tdata
[
3
]
}
console
.
log
(
'CanvasRenderingContext2D.getImageData'
,
...
arguments
,
res
)
return
res
...
...
logs/2.log
View file @
aeeaf207
This diff is collapsed.
Click to expand it.
run.js
View file @
aeeaf207
const
Canvas
=
require
(
'canvas'
)
var
a
=
Canvas
.
createCanvas
(
96
,
96
)
let
ctx
=
a
.
getContext
(
'2d'
)
console
.
log
(
ctx
)
ctx
.
font
=
'94px sans-serif'
ctx
.
fillStyle
=
'#000'
ctx
.
fillText
(
'😎'
,
-
1
,
96
)
console
.
log
(
ctx
.
getImageData
(
18
,
90
,
1
,
1
))
\ No newline at end of file
let
res
=
{};
let
sss
=
[
{
"font"
:
"94px sans-serif"
,
"fillStyle"
:
"#000000"
,
"fillText"
:
{
"0"
:
"😎"
,
"1"
:
-
1
,
"2"
:
96
},
"imageData"
:
{
"0"
:
18
,
"1"
:
90
,
"2"
:
1
,
"3"
:
1
}
},
{
"font"
:
"94px sans-serif"
,
"fillStyle"
:
"#000000"
,
"fillText"
:
{
"0"
:
"6️⃣"
,
"1"
:
-
1
,
"2"
:
96
},
"imageData"
:
{
"0"
:
38
,
"1"
:
77
,
"2"
:
1
,
"3"
:
1
}
},
{
"font"
:
"94px sans-serif"
,
"fillStyle"
:
"#000000"
,
"fillText"
:
{
"0"
:
"🍼"
,
"1"
:
-
1
,
"2"
:
96
},
"imageData"
:
{
"0"
:
48
,
"1"
:
28
,
"2"
:
1
,
"3"
:
1
}
},
{
"font"
:
"94px sans-serif"
,
"fillStyle"
:
"#000000"
,
"fillText"
:
{
"0"
:
"🏴"
,
"1"
:
-
1
,
"2"
:
96
},
"imageData"
:
{
"0"
:
94
,
"1"
:
23
,
"2"
:
1
,
"3"
:
1
}
},
{
"font"
:
"94px sans-serif"
,
"fillStyle"
:
"#000000"
,
"fillText"
:
{
"0"
:
"📊"
,
"1"
:
-
1
,
"2"
:
96
},
"imageData"
:
{
"0"
:
26
,
"1"
:
46
,
"2"
:
1
,
"3"
:
1
}
},
{
"font"
:
"94px sans-serif"
,
"fillStyle"
:
"#000000"
,
"fillText"
:
{
"0"
:
"🏴"
,
"1"
:
-
1
,
"2"
:
96
},
"imageData"
:
{
"0"
:
47
,
"1"
:
23
,
"2"
:
1
,
"3"
:
1
}
},
{
"font"
:
"94px sans-serif"
,
"fillStyle"
:
"#000000"
,
"fillText"
:
{
"0"
:
"㊗️"
,
"1"
:
-
1
,
"2"
:
96
},
"imageData"
:
{
"0"
:
37
,
"1"
:
17
,
"2"
:
1
,
"3"
:
1
}
},
{
"font"
:
"94px sans-serif"
,
"fillStyle"
:
"#000000"
,
"fillText"
:
{
"0"
:
"⛎"
,
"1"
:
-
1
,
"2"
:
96
},
"imageData"
:
{
"0"
:
62
,
"1"
:
28
,
"2"
:
1
,
"3"
:
1
}
}]
for
(
let
i
=
0
;
i
<
sss
.
length
;
i
++
)
{
var
a
=
document
.
createElement
(
'canvas'
)
let
ctx
=
a
.
getContext
(
'2d'
);
let
s
=
sss
[
i
];
ctx
.
font
=
s
.
font
;
ctx
.
fillStyle
=
s
.
fillStyle
;
ctx
.
fillText
(...
s
.
fillText
)
console
.
log
(
ctx
.
getImageData
(...
s
.
imageData
))
}
src_out.js
View file @
aeeaf207
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment