efront 4.30.0 → 4.30.2
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/coms/basic/decodeLEB128.js +16 -2
- package/coms/basic/decodePackW.asm +143 -2
- package/coms/basic/encodeLEB128.js +6 -1
- package/coms/compile/Program.js +0 -1
- package/coms/compile/common.js +1 -1
- package/coms/reptile/window.js +5 -1
- package/coms/third-party/lzma.js +286 -0
- package/coms/third-party/lzma.wasm +0 -0
- package/coms/third-party//344/273/243/347/240/201/346/235/245/346/272/220.txt +2 -0
- package/data/packexe-setup.sfx +0 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/public//346/226/207/344/273/266/347/263/273/347/273/237//344/270/273/351/241/265.jsp +2 -2
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
var pow = Math.pow;
|
|
2
|
+
var min = Math.min;
|
|
1
3
|
function decodeLEB128(buff) {
|
|
2
4
|
var dist = [];
|
|
3
5
|
var temp = 0, delta = 0;
|
|
4
|
-
|
|
6
|
+
var blength = buff.length;
|
|
7
|
+
for (var cx = 0, dx = min(4, blength); cx < dx; cx++) {
|
|
5
8
|
var b = buff[cx];
|
|
6
|
-
temp = temp + ((b & 0x7f) << delta)
|
|
9
|
+
temp = temp + ((b & 0x7f) << delta);
|
|
10
|
+
if (b >> 7) {
|
|
11
|
+
delta += 7;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
dist.push(temp);
|
|
15
|
+
temp = 0;
|
|
16
|
+
delta = 0;
|
|
17
|
+
}
|
|
18
|
+
for (var cx = 4, dx = blength; cx < dx; cx++) {
|
|
19
|
+
var b = buff[cx];
|
|
20
|
+
temp = temp + (b & 0x7f) * pow(2, delta)
|
|
7
21
|
if (b >> 7) {
|
|
8
22
|
delta += 7;
|
|
9
23
|
continue;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
.data
|
|
2
|
+
; LzmaLib.inc
|
|
3
|
+
LzmaUncompress PROTO :PTR BYTE, :PTR DWORD, :PTR BYTE, :PTR DWORD
|
|
4
|
+
includelib LzmaLib.lib; https://github.com/yunxu1019/7zip 编译命令为 wasm\build-lib.bat
|
|
5
|
+
include windows.inc
|
|
6
|
+
includelib Kernel32.lib
|
|
2
7
|
errortext db "数据异常"
|
|
3
8
|
errortitle db "错误"
|
|
9
|
+
errorcode db "编码错误"
|
|
10
|
+
mtime FILETIME <0,0>
|
|
4
11
|
normal_huffman equ 0
|
|
5
12
|
normal_repeat1 equ 1
|
|
6
13
|
normal_repeat2 equ 2
|
|
@@ -8,7 +15,11 @@ normal_nocode1 equ 3
|
|
|
8
15
|
normal_nocode2 equ 4
|
|
9
16
|
normal_nocode3 equ 5
|
|
10
17
|
repeat_huffman equ 6
|
|
11
|
-
|
|
18
|
+
other_compress equ 7
|
|
19
|
+
normal_nocode4 equ 3
|
|
20
|
+
mtime_stamp equ 5;
|
|
21
|
+
access_mode equ 6;
|
|
22
|
+
lzma_3rd_party equ 7;
|
|
12
23
|
.code
|
|
13
24
|
|
|
14
25
|
fill proc start,leng,a
|
|
@@ -479,8 +490,55 @@ memcopy proc start,len,dist
|
|
|
479
490
|
ret
|
|
480
491
|
memcopy endp
|
|
481
492
|
|
|
493
|
+
|
|
494
|
+
; 输入:EDX:EAX = JavaScript时间戳(64位毫秒值)
|
|
495
|
+
; 输出:EDX:EAX = Windows FileTime(64位)
|
|
496
|
+
jsDateToFileTime proc
|
|
497
|
+
push ebx
|
|
498
|
+
push ecx
|
|
499
|
+
push esi
|
|
500
|
+
push edi
|
|
501
|
+
|
|
502
|
+
; 保存原始输入值
|
|
503
|
+
mov ebx, eax ; 低32位
|
|
504
|
+
mov ecx, edx ; 高32位
|
|
505
|
+
; 乘以10000 (0x2710)
|
|
506
|
+
; 先计算低32位 * 10000
|
|
507
|
+
mov eax, ebx
|
|
508
|
+
mov edx, 10000
|
|
509
|
+
mul edx ; EDX:EAX = EBX * 10000
|
|
510
|
+
mov esi, eax ; 保存乘积低32位
|
|
511
|
+
mov edi, edx ; 保存乘积高32位
|
|
512
|
+
|
|
513
|
+
; 再计算高32位 * 10000
|
|
514
|
+
mov eax, ecx
|
|
515
|
+
mov edx, 10000
|
|
516
|
+
mul edx ; EDX:EAX = ECX * 10000
|
|
517
|
+
add edi, eax ; 累加到乘积高32位
|
|
518
|
+
|
|
519
|
+
; 19db1ded53e8000
|
|
520
|
+
; 加上基准差值低32位
|
|
521
|
+
add esi, 0d53e8000h
|
|
522
|
+
adc edi, 0
|
|
523
|
+
|
|
524
|
+
; 加上基准差值高32位
|
|
525
|
+
mov eax, 019db1deh
|
|
526
|
+
add edi, eax
|
|
527
|
+
|
|
528
|
+
; 返回结果
|
|
529
|
+
mov eax, esi ; 低32位
|
|
530
|
+
mov edx, edi ; 高32位
|
|
531
|
+
|
|
532
|
+
pop edi
|
|
533
|
+
pop esi
|
|
534
|
+
pop ecx
|
|
535
|
+
pop ebx
|
|
536
|
+
ret
|
|
537
|
+
jsDateToFileTime endp
|
|
538
|
+
|
|
539
|
+
|
|
482
540
|
unpack proc start,len,dsth,passed
|
|
483
|
-
local writed,buff,bufflen,byteoffset,decoded,count,to
|
|
541
|
+
local writed,buff,bufflen,byteoffset,decoded,count,to,type1
|
|
484
542
|
local passed0
|
|
485
543
|
mov writed,0
|
|
486
544
|
mov eax,len
|
|
@@ -622,6 +680,87 @@ unpack proc start,len,dsth,passed
|
|
|
622
680
|
add ecx,4
|
|
623
681
|
add ecx,count
|
|
624
682
|
mov to,ecx
|
|
683
|
+
.elseif eax==other_compress
|
|
684
|
+
movzx eax,byte ptr[ecx]
|
|
685
|
+
local srclen,clen
|
|
686
|
+
mov type1,eax
|
|
687
|
+
xor eax, eax
|
|
688
|
+
mov al, byte ptr[ecx+1];
|
|
689
|
+
and al, 01fh;
|
|
690
|
+
.if eax>4
|
|
691
|
+
invoke MessageBox,NULL,offset errortext,offset errortitle,MB_OK
|
|
692
|
+
invoke ExitProcess,1
|
|
693
|
+
.endif
|
|
694
|
+
xor ebx,ebx
|
|
695
|
+
add ecx,2
|
|
696
|
+
.while eax>0
|
|
697
|
+
shl ebx,8
|
|
698
|
+
mov bl,byte ptr[ecx]
|
|
699
|
+
inc ecx
|
|
700
|
+
dec eax
|
|
701
|
+
.endw
|
|
702
|
+
mov clen,ebx
|
|
703
|
+
mov count,ebx
|
|
704
|
+
mov to,ecx
|
|
705
|
+
mov eax,type1;
|
|
706
|
+
.if eax == normal_nocode4
|
|
707
|
+
invoke GlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,count
|
|
708
|
+
mov decoded,eax
|
|
709
|
+
mov ecx,to
|
|
710
|
+
invoke memcopy,ecx,clen,decoded
|
|
711
|
+
mov ecx,to
|
|
712
|
+
add ecx,clen
|
|
713
|
+
.elseif eax == lzma_3rd_party
|
|
714
|
+
mov ecx,to
|
|
715
|
+
mov eax,[ecx]
|
|
716
|
+
mov count,eax
|
|
717
|
+
invoke GlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,count
|
|
718
|
+
mov decoded,eax
|
|
719
|
+
mov ecx,to
|
|
720
|
+
add ecx,4
|
|
721
|
+
mov eax,clen
|
|
722
|
+
sub eax,4
|
|
723
|
+
mov srclen,eax
|
|
724
|
+
invoke LzmaUncompress,decoded,addr count,ecx,addr srclen
|
|
725
|
+
.elseif eax == mtime_stamp;
|
|
726
|
+
mov eax,20250722h
|
|
727
|
+
mov eax,clen
|
|
728
|
+
mov ecx,to
|
|
729
|
+
push edx
|
|
730
|
+
xor ebx,ebx
|
|
731
|
+
push esi
|
|
732
|
+
xor edx,edx
|
|
733
|
+
.while eax>0
|
|
734
|
+
dec eax
|
|
735
|
+
push eax
|
|
736
|
+
mov esi,edx
|
|
737
|
+
shld edx,ebx,7
|
|
738
|
+
shl ebx,7
|
|
739
|
+
mov al,[ecx+eax]
|
|
740
|
+
shl al,1
|
|
741
|
+
mov bl,al
|
|
742
|
+
pop eax
|
|
743
|
+
.endw
|
|
744
|
+
mov eax,esi
|
|
745
|
+
shrd ebx,edx,1
|
|
746
|
+
pop esi
|
|
747
|
+
shl eax,7;
|
|
748
|
+
rcr edx,1
|
|
749
|
+
mov eax,ebx
|
|
750
|
+
call jsDateToFileTime
|
|
751
|
+
mov mtime.dwHighDateTime,edx
|
|
752
|
+
mov mtime.dwLowDateTime,eax
|
|
753
|
+
pop edx
|
|
754
|
+
mov count,0
|
|
755
|
+
.elseif eax == access_mode;暂不支持
|
|
756
|
+
mov count,0
|
|
757
|
+
.else
|
|
758
|
+
invoke MessageBox,NULL,offset errorcode, offset errortitle,MB_OK
|
|
759
|
+
invoke ExitProcess,1
|
|
760
|
+
.endif
|
|
761
|
+
mov ecx,to
|
|
762
|
+
add ecx,clen
|
|
763
|
+
mov to, ecx
|
|
625
764
|
.else
|
|
626
765
|
invoke MessageBox,NULL,offset errortext,offset errortitle,MB_OK
|
|
627
766
|
invoke ExitProcess,1
|
|
@@ -667,7 +806,9 @@ decodePackW proc srch,start,len,dsth,passed
|
|
|
667
806
|
mov eax,95577h
|
|
668
807
|
mov eax,DWORD ptr[ecx]
|
|
669
808
|
shr eax,5
|
|
809
|
+
invoke GetSystemTimeAsFileTime,offset mtime
|
|
670
810
|
invoke unpack,buff,len,dsth,passed
|
|
811
|
+
invoke SetFileTime,dsth,NULL,NULL,offset mtime
|
|
671
812
|
invoke GlobalFree,buff
|
|
672
813
|
ret
|
|
673
814
|
decodePackW endp
|
|
@@ -2,10 +2,15 @@ function encodeLEB128(buff) {
|
|
|
2
2
|
var dist = [];
|
|
3
3
|
for (var cx = 0, dx = buff.length; cx < dx; cx++) {
|
|
4
4
|
var b = buff[cx];
|
|
5
|
+
while (b > 0xffffffff) {
|
|
6
|
+
var t = b % 0x80;
|
|
7
|
+
dist.push(t | 0b10000000);
|
|
8
|
+
b = (b - t) / 0x80;
|
|
9
|
+
}
|
|
5
10
|
while (b > 127) {
|
|
6
11
|
var t = b & 0x7f;
|
|
7
12
|
dist.push(t | 0b10000000);
|
|
8
|
-
b = b
|
|
13
|
+
b = b >>> 7;
|
|
9
14
|
}
|
|
10
15
|
dist.push(b);
|
|
11
16
|
}
|
package/coms/compile/Program.js
CHANGED
|
@@ -894,7 +894,6 @@ class Program {
|
|
|
894
894
|
if (last.isExpress && powermap[m] <= powermap["++"]) {
|
|
895
895
|
break test;
|
|
896
896
|
}
|
|
897
|
-
console.log(last.isExpress, queue.inExpress, last.entry, last.prev?.text, m);
|
|
898
897
|
if (queue.inExpress && !iscomment) break test;
|
|
899
898
|
break;
|
|
900
899
|
case STAMP:
|
package/coms/compile/common.js
CHANGED
package/coms/reptile/window.js
CHANGED
|
@@ -11,17 +11,20 @@ else {
|
|
|
11
11
|
'Date', 'Promise', 'Function',
|
|
12
12
|
'RegExp', 'Object', 'String',
|
|
13
13
|
'Array', 'Number', 'Boolean',
|
|
14
|
-
'Error', 'TypeError', 'Uint8Array',
|
|
14
|
+
'Error', 'TypeError', 'Uint8Array',"DataView",
|
|
15
15
|
'Uint16Array', 'Uint32Array', 'Uint8ClampedArray',
|
|
16
16
|
'ArrayBuffer', 'Int8Array', 'Int16Array',
|
|
17
17
|
'Int32Array', 'Float32Array', 'Float64Array',
|
|
18
18
|
'Map', 'Set', 'Proxy',
|
|
19
19
|
'WeakMap', 'Reflect', 'console',
|
|
20
|
+
"WebAssembly",
|
|
20
21
|
'Math', 'JSON', 'NaN',
|
|
21
22
|
'Infinity', 'isNaN', 'isFinite',
|
|
22
23
|
'parseInt', 'parseFloat', 'decodeURI',
|
|
23
24
|
'encodeURI', 'decodeURIComponent', 'encodeURIComponent',
|
|
24
25
|
'document', 'navigator', 'process',
|
|
26
|
+
"BigUint64Array",
|
|
27
|
+
"i18n",
|
|
25
28
|
'BigInt64Array', 'Buffer', 'Intl',
|
|
26
29
|
'BigInt', 'Symbol', 'SharedArrayBuffer',
|
|
27
30
|
'escape', 'unescape', 'clearImmediate',
|
|
@@ -34,4 +37,5 @@ else {
|
|
|
34
37
|
});
|
|
35
38
|
window.globalThis = window.global = window.top = window.window = window;
|
|
36
39
|
module.exports = window;
|
|
40
|
+
for(var k in global)if((!(k in window)))console.log(k)
|
|
37
41
|
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
|
|
2
|
+
var Module = typeof Module != "undefined" ? Module : {};
|
|
3
|
+
var quit_ = (status, toThrow) => { throw toThrow };
|
|
4
|
+
var scriptDirectory = "";
|
|
5
|
+
function locateFile(path) {
|
|
6
|
+
if (Module["locateFile"]) { return Module["locateFile"](path, scriptDirectory) }
|
|
7
|
+
return scriptDirectory + path
|
|
8
|
+
}
|
|
9
|
+
var readAsync, readBinary;
|
|
10
|
+
var fs = require("fs");
|
|
11
|
+
scriptDirectory = __dirname + "/";
|
|
12
|
+
readBinary = filename => {
|
|
13
|
+
filename = isFileURI(filename) ? new URL(filename) : filename;
|
|
14
|
+
var ret = fs.readFileSync(filename);
|
|
15
|
+
return ret
|
|
16
|
+
};
|
|
17
|
+
readAsync = async (filename, binary = true) => {
|
|
18
|
+
filename = isFileURI(filename) ? new URL(filename) : filename;
|
|
19
|
+
var ret = fs.readFileSync(filename, binary ? undefined : "utf8");
|
|
20
|
+
return ret
|
|
21
|
+
};
|
|
22
|
+
if (process.argv.length > 1) { thisProgram = process.argv[1].replace(/\\/g, "/") }
|
|
23
|
+
arguments_ = process.argv.slice(2);
|
|
24
|
+
if (typeof module != "undefined") { module["exports"] = Module }
|
|
25
|
+
quit_ = (status, toThrow) => {
|
|
26
|
+
process.exitCode = status;
|
|
27
|
+
throw toThrow
|
|
28
|
+
}
|
|
29
|
+
var err = console.error.bind(console);
|
|
30
|
+
var wasmBinary;
|
|
31
|
+
var ABORT = false;
|
|
32
|
+
var isFileURI = filename => filename.startsWith("file://");
|
|
33
|
+
var wasmMemory;
|
|
34
|
+
var HEAP8, HEAPU8;
|
|
35
|
+
function updateMemoryViews() {
|
|
36
|
+
var b = wasmMemory.buffer;
|
|
37
|
+
HEAP8 = new Int8Array(b);
|
|
38
|
+
HEAPU8 = new Uint8Array(b);
|
|
39
|
+
}
|
|
40
|
+
function preRun() {
|
|
41
|
+
if (Module["preRun"]) {
|
|
42
|
+
if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]];
|
|
43
|
+
while (Module["preRun"].length) { addOnPreRun(Module["preRun"].shift()) }
|
|
44
|
+
}
|
|
45
|
+
callRuntimeCallbacks(onPreRuns)
|
|
46
|
+
}
|
|
47
|
+
function initRuntime() {
|
|
48
|
+
runtimeInitialized = true;
|
|
49
|
+
wasmExports["c"]()
|
|
50
|
+
}
|
|
51
|
+
function postRun() {
|
|
52
|
+
if (Module["postRun"]) {
|
|
53
|
+
if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]];
|
|
54
|
+
while (Module["postRun"].length) { addOnPostRun(Module["postRun"].shift()) }
|
|
55
|
+
}
|
|
56
|
+
callRuntimeCallbacks(onPostRuns)
|
|
57
|
+
}
|
|
58
|
+
var runDependencies = 0;
|
|
59
|
+
var dependenciesFulfilled = null;
|
|
60
|
+
function addRunDependency(id) {
|
|
61
|
+
runDependencies++;
|
|
62
|
+
Module["monitorRunDependencies"]?.(runDependencies)
|
|
63
|
+
}
|
|
64
|
+
function removeRunDependency(id) {
|
|
65
|
+
runDependencies--;
|
|
66
|
+
Module["monitorRunDependencies"]?.(runDependencies);
|
|
67
|
+
if (runDependencies == 0) {
|
|
68
|
+
if (dependenciesFulfilled) {
|
|
69
|
+
var callback = dependenciesFulfilled;
|
|
70
|
+
dependenciesFulfilled = null;
|
|
71
|
+
callback()
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function abort(what) {
|
|
76
|
+
Module["onAbort"]?.(what);
|
|
77
|
+
what = "Aborted(" + what + ")";
|
|
78
|
+
err(what);
|
|
79
|
+
ABORT = true;
|
|
80
|
+
what += ". Build with -sASSERTIONS for more info.";
|
|
81
|
+
var e = new WebAssembly.RuntimeError(what);
|
|
82
|
+
throw e
|
|
83
|
+
}
|
|
84
|
+
var wasmBinaryFile;
|
|
85
|
+
function findWasmBinary() { return locateFile("lzma.wasm") }
|
|
86
|
+
function getBinarySync(file) {
|
|
87
|
+
if (file == wasmBinaryFile && wasmBinary) { return new Uint8Array(wasmBinary) }
|
|
88
|
+
if (readBinary) { return readBinary(file) }
|
|
89
|
+
throw "both async and sync fetching of the wasm failed"
|
|
90
|
+
}
|
|
91
|
+
async function getWasmBinary(binaryFile) {
|
|
92
|
+
if (!wasmBinary) {
|
|
93
|
+
try {
|
|
94
|
+
var response = await readAsync(binaryFile);
|
|
95
|
+
return new Uint8Array(response)
|
|
96
|
+
} catch { }
|
|
97
|
+
}
|
|
98
|
+
return getBinarySync(binaryFile)
|
|
99
|
+
}
|
|
100
|
+
async function instantiateArrayBuffer(binaryFile, imports) {
|
|
101
|
+
try {
|
|
102
|
+
var binary = await getWasmBinary(binaryFile);
|
|
103
|
+
var instance = await WebAssembly.instantiate(binary, imports);
|
|
104
|
+
return instance
|
|
105
|
+
} catch (reason) {
|
|
106
|
+
err(`failed to asynchronously prepare wasm: ${reason}`);
|
|
107
|
+
abort(reason)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function instantiateAsync(binary, binaryFile, imports) {
|
|
111
|
+
return instantiateArrayBuffer(binaryFile, imports)
|
|
112
|
+
}
|
|
113
|
+
function getWasmImports() {
|
|
114
|
+
return {
|
|
115
|
+
a: wasmImports
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async function createWasm() {
|
|
119
|
+
function receiveInstance(instance, module) {
|
|
120
|
+
wasmExports = instance.exports;
|
|
121
|
+
wasmMemory = wasmExports["b"];
|
|
122
|
+
updateMemoryViews();
|
|
123
|
+
assignWasmExports(wasmExports);
|
|
124
|
+
removeRunDependency("wasm-instantiate");
|
|
125
|
+
return wasmExports
|
|
126
|
+
}
|
|
127
|
+
addRunDependency("wasm-instantiate");
|
|
128
|
+
function receiveInstantiationResult(result) { return receiveInstance(result["instance"]) }
|
|
129
|
+
var info = getWasmImports();
|
|
130
|
+
if (Module["instantiateWasm"]) { return new Promise((resolve, reject) => { Module["instantiateWasm"](info, (mod, inst) => { resolve(receiveInstance(mod, inst)) }) }) }
|
|
131
|
+
wasmBinaryFile ??= findWasmBinary();
|
|
132
|
+
var result = await instantiateAsync(wasmBinary, wasmBinaryFile, info);
|
|
133
|
+
var exports = receiveInstantiationResult(result);
|
|
134
|
+
return exports
|
|
135
|
+
}
|
|
136
|
+
var callRuntimeCallbacks = callbacks => { while (callbacks.length > 0) { callbacks.shift()(Module) } };
|
|
137
|
+
var onPostRuns = [];
|
|
138
|
+
var addOnPostRun = cb => onPostRuns.push(cb);
|
|
139
|
+
var onPreRuns = [];
|
|
140
|
+
var addOnPreRun = cb => onPreRuns.push(cb);
|
|
141
|
+
var stackRestore = val => __emscripten_stack_restore(val);
|
|
142
|
+
var stackSave = () => _emscripten_stack_get_current();
|
|
143
|
+
var getHeapMax = () => 2147483648;
|
|
144
|
+
var alignMemory = (size, alignment) => Math.ceil(size / alignment) * alignment;
|
|
145
|
+
var growMemory = size => {
|
|
146
|
+
var oldHeapSize = wasmMemory.buffer.byteLength;
|
|
147
|
+
var pages = (size - oldHeapSize + 65535) / 65536 | 0;
|
|
148
|
+
try {
|
|
149
|
+
wasmMemory.grow(pages);
|
|
150
|
+
updateMemoryViews();
|
|
151
|
+
return 1
|
|
152
|
+
}
|
|
153
|
+
catch (e) { }
|
|
154
|
+
};
|
|
155
|
+
var _emscripten_resize_heap = requestedSize => {
|
|
156
|
+
var oldSize = HEAPU8.length;
|
|
157
|
+
requestedSize >>>= 0;
|
|
158
|
+
var maxHeapSize = getHeapMax();
|
|
159
|
+
if (requestedSize > maxHeapSize) { return false }
|
|
160
|
+
for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
|
|
161
|
+
var overGrownHeapSize = oldSize * (1 + .2 / cutDown);
|
|
162
|
+
overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
|
|
163
|
+
var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536));
|
|
164
|
+
var replacement = growMemory(newSize);
|
|
165
|
+
if (replacement) { return true }
|
|
166
|
+
}
|
|
167
|
+
return false
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var writeArrayToMemory = (array, buffer) => { HEAP8.set(array, buffer) };
|
|
171
|
+
var stackAlloc = sz => __emscripten_stack_alloc(sz);
|
|
172
|
+
var toC = {
|
|
173
|
+
array: arr => {
|
|
174
|
+
if (!arr) return arr;
|
|
175
|
+
if (arr.buffer === HEAP8.buffer) return arr.byteOffset;
|
|
176
|
+
var ret = stackAlloc(arr.length);
|
|
177
|
+
writeArrayToMemory(arr, ret);
|
|
178
|
+
return ret
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
var setUint32LE = function (a, v) {
|
|
182
|
+
a[0] = v & 0xff;
|
|
183
|
+
a[1] = v >>> 8 & 0xff
|
|
184
|
+
a[2] = v >>> 16 & 0xff
|
|
185
|
+
a[3] = v >>> 24 & 0xff
|
|
186
|
+
};
|
|
187
|
+
var getUint32LE = function (a) {
|
|
188
|
+
return (a[0] | a[1] << 8 | a[2] << 16 | a[3] << 24) >>> 0;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
var fcall = function (func, input, outLength) {
|
|
192
|
+
var cArgs = [];
|
|
193
|
+
var stack = stackSave();
|
|
194
|
+
var argTypes = ["array", "number", "array", "number"];
|
|
195
|
+
var output = outLength > 0 ? alloc(outLength) : null;
|
|
196
|
+
var outOffset = output?.byteOffset;
|
|
197
|
+
var args = [output, outLength, input, input.length];
|
|
198
|
+
if (args) {
|
|
199
|
+
for (var i = 0; i < args.length; i++) {
|
|
200
|
+
var converter = toC[argTypes[i]];
|
|
201
|
+
if (converter) {
|
|
202
|
+
cArgs[i] = converter(args[i])
|
|
203
|
+
}
|
|
204
|
+
else { cArgs[i] = args[i] }
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function onDone(ret) {
|
|
208
|
+
if (ret > 0) {
|
|
209
|
+
var result = new Uint8Array(ret + 4);
|
|
210
|
+
setUint32LE(result, input.length);
|
|
211
|
+
result.set(HEAP8.subarray(outOffset, outOffset + ret), 4);
|
|
212
|
+
}
|
|
213
|
+
if (ret < 0) throw console.log(ret), new Error("编码错误!");
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
var ret = func(...cArgs);
|
|
217
|
+
if (outLength > 0) ret = onDone(ret);
|
|
218
|
+
stackRestore(stack);
|
|
219
|
+
return ret;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
Module.decompress = function (input) {
|
|
223
|
+
var size = getUint32LE(input);
|
|
224
|
+
var output = fcall(decompress, input.subarray(4, input.length), size);
|
|
225
|
+
return output.subarray(4, output.length);
|
|
226
|
+
};
|
|
227
|
+
Module.compress = function (input) {
|
|
228
|
+
return fcall(compress, input, input.length + (input.length >> 1) + 200);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var alloc = function (size) {
|
|
232
|
+
var offset = stackAlloc(size);
|
|
233
|
+
if (offset < 0) throw new Error('申请内存失败');
|
|
234
|
+
var res = new Uint8Array(HEAP8.buffer, offset, size);
|
|
235
|
+
return res;
|
|
236
|
+
}
|
|
237
|
+
var __emscripten_stack_restore, __emscripten_stack_alloc, _emscripten_stack_get_current;
|
|
238
|
+
var compress, decompress;
|
|
239
|
+
function assignWasmExports(wasmExports) {
|
|
240
|
+
compress = wasmExports["d"];
|
|
241
|
+
decompress = wasmExports["e"];
|
|
242
|
+
__emscripten_stack_restore = wasmExports["f"];
|
|
243
|
+
__emscripten_stack_alloc = wasmExports["g"];
|
|
244
|
+
_emscripten_stack_get_current = wasmExports["h"]
|
|
245
|
+
}
|
|
246
|
+
var wasmImports = {
|
|
247
|
+
a: _emscripten_resize_heap
|
|
248
|
+
};
|
|
249
|
+
var wasmExports;
|
|
250
|
+
createWasm();
|
|
251
|
+
function run() {
|
|
252
|
+
if (runDependencies > 0) {
|
|
253
|
+
dependenciesFulfilled = run;
|
|
254
|
+
return
|
|
255
|
+
}
|
|
256
|
+
preRun();
|
|
257
|
+
if (runDependencies > 0) {
|
|
258
|
+
dependenciesFulfilled = run;
|
|
259
|
+
return
|
|
260
|
+
}
|
|
261
|
+
function doRun() {
|
|
262
|
+
Module["calledRun"] = true;
|
|
263
|
+
if (ABORT) return;
|
|
264
|
+
initRuntime();
|
|
265
|
+
Module["onRuntimeInitialized"]?.();
|
|
266
|
+
postRun()
|
|
267
|
+
}
|
|
268
|
+
if (Module["setStatus"]) {
|
|
269
|
+
Module["setStatus"]("Running...");
|
|
270
|
+
setTimeout(() => {
|
|
271
|
+
setTimeout(() => Module["setStatus"](""), 1);
|
|
272
|
+
doRun()
|
|
273
|
+
}, 1)
|
|
274
|
+
}
|
|
275
|
+
else { doRun() }
|
|
276
|
+
}
|
|
277
|
+
function preInit() {
|
|
278
|
+
if (Module["preInit"]) {
|
|
279
|
+
if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]];
|
|
280
|
+
while (Module["preInit"].length > 0) { Module["preInit"].shift()() }
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
preInit();
|
|
284
|
+
run();
|
|
285
|
+
|
|
286
|
+
|
|
Binary file
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
第三方代码来源及日期,后续版本请自行更新
|
|
2
|
+
2025-07-17 https://github.com/ip7z/7zip
|
|
3
|
+
https://github.com/yunxu1019/7zip 已编译为 lzma.wasm, lzma.js 已改写
|
|
2
4
|
2022-12-30 https://npmjs.com/package/crypto-js
|
|
3
5
|
2022-11-12 https://github.com/kazuhikoarase/qrcode-generator 逻辑有修改 qrcode.js
|
|
4
6
|
2021-06-15 https://www.npmjs.com/package/html2canvas
|
package/data/packexe-setup.sfx
CHANGED
|
Binary file
|