azot 0.4.7 → 0.5.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/README.md +17 -15
- package/dist/chunk-3PKGQRBD.js +21 -0
- package/dist/cli.cjs +18 -8001
- package/dist/cli.js +7 -337
- package/dist/lib.cjs +12 -7708
- package/dist/lib.d.cts +33 -33
- package/dist/lib.d.ts +33 -33
- package/dist/lib.js +1 -24
- package/package.json +7 -4
- package/scripts/postinstall.js +4 -4
- package/dist/chunk-LSX4EP25.js +0 -7672
package/dist/lib.d.cts
CHANGED
|
@@ -2323,6 +2323,30 @@ declare const SESSION_TYPES: {
|
|
|
2323
2323
|
readonly 'persistent-license': 1;
|
|
2324
2324
|
};
|
|
2325
2325
|
type SessionType = keyof typeof SESSION_TYPES;
|
|
2326
|
+
/**
|
|
2327
|
+
* https://www.w3.org/TR/encrypted-media-2/#mediakeysession-interface
|
|
2328
|
+
*/
|
|
2329
|
+
declare class Session extends EventTarget implements MediaKeySession {
|
|
2330
|
+
#private;
|
|
2331
|
+
readonly sessionId: string;
|
|
2332
|
+
readonly keyStatuses: MediaKeyStatusMap;
|
|
2333
|
+
readonly keys: Map<string, Key>;
|
|
2334
|
+
readonly expiration: number;
|
|
2335
|
+
readonly closed: Promise<MediaKeySessionClosedReason>;
|
|
2336
|
+
onmessage: ((this: MediaKeySession, ev: MediaKeyMessageEvent) => any) | null;
|
|
2337
|
+
onkeyschange: ((this: MediaKeySession, ev: Event) => any) | null;
|
|
2338
|
+
onkeystatuseschange: ((this: MediaKeySession, ev: Event) => any) | null;
|
|
2339
|
+
sessionType: SessionType;
|
|
2340
|
+
privacyMode?: boolean;
|
|
2341
|
+
constructor(sessionType: SessionType | undefined, client: Client);
|
|
2342
|
+
setLogger(logger: Logger): void;
|
|
2343
|
+
generateRequest(initDataType: string, initData: BufferSource): Promise<void>;
|
|
2344
|
+
waitForLicenseRequest(): Promise<Uint8Array>;
|
|
2345
|
+
load(): Promise<boolean>;
|
|
2346
|
+
update(response: Uint8Array): Promise<void>;
|
|
2347
|
+
close(): Promise<void>;
|
|
2348
|
+
remove(): Promise<void>;
|
|
2349
|
+
}
|
|
2326
2350
|
|
|
2327
2351
|
declare const CLIENT_TYPE: {
|
|
2328
2352
|
readonly android: "android";
|
|
@@ -2332,7 +2356,7 @@ type ClientType = (typeof CLIENT_TYPE)[keyof typeof CLIENT_TYPE];
|
|
|
2332
2356
|
type SecurityLevel = 1 | 2 | 3;
|
|
2333
2357
|
declare class Client {
|
|
2334
2358
|
#private;
|
|
2335
|
-
|
|
2359
|
+
id: ClientIdentification;
|
|
2336
2360
|
type: ClientType;
|
|
2337
2361
|
securityLevel: SecurityLevel;
|
|
2338
2362
|
signedDrmCertificate: SignedDrmCertificate;
|
|
@@ -2340,15 +2364,15 @@ declare class Client {
|
|
|
2340
2364
|
systemId: number;
|
|
2341
2365
|
vmp: FileHashes | null;
|
|
2342
2366
|
info: Map<string, string>;
|
|
2343
|
-
static
|
|
2344
|
-
static
|
|
2367
|
+
static fromPacked(data: Uint8Array, format?: 'WVDv2'): Promise<Client>;
|
|
2368
|
+
static fromUnpacked(id: Uint8Array, key: Uint8Array, vmp?: Uint8Array): Promise<Client>;
|
|
2345
2369
|
get key(): {
|
|
2346
2370
|
forDecrypt: CryptoKey;
|
|
2347
2371
|
forSign: CryptoKey;
|
|
2348
2372
|
};
|
|
2349
2373
|
constructor(id: Uint8Array, type?: ClientType, securityLevel?: SecurityLevel);
|
|
2350
|
-
|
|
2351
|
-
|
|
2374
|
+
unpack(): Promise<[id: Uint8Array, key: Uint8Array]>;
|
|
2375
|
+
pack(format?: 'WVDv2'): Promise<Uint8Array>;
|
|
2352
2376
|
importKey(pkcs1: Uint8Array): Promise<{
|
|
2353
2377
|
forDecrypt: CryptoKey;
|
|
2354
2378
|
forSign: CryptoKey;
|
|
@@ -2372,29 +2396,6 @@ declare class Client {
|
|
|
2372
2396
|
};
|
|
2373
2397
|
}
|
|
2374
2398
|
|
|
2375
|
-
declare const convert: {
|
|
2376
|
-
text: (data: string) => {
|
|
2377
|
-
toBase64: () => string;
|
|
2378
|
-
toHex: () => string;
|
|
2379
|
-
toBuffer: () => Uint8Array;
|
|
2380
|
-
};
|
|
2381
|
-
base64: (data: string) => {
|
|
2382
|
-
toBuffer: () => Uint8Array;
|
|
2383
|
-
toText: () => string;
|
|
2384
|
-
};
|
|
2385
|
-
bytes: (data: Uint8Array) => {
|
|
2386
|
-
toBase64: () => string;
|
|
2387
|
-
toHex: () => string;
|
|
2388
|
-
toText: () => string;
|
|
2389
|
-
toBinary: () => string;
|
|
2390
|
-
};
|
|
2391
|
-
hex: (data: string) => {
|
|
2392
|
-
toBase64: () => string;
|
|
2393
|
-
toBuffer: () => Uint8Array;
|
|
2394
|
-
toText: () => string;
|
|
2395
|
-
};
|
|
2396
|
-
};
|
|
2397
|
-
|
|
2398
2399
|
declare const fromText: (data: string) => {
|
|
2399
2400
|
toBase64: () => string;
|
|
2400
2401
|
toHex: () => string;
|
|
@@ -2421,17 +2422,16 @@ declare const fromHex: (data: string) => {
|
|
|
2421
2422
|
|
|
2422
2423
|
interface FetchDecryptionKeysParams {
|
|
2423
2424
|
client: Client;
|
|
2424
|
-
server: string;
|
|
2425
2425
|
pssh: string;
|
|
2426
|
+
server: string;
|
|
2426
2427
|
individualizationServer?: string;
|
|
2427
2428
|
headers?: Record<string, string>;
|
|
2428
|
-
fetch?: typeof fetch;
|
|
2429
2429
|
requestFilter?: (body: Uint8Array) => Uint8Array;
|
|
2430
2430
|
responseFilter?: (data: Uint8Array) => Uint8Array;
|
|
2431
|
-
|
|
2432
|
-
logger?: Logger;
|
|
2431
|
+
fetch?: typeof fetch;
|
|
2433
2432
|
requestTemplate?: string;
|
|
2433
|
+
logger?: Logger;
|
|
2434
2434
|
}
|
|
2435
2435
|
declare const fetchDecryptionKeys: (params: FetchDecryptionKeysParams) => Promise<Key[]>;
|
|
2436
2436
|
|
|
2437
|
-
export { CLIENT_TYPE, Client, type ClientType, Key, SecurityLevel,
|
|
2437
|
+
export { CLIENT_TYPE, Client, type ClientType, Key, SecurityLevel, Session, fetchDecryptionKeys, fromBase64, fromBinary, fromBuffer, fromHex, fromText };
|
package/dist/lib.d.ts
CHANGED
|
@@ -2323,6 +2323,30 @@ declare const SESSION_TYPES: {
|
|
|
2323
2323
|
readonly 'persistent-license': 1;
|
|
2324
2324
|
};
|
|
2325
2325
|
type SessionType = keyof typeof SESSION_TYPES;
|
|
2326
|
+
/**
|
|
2327
|
+
* https://www.w3.org/TR/encrypted-media-2/#mediakeysession-interface
|
|
2328
|
+
*/
|
|
2329
|
+
declare class Session extends EventTarget implements MediaKeySession {
|
|
2330
|
+
#private;
|
|
2331
|
+
readonly sessionId: string;
|
|
2332
|
+
readonly keyStatuses: MediaKeyStatusMap;
|
|
2333
|
+
readonly keys: Map<string, Key>;
|
|
2334
|
+
readonly expiration: number;
|
|
2335
|
+
readonly closed: Promise<MediaKeySessionClosedReason>;
|
|
2336
|
+
onmessage: ((this: MediaKeySession, ev: MediaKeyMessageEvent) => any) | null;
|
|
2337
|
+
onkeyschange: ((this: MediaKeySession, ev: Event) => any) | null;
|
|
2338
|
+
onkeystatuseschange: ((this: MediaKeySession, ev: Event) => any) | null;
|
|
2339
|
+
sessionType: SessionType;
|
|
2340
|
+
privacyMode?: boolean;
|
|
2341
|
+
constructor(sessionType: SessionType | undefined, client: Client);
|
|
2342
|
+
setLogger(logger: Logger): void;
|
|
2343
|
+
generateRequest(initDataType: string, initData: BufferSource): Promise<void>;
|
|
2344
|
+
waitForLicenseRequest(): Promise<Uint8Array>;
|
|
2345
|
+
load(): Promise<boolean>;
|
|
2346
|
+
update(response: Uint8Array): Promise<void>;
|
|
2347
|
+
close(): Promise<void>;
|
|
2348
|
+
remove(): Promise<void>;
|
|
2349
|
+
}
|
|
2326
2350
|
|
|
2327
2351
|
declare const CLIENT_TYPE: {
|
|
2328
2352
|
readonly android: "android";
|
|
@@ -2332,7 +2356,7 @@ type ClientType = (typeof CLIENT_TYPE)[keyof typeof CLIENT_TYPE];
|
|
|
2332
2356
|
type SecurityLevel = 1 | 2 | 3;
|
|
2333
2357
|
declare class Client {
|
|
2334
2358
|
#private;
|
|
2335
|
-
|
|
2359
|
+
id: ClientIdentification;
|
|
2336
2360
|
type: ClientType;
|
|
2337
2361
|
securityLevel: SecurityLevel;
|
|
2338
2362
|
signedDrmCertificate: SignedDrmCertificate;
|
|
@@ -2340,15 +2364,15 @@ declare class Client {
|
|
|
2340
2364
|
systemId: number;
|
|
2341
2365
|
vmp: FileHashes | null;
|
|
2342
2366
|
info: Map<string, string>;
|
|
2343
|
-
static
|
|
2344
|
-
static
|
|
2367
|
+
static fromPacked(data: Uint8Array, format?: 'WVDv2'): Promise<Client>;
|
|
2368
|
+
static fromUnpacked(id: Uint8Array, key: Uint8Array, vmp?: Uint8Array): Promise<Client>;
|
|
2345
2369
|
get key(): {
|
|
2346
2370
|
forDecrypt: CryptoKey;
|
|
2347
2371
|
forSign: CryptoKey;
|
|
2348
2372
|
};
|
|
2349
2373
|
constructor(id: Uint8Array, type?: ClientType, securityLevel?: SecurityLevel);
|
|
2350
|
-
|
|
2351
|
-
|
|
2374
|
+
unpack(): Promise<[id: Uint8Array, key: Uint8Array]>;
|
|
2375
|
+
pack(format?: 'WVDv2'): Promise<Uint8Array>;
|
|
2352
2376
|
importKey(pkcs1: Uint8Array): Promise<{
|
|
2353
2377
|
forDecrypt: CryptoKey;
|
|
2354
2378
|
forSign: CryptoKey;
|
|
@@ -2372,29 +2396,6 @@ declare class Client {
|
|
|
2372
2396
|
};
|
|
2373
2397
|
}
|
|
2374
2398
|
|
|
2375
|
-
declare const convert: {
|
|
2376
|
-
text: (data: string) => {
|
|
2377
|
-
toBase64: () => string;
|
|
2378
|
-
toHex: () => string;
|
|
2379
|
-
toBuffer: () => Uint8Array;
|
|
2380
|
-
};
|
|
2381
|
-
base64: (data: string) => {
|
|
2382
|
-
toBuffer: () => Uint8Array;
|
|
2383
|
-
toText: () => string;
|
|
2384
|
-
};
|
|
2385
|
-
bytes: (data: Uint8Array) => {
|
|
2386
|
-
toBase64: () => string;
|
|
2387
|
-
toHex: () => string;
|
|
2388
|
-
toText: () => string;
|
|
2389
|
-
toBinary: () => string;
|
|
2390
|
-
};
|
|
2391
|
-
hex: (data: string) => {
|
|
2392
|
-
toBase64: () => string;
|
|
2393
|
-
toBuffer: () => Uint8Array;
|
|
2394
|
-
toText: () => string;
|
|
2395
|
-
};
|
|
2396
|
-
};
|
|
2397
|
-
|
|
2398
2399
|
declare const fromText: (data: string) => {
|
|
2399
2400
|
toBase64: () => string;
|
|
2400
2401
|
toHex: () => string;
|
|
@@ -2421,17 +2422,16 @@ declare const fromHex: (data: string) => {
|
|
|
2421
2422
|
|
|
2422
2423
|
interface FetchDecryptionKeysParams {
|
|
2423
2424
|
client: Client;
|
|
2424
|
-
server: string;
|
|
2425
2425
|
pssh: string;
|
|
2426
|
+
server: string;
|
|
2426
2427
|
individualizationServer?: string;
|
|
2427
2428
|
headers?: Record<string, string>;
|
|
2428
|
-
fetch?: typeof fetch;
|
|
2429
2429
|
requestFilter?: (body: Uint8Array) => Uint8Array;
|
|
2430
2430
|
responseFilter?: (data: Uint8Array) => Uint8Array;
|
|
2431
|
-
|
|
2432
|
-
logger?: Logger;
|
|
2431
|
+
fetch?: typeof fetch;
|
|
2433
2432
|
requestTemplate?: string;
|
|
2433
|
+
logger?: Logger;
|
|
2434
2434
|
}
|
|
2435
2435
|
declare const fetchDecryptionKeys: (params: FetchDecryptionKeysParams) => Promise<Key[]>;
|
|
2436
2436
|
|
|
2437
|
-
export { CLIENT_TYPE, Client, type ClientType, Key, SecurityLevel,
|
|
2437
|
+
export { CLIENT_TYPE, Client, type ClientType, Key, SecurityLevel, Session, fetchDecryptionKeys, fromBase64, fromBinary, fromBuffer, fromHex, fromText };
|
package/dist/lib.js
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
CLIENT_TYPE,
|
|
3
|
-
Client,
|
|
4
|
-
Key,
|
|
5
|
-
convert,
|
|
6
|
-
fetchDecryptionKeys,
|
|
7
|
-
fromBase64,
|
|
8
|
-
fromBinary,
|
|
9
|
-
fromBuffer,
|
|
10
|
-
fromHex,
|
|
11
|
-
fromText
|
|
12
|
-
} from "./chunk-LSX4EP25.js";
|
|
13
|
-
export {
|
|
14
|
-
CLIENT_TYPE,
|
|
15
|
-
Client,
|
|
16
|
-
Key,
|
|
17
|
-
convert,
|
|
18
|
-
fetchDecryptionKeys,
|
|
19
|
-
fromBase64,
|
|
20
|
-
fromBinary,
|
|
21
|
-
fromBuffer,
|
|
22
|
-
fromHex,
|
|
23
|
-
fromText
|
|
24
|
-
};
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-3PKGQRBD.js";export{h as CLIENT_TYPE,i as Client,f as Key,g as Session,j as fetchDecryptionKeys,c as fromBase64,b as fromBinary,d as fromBuffer,e as fromHex,a as fromText};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Research & pentesting toolkit for Google's Widevine DRM",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dev": "wxt",
|
|
16
16
|
"dev:firefox": "wxt -b firefox",
|
|
17
17
|
"build": "npm run build:lib && npm run build:chrome",
|
|
18
|
-
"build:lib": "tsup --entry.lib lib/main.ts --entry.cli cli/main.ts --format cjs,esm --dts --clean",
|
|
18
|
+
"build:lib": "tsup --entry.lib src/lib/main.ts --entry.cli src/cli/main.ts --format cjs,esm --dts --clean --minify --minify-identifiers",
|
|
19
19
|
"build:chrome": "wxt build",
|
|
20
20
|
"build:firefox": "wxt build -b firefox",
|
|
21
21
|
"zip": "wxt zip",
|
|
@@ -29,10 +29,12 @@
|
|
|
29
29
|
"url": "https://github.com/vitalygashkov/azot"
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|
|
32
|
-
"drm",
|
|
33
32
|
"widevine",
|
|
33
|
+
"drm",
|
|
34
|
+
"google",
|
|
35
|
+
"pssh",
|
|
34
36
|
"eme",
|
|
35
|
-
"encrypted-media",
|
|
37
|
+
"encrypted-media-extensions",
|
|
36
38
|
"media"
|
|
37
39
|
],
|
|
38
40
|
"author": "Vitaly Gashkov <vitalygashkov@vk.com>",
|
|
@@ -68,6 +70,7 @@
|
|
|
68
70
|
"node": "20 || 21 || 22 || 23"
|
|
69
71
|
},
|
|
70
72
|
"dependencies": {
|
|
73
|
+
"@solidjs/router": "^0.14.10",
|
|
71
74
|
"jsrsasign": "^11.1.0",
|
|
72
75
|
"protobufjs": "^7.4.0",
|
|
73
76
|
"solid-icons": "^1.1.0",
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { existsSync } from 'fs';
|
|
2
|
-
import { execSync } from 'child_process';
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { execSync } from 'node:child_process';
|
|
3
3
|
|
|
4
|
-
// Check if
|
|
5
|
-
if (existsSync('.
|
|
4
|
+
// Check if has WXT config
|
|
5
|
+
if (existsSync('wxt.config.ts')) {
|
|
6
6
|
try {
|
|
7
7
|
// Run wxt prepare and pipe its output to the console
|
|
8
8
|
execSync('wxt prepare', { stdio: 'inherit' });
|