@painsel/no-ai-wasm-engine 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/debug.wat +46 -0
- package/build/release.wat +36 -0
- package/package.json +3 -3
package/build/debug.wat
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
(module
|
|
2
|
+
(type $0 (func (param i32 i32 i32)))
|
|
3
|
+
(global $~lib/memory/__data_end i32 (i32.const 8))
|
|
4
|
+
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 32776))
|
|
5
|
+
(global $~lib/memory/__heap_base i32 (i32.const 32776))
|
|
6
|
+
(memory $0 0)
|
|
7
|
+
(table $0 1 1 funcref)
|
|
8
|
+
(elem $0 (i32.const 1))
|
|
9
|
+
(export "decrypt" (func $assembly/index/decrypt))
|
|
10
|
+
(export "memory" (memory $0))
|
|
11
|
+
(func $assembly/index/decrypt (param $len i32) (param $key i32) (param $entropy i32)
|
|
12
|
+
(local $i i32)
|
|
13
|
+
(local $byte i32)
|
|
14
|
+
local.get $entropy
|
|
15
|
+
i32.const 100
|
|
16
|
+
i32.lt_s
|
|
17
|
+
if
|
|
18
|
+
local.get $key
|
|
19
|
+
i32.const 255
|
|
20
|
+
i32.xor
|
|
21
|
+
local.set $key
|
|
22
|
+
end
|
|
23
|
+
i32.const 0
|
|
24
|
+
local.set $i
|
|
25
|
+
loop $for-loop|0
|
|
26
|
+
local.get $i
|
|
27
|
+
local.get $len
|
|
28
|
+
i32.lt_s
|
|
29
|
+
if
|
|
30
|
+
local.get $i
|
|
31
|
+
i32.load8_u
|
|
32
|
+
local.set $byte
|
|
33
|
+
local.get $i
|
|
34
|
+
local.get $byte
|
|
35
|
+
local.get $key
|
|
36
|
+
i32.xor
|
|
37
|
+
i32.store8
|
|
38
|
+
local.get $i
|
|
39
|
+
i32.const 1
|
|
40
|
+
i32.add
|
|
41
|
+
local.set $i
|
|
42
|
+
br $for-loop|0
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
)
|
|
46
|
+
)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
(module
|
|
2
|
+
(type $0 (func (param i32 i32 i32)))
|
|
3
|
+
(memory $0 0)
|
|
4
|
+
(export "decrypt" (func $assembly/index/decrypt))
|
|
5
|
+
(export "memory" (memory $0))
|
|
6
|
+
(func $assembly/index/decrypt (param $0 i32) (param $1 i32) (param $2 i32)
|
|
7
|
+
(local $3 i32)
|
|
8
|
+
local.get $1
|
|
9
|
+
i32.const 255
|
|
10
|
+
i32.xor
|
|
11
|
+
local.get $1
|
|
12
|
+
local.get $2
|
|
13
|
+
i32.const 100
|
|
14
|
+
i32.lt_s
|
|
15
|
+
select
|
|
16
|
+
local.set $1
|
|
17
|
+
loop $for-loop|0
|
|
18
|
+
local.get $0
|
|
19
|
+
local.get $3
|
|
20
|
+
i32.gt_s
|
|
21
|
+
if
|
|
22
|
+
local.get $3
|
|
23
|
+
local.get $3
|
|
24
|
+
i32.load8_u
|
|
25
|
+
local.get $1
|
|
26
|
+
i32.xor
|
|
27
|
+
i32.store8
|
|
28
|
+
local.get $3
|
|
29
|
+
i32.const 1
|
|
30
|
+
i32.add
|
|
31
|
+
local.set $3
|
|
32
|
+
br $for-loop|0
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
)
|
|
36
|
+
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@painsel/no-ai-wasm-engine",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "The WebAssembly Decryption Engine used for Anti-AI scraping protection",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"README.md"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"asbuild:untouched": "asc assembly/index.ts --
|
|
13
|
-
"asbuild:optimized": "asc assembly/index.ts --
|
|
12
|
+
"asbuild:untouched": "asc assembly/index.ts -b build/debug.wasm -t build/debug.wat --sourceMap --debug",
|
|
13
|
+
"asbuild:optimized": "asc assembly/index.ts -b build/release.wasm -t build/release.wat -O3 --optimizeLevel 3 --shrinkLevel 1",
|
|
14
14
|
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
|
|
15
15
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
16
16
|
},
|