azot 0.7.2 → 0.8.0
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.
- package/dist/cli/main.cjs +2 -2
- package/dist/lib/main.cjs +43 -0
- package/dist/lib/main.d.cts +14 -1
- package/dist/lib/main.d.ts +14 -1
- package/dist/lib/main.js +42 -0
- package/package.json +2 -2
package/dist/cli/main.cjs
CHANGED
|
@@ -7820,8 +7820,8 @@ license.help = help2;
|
|
|
7820
7820
|
// package.json
|
|
7821
7821
|
var package_default = {
|
|
7822
7822
|
name: "azot",
|
|
7823
|
-
version: "0.
|
|
7824
|
-
description: "Swiss Army knife for pentesting
|
|
7823
|
+
version: "0.8.0",
|
|
7824
|
+
description: "Swiss Army knife for pentesting DRM systems",
|
|
7825
7825
|
type: "module",
|
|
7826
7826
|
files: [
|
|
7827
7827
|
"dist",
|
package/dist/lib/main.cjs
CHANGED
|
@@ -34,6 +34,7 @@ __export(main_exports, {
|
|
|
34
34
|
Client: () => Client,
|
|
35
35
|
Key: () => Key,
|
|
36
36
|
Session: () => Session,
|
|
37
|
+
connect: () => connect,
|
|
37
38
|
fetchDecryptionKeys: () => fetchDecryptionKeys,
|
|
38
39
|
fromBase64: () => fromBase64,
|
|
39
40
|
fromBinary: () => fromBinary,
|
|
@@ -7400,6 +7401,47 @@ var defaultResponseFilter = (response, log = console) => {
|
|
|
7400
7401
|
return response;
|
|
7401
7402
|
};
|
|
7402
7403
|
|
|
7404
|
+
// src/lib/connect.ts
|
|
7405
|
+
var connect = ({ baseUrl, secret }) => {
|
|
7406
|
+
const headers = {
|
|
7407
|
+
"x-secret-key": secret,
|
|
7408
|
+
"content-type": "application/json"
|
|
7409
|
+
};
|
|
7410
|
+
const json = (data) => JSON.stringify(data);
|
|
7411
|
+
const post = async (route, body) => {
|
|
7412
|
+
const response = await fetch(`${baseUrl}${route}`, {
|
|
7413
|
+
method: "POST",
|
|
7414
|
+
headers,
|
|
7415
|
+
body: json(body)
|
|
7416
|
+
});
|
|
7417
|
+
const contentLength = response.headers.get("content-length");
|
|
7418
|
+
if (contentLength === "0") return;
|
|
7419
|
+
return response.json();
|
|
7420
|
+
};
|
|
7421
|
+
const get = async (route) => {
|
|
7422
|
+
const response = await fetch(`${baseUrl}${route}`, {
|
|
7423
|
+
method: "GET",
|
|
7424
|
+
headers
|
|
7425
|
+
});
|
|
7426
|
+
return response.json();
|
|
7427
|
+
};
|
|
7428
|
+
const createSession = async (client) => {
|
|
7429
|
+
const data = await post(`/session`, { client });
|
|
7430
|
+
const sessionId = data.id;
|
|
7431
|
+
const generateRequest = async (initData, initDataType) => {
|
|
7432
|
+
const data2 = await post(`/session/${sessionId}/generate-request`, {
|
|
7433
|
+
initDataType,
|
|
7434
|
+
initData
|
|
7435
|
+
});
|
|
7436
|
+
return data2.licenseRequest;
|
|
7437
|
+
};
|
|
7438
|
+
const update = async (response) => post(`/session/${sessionId}/update`, { response });
|
|
7439
|
+
const keys = async () => get(`/session/${sessionId}/keys`);
|
|
7440
|
+
return { sessionId, generateRequest, update, keys };
|
|
7441
|
+
};
|
|
7442
|
+
return { createSession };
|
|
7443
|
+
};
|
|
7444
|
+
|
|
7403
7445
|
// src/lib/wvd.ts
|
|
7404
7446
|
var VERSION = 2;
|
|
7405
7447
|
var MAGIC = fromText("WVD").toBuffer();
|
|
@@ -7720,6 +7762,7 @@ var fetchDecryptionKeys = async (params) => {
|
|
|
7720
7762
|
Client,
|
|
7721
7763
|
Key,
|
|
7722
7764
|
Session,
|
|
7765
|
+
connect,
|
|
7723
7766
|
fetchDecryptionKeys,
|
|
7724
7767
|
fromBase64,
|
|
7725
7768
|
fromBinary,
|
package/dist/lib/main.d.cts
CHANGED
|
@@ -2396,6 +2396,19 @@ declare class Client {
|
|
|
2396
2396
|
};
|
|
2397
2397
|
}
|
|
2398
2398
|
|
|
2399
|
+
type ConnectParams = {
|
|
2400
|
+
baseUrl: string;
|
|
2401
|
+
secret: string;
|
|
2402
|
+
};
|
|
2403
|
+
declare const connect: ({ baseUrl, secret }: ConnectParams) => {
|
|
2404
|
+
createSession: (client: string) => Promise<{
|
|
2405
|
+
sessionId: any;
|
|
2406
|
+
generateRequest: (initData: string, initDataType: string) => Promise<any>;
|
|
2407
|
+
update: (response: string) => Promise<any>;
|
|
2408
|
+
keys: () => Promise<any>;
|
|
2409
|
+
}>;
|
|
2410
|
+
};
|
|
2411
|
+
|
|
2399
2412
|
declare const fromText: (data: string) => {
|
|
2400
2413
|
toBase64: () => string;
|
|
2401
2414
|
toHex: () => string;
|
|
@@ -2435,4 +2448,4 @@ interface FetchDecryptionKeysParams {
|
|
|
2435
2448
|
}
|
|
2436
2449
|
declare const fetchDecryptionKeys: (params: FetchDecryptionKeysParams) => Promise<Key[]>;
|
|
2437
2450
|
|
|
2438
|
-
export { CLIENT_TYPE, Client, type ClientType, Key, SecurityLevel, Session, fetchDecryptionKeys, fromBase64, fromBinary, fromBuffer, fromHex, fromText };
|
|
2451
|
+
export { CLIENT_TYPE, Client, type ClientType, Key, SecurityLevel, Session, connect, fetchDecryptionKeys, fromBase64, fromBinary, fromBuffer, fromHex, fromText };
|
package/dist/lib/main.d.ts
CHANGED
|
@@ -2396,6 +2396,19 @@ declare class Client {
|
|
|
2396
2396
|
};
|
|
2397
2397
|
}
|
|
2398
2398
|
|
|
2399
|
+
type ConnectParams = {
|
|
2400
|
+
baseUrl: string;
|
|
2401
|
+
secret: string;
|
|
2402
|
+
};
|
|
2403
|
+
declare const connect: ({ baseUrl, secret }: ConnectParams) => {
|
|
2404
|
+
createSession: (client: string) => Promise<{
|
|
2405
|
+
sessionId: any;
|
|
2406
|
+
generateRequest: (initData: string, initDataType: string) => Promise<any>;
|
|
2407
|
+
update: (response: string) => Promise<any>;
|
|
2408
|
+
keys: () => Promise<any>;
|
|
2409
|
+
}>;
|
|
2410
|
+
};
|
|
2411
|
+
|
|
2399
2412
|
declare const fromText: (data: string) => {
|
|
2400
2413
|
toBase64: () => string;
|
|
2401
2414
|
toHex: () => string;
|
|
@@ -2435,4 +2448,4 @@ interface FetchDecryptionKeysParams {
|
|
|
2435
2448
|
}
|
|
2436
2449
|
declare const fetchDecryptionKeys: (params: FetchDecryptionKeysParams) => Promise<Key[]>;
|
|
2437
2450
|
|
|
2438
|
-
export { CLIENT_TYPE, Client, type ClientType, Key, SecurityLevel, Session, fetchDecryptionKeys, fromBase64, fromBinary, fromBuffer, fromHex, fromText };
|
|
2451
|
+
export { CLIENT_TYPE, Client, type ClientType, Key, SecurityLevel, Session, connect, fetchDecryptionKeys, fromBase64, fromBinary, fromBuffer, fromHex, fromText };
|
package/dist/lib/main.js
CHANGED
|
@@ -7355,6 +7355,47 @@ var defaultResponseFilter = (response, log = console) => {
|
|
|
7355
7355
|
return response;
|
|
7356
7356
|
};
|
|
7357
7357
|
|
|
7358
|
+
// src/lib/connect.ts
|
|
7359
|
+
var connect = ({ baseUrl, secret }) => {
|
|
7360
|
+
const headers = {
|
|
7361
|
+
"x-secret-key": secret,
|
|
7362
|
+
"content-type": "application/json"
|
|
7363
|
+
};
|
|
7364
|
+
const json = (data) => JSON.stringify(data);
|
|
7365
|
+
const post = async (route, body) => {
|
|
7366
|
+
const response = await fetch(`${baseUrl}${route}`, {
|
|
7367
|
+
method: "POST",
|
|
7368
|
+
headers,
|
|
7369
|
+
body: json(body)
|
|
7370
|
+
});
|
|
7371
|
+
const contentLength = response.headers.get("content-length");
|
|
7372
|
+
if (contentLength === "0") return;
|
|
7373
|
+
return response.json();
|
|
7374
|
+
};
|
|
7375
|
+
const get = async (route) => {
|
|
7376
|
+
const response = await fetch(`${baseUrl}${route}`, {
|
|
7377
|
+
method: "GET",
|
|
7378
|
+
headers
|
|
7379
|
+
});
|
|
7380
|
+
return response.json();
|
|
7381
|
+
};
|
|
7382
|
+
const createSession = async (client) => {
|
|
7383
|
+
const data = await post(`/session`, { client });
|
|
7384
|
+
const sessionId = data.id;
|
|
7385
|
+
const generateRequest = async (initData, initDataType) => {
|
|
7386
|
+
const data2 = await post(`/session/${sessionId}/generate-request`, {
|
|
7387
|
+
initDataType,
|
|
7388
|
+
initData
|
|
7389
|
+
});
|
|
7390
|
+
return data2.licenseRequest;
|
|
7391
|
+
};
|
|
7392
|
+
const update = async (response) => post(`/session/${sessionId}/update`, { response });
|
|
7393
|
+
const keys = async () => get(`/session/${sessionId}/keys`);
|
|
7394
|
+
return { sessionId, generateRequest, update, keys };
|
|
7395
|
+
};
|
|
7396
|
+
return { createSession };
|
|
7397
|
+
};
|
|
7398
|
+
|
|
7358
7399
|
// src/lib/wvd.ts
|
|
7359
7400
|
var VERSION = 2;
|
|
7360
7401
|
var MAGIC = fromText("WVD").toBuffer();
|
|
@@ -7674,6 +7715,7 @@ export {
|
|
|
7674
7715
|
Client,
|
|
7675
7716
|
Key,
|
|
7676
7717
|
Session,
|
|
7718
|
+
connect,
|
|
7677
7719
|
fetchDecryptionKeys,
|
|
7678
7720
|
fromBase64,
|
|
7679
7721
|
fromBinary,
|