1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
| const fs = require("fs") const http = require('http')
var Vi; var Na = 0; var Qe = typeof Qe < "u" ? Qe : {}; function Vie() { var e = cy.buffer; Qe.HEAP8 = new Int8Array(e), Qe.HEAP16 = new Int16Array(e), Qe.HEAPU8 = Dp = new Uint8Array(e), Qe.HEAPU16 = new Uint16Array(e), Qe.HEAP32 = new Int32Array(e), Qe.HEAPU32 = new Uint32Array(e), Qe.HEAPF32 = new Float32Array(e), Qe.HEAPF64 = new Float64Array(e) } function Die(e) { var t; Na++, (t = Qe.monitorRunDependencies) == null || t.call(Qe, Na) } function vy(e) { var n; (n = Qe.onAbort) == null || n.call(Qe, e), e = "Aborted(" + e + ")", Ii(e), dy = !0, e += ". Build with -sASSERTIONS for more info."; var t = new WebAssembly.RuntimeError(e); throw t } var Uie = (e, t, n) => Dp.copyWithin(e, t, t + n) , Yie = e => { vy("OOM") } , Gie = e => { Dp.length, Yie() } , Xie = { b: Uie, a: Gie }; function jie(e, t, n, o) { const r = fs.readFileSync('decrypt.wasm'); let b = WebAssembly.instantiate(r,n); return b.then(function(e) { let Xr = e.instance.exports; console.log(Xr) var cy = Xr.c; Qe._get_secret = (e, t, n) => (Qe._get_secret = Xr.e)(e, t, n); Qe._malloc = e => (Qe._malloc = Xr.f)(e); Qe._free = e => (Qe._free = Xr.g)(e); Qe._decrypt = (e, t, n, o) => (Qe._decrypt = Xr.h)(e, t, n, o); function Rh(e) { if (Qe == null) return ""; Qe.HEAPU8 = Dp = new Uint8Array(cy.buffer) let t = Qe.HEAPU8 , n = new TextEncoder("utf-8") , o = new TextDecoder("utf-8"); const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; let a = ""; for (let m = 0; m < 256; m++) a += r.charAt(Math.floor(Math.random() * r.Length)); let l = n.encode(a); const s = Qe._malloc(l.length + 1); for (let m = 0; m < l.length; m++){ t[s + m] = l[m]; } let u = Math.floor(new Date().getTime() / 1e3) , c = Qe._get_secret(s, u, l.length); if (c == 0) return ""; let f = n.encode(e); const d = Qe._malloc(f.length + 1); for (let m = 0; m < f.length; m++) t[d + m] = f[m]; let p = 0 , v = 0; try { if (p = Qe._decrypt(d, s, c, f.length), p == 0) return ""; for (v = 0; v < t.length && t[p + v] != 0; v++) ; return o.decode(t.subarray(p, p + v)) } catch (m) { return m } finally { s != 0 && Qe._free(s), c != 0 && Qe._free(c), d != 0 && Qe._free(d), p != 0 && Qe._free(p) } } return Rh } ) } function qie() { var e = { a: Xie }; function t(o, r) { return Xr = o.exports, cy = Xr.c, Vie(), Hie(Xr.d), Fie(), Xr } Die(); function n(o) { t(o.instance) } if (Qe.instantiateWasm) try { return Qe.instantiateWasm(e, t) } catch (o) { return Ii(`Module.instantiateWasm callback failed with error: ${o}`), !1 } return jie(Vi, "Al", e, n) }
var promise_test = qie();
const server = http.createServer();
server.on('request',(req,res)=>{ let postParams = '' req.on('data',(parmas)=>{ postParams += parmas }) req.on('end',()=>{ promise_test.then((F)=>{ var result = F(postParams); console.log(result) res.end(result) }) }) }) server.listen(3000,(err)=>{ if( !err ){ console.log('服务器已经开启 我们可以通过http://127.0.0.1:3000 来访问'); } })
|