azot 0.6.0 → 0.6.1
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 +15 -2
- package/dist/{chunk-3PKGQRBD.js → chunk-G2YGFBUI.js} +1 -1
- package/dist/cli.cjs +5 -5
- package/dist/cli.js +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.cts +1 -0
- package/dist/lib.d.ts +1 -0
- package/dist/lib.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as m,j as y}from"./chunk-
|
|
2
|
+
import{i as m,j as y}from"./chunk-G2YGFBUI.js";import{parseArgs as L}from"node:util";import{readdir as D,readFile as u,stat as U}from"node:fs/promises";import{join as h}from"node:path";var c=async e=>{let t=(await U(e)).isDirectory();if(t){let o=t?await D(e):[],n=o.find(r=>r.includes("client_id")),l=o.find(r=>r.includes("private_key")),p=o.find(r=>r.endsWith("wvd")),C=!!(n&&l),$=!!p;if(C){let r=h(e,n),g=h(e,l),_=await u(r),F=await u(g);return m.fromUnpacked(_,F)}else if($){let r=h(e,p),g=await u(r);return await m.fromPacked(g)}else console.log(`Unable to find client files in ${e}`),process.exit(1)}else if(e.endsWith(".wvd")){let o=await u(e);return m.fromPacked(o)}else console.log(`Unable to find client files in ${e}`),process.exit(1)},i=(e,s=2,t=30)=>`${" ".repeat(s)}${e.padEnd(t)}`;var w=()=>{console.log(`azot client: Widevine client utilities
|
|
3
3
|
`),console.log(`Usage: azot client <subcommand> [...flags]
|
|
4
4
|
`),console.log("Commands:"),console.log(i("info <input>")+"print info about client that is on <input> path (*.wvd filepath or directory with id and private key)"),console.log(i("pack <input> <output>")+"pack client id and private key from <input> directory into single *.wvd file with <output> path"),console.log(i("unpack <input> <output>")+"unpack *.wvd from <input> path to separate client id and private key placed in <output> directory"),console.log(""),console.log("Flags:"),console.log(i("-h, --help")+"Display this menu and exit")};var b=async e=>{let s=await c(e);for(let[t,o]of s.info.entries())console.log(`${t}: ${o}`)};import{writeFile as E}from"node:fs/promises";import{join as q}from"node:path";var k=async(e=process.cwd(),s)=>{let t=await c(e),o=await t.pack(),n=`${t.info.get("company_name")}_${t.info.get("model_name")}`,l=s||q(process.cwd(),`${n}.wvd`);await E(l,o),console.log(`Client packed: ${l}`)};import{writeFile as x}from"node:fs/promises";import{join as z}from"node:path";var j=async(e=process.cwd(),s)=>{let t=await c(e),[o,n]=await t.unpack(),l=z(s||process.cwd(),"device_client_id_blob"),p=z(s||process.cwd(),"device_private_key");await x(l,o),await x(p,n),console.log(`Client unpacked: ${l}, ${p}`)};var d={info:b,pack:k,unpack:j,help:w};var P=()=>{console.log(`azot license: Make license request
|
|
5
5
|
`),console.log(`Usage: azot license <url> [...flags]
|
|
6
|
-
`),console.log("Commands:"),console.log(i("<url>")+"URL of license server (e.g. https://cwip-shaka-proxy.appspot.com/no_auth)"),console.log(""),console.log("Flags:"),console.log(i("-H, --header")+'headers to send with license request, compatible with curl (e.g. -H "Authorization: Bearer ...")'),console.log(i("-p, --pssh")+"widevine PSSH data in Base64"),console.log(i("-c, --client")+"path to client (directory with id and private key or path to *.wvd file)"),console.log(i("-e, --encrypt")+"enable client encryption with service certificate, disabled by default"),console.log(i("-h, --help")+"display this menu and exit")};var f=async e=>{let s=Object.fromEntries(e.headers?.map(o=>o.split(":").map(n=>n.trim()))||[]);console.log({headers:s});let t=await y({server:e.url,pssh:e.pssh,client:await c(e.clientPath||process.cwd()),headers:s});for(let o of t)console.log(`${o.id}:${o.value}`);return t};f.help=P;var v={name:"azot",version:"0.6.
|
|
6
|
+
`),console.log("Commands:"),console.log(i("<url>")+"URL of license server (e.g. https://cwip-shaka-proxy.appspot.com/no_auth)"),console.log(""),console.log("Flags:"),console.log(i("-H, --header")+'headers to send with license request, compatible with curl (e.g. -H "Authorization: Bearer ...")'),console.log(i("-p, --pssh")+"widevine PSSH data in Base64"),console.log(i("-c, --client")+"path to client (directory with id and private key or path to *.wvd file)"),console.log(i("-e, --encrypt")+"enable client encryption with service certificate, disabled by default"),console.log(i("-h, --help")+"display this menu and exit")};var f=async e=>{let s=Object.fromEntries(e.headers?.map(o=>o.split(":").map(n=>n.trim()))||[]);console.log({headers:s});let t=await y({server:e.url,pssh:e.pssh,client:await c(e.clientPath||process.cwd()),headers:s});for(let o of t)console.log(`${o.id}:${o.value}`);return t};f.help=P;var v={name:"azot",version:"0.6.1",description:"Research & pentesting toolkit for Google's Widevine DRM",type:"module",files:["dist","scripts"],bin:{azot:"dist/cli.js"},scripts:{prepublishOnly:"npm run build:lib",dev:"wxt","dev:firefox":"wxt -b firefox",build:"npm run build:lib && npm run build:chrome","build:lib":"tsup --entry.lib src/lib/main.ts --entry.cli src/cli/main.ts --format cjs,esm --dts --clean --minify --minify-identifiers","build:chrome":"wxt build","build:firefox":"wxt build -b firefox",zip:"wxt zip","zip:firefox":"wxt zip -b firefox",compile:"tsc --noEmit",postinstall:"node scripts/postinstall.js",test:"vitest"},repository:{type:"git",url:"https://github.com/vitalygashkov/azot"},keywords:["widevine","drm","google","pssh","eme","encrypted-media-extensions","media"],author:"Vitaly Gashkov <vitalygashkov@vk.com>",license:"AGPL-3.0",readmeFilename:"README.md",bugs:{url:"https://github.com/vitalygashkov/azot/issues",email:"vitalygashkov@vk.com"},funding:[{type:"individual",url:"https://boosty.to/vitalygashkov"},{type:"patreon",url:"https://www.patreon.com/vitalygashkov"}],exports:{".":{require:{types:"./dist/lib.d.cts",default:"./dist/lib.cjs"},import:{types:"./dist/lib.d.ts",default:"./dist/lib.js"}}},engines:{node:"20 || 21 || 22 || 23"},dependencies:{"@solidjs/router":"^0.14.10",jsrsasign:"^11.1.0",protobufjs:"^7.4.0","solid-icons":"^1.1.0","solid-js":"^1.9.1"},devDependencies:{"@eslint/js":"^9.12.0","@types/jsrsasign":"^10.5.14","@types/node":"^22.7.5","@wxt-dev/module-solid":"^1.1.2",autoprefixer:"^10.4.17",clsx:"^2.1.1",eslint:"^9.12.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1",globals:"^15.11.0",postcss:"^8.4.33","tailwind-merge":"^2.5.4",tailwindcss:"^3.4.1",tsup:"^8.3.0",typescript:"^5.6.2","typescript-eslint":"^8.9.0","vite-plugin-arraybuffer":"^0.0.8",vitest:"^2.1.3",wxt:"^0.19.11"}};var a=L({args:process.argv.slice(2),options:{pssh:{type:"string",short:"p"},client:{type:"string",short:"c"},encrypt:{type:"boolean",short:"e",default:!1},header:{type:"string",short:"H",multiple:!0},help:{type:"boolean",short:"h"},version:{type:"boolean",short:"v"},debug:{type:"boolean",short:"d"}},strict:!1,allowPositionals:!0}),R=()=>{console.log(`Azot is a research & pentesting toolkit for Google's Widevine DRM. (${v.version})
|
|
7
7
|
`),console.log(`Usage: azot <command> [...flags]
|
|
8
8
|
`),console.log("Commands:"),console.log(i("license <url>")+"Make a license request"),console.log(i("client <subcommand>")+"Additional Widevine client utilities"),console.log(""),console.log("Flags:"),console.log(i("-d, --debug")+"Enable debug level logging"),console.log(i("-v, --version")+"Print version and exit"),console.log(i("-h, --help")+"Display this menu and exit"),console.log(""),console.log("(more flags in azot license --help and azot client --help)")};(async()=>{a.values.version&&(console.log(v.version),process.exit(0));let[e,...s]=a.positionals;switch(e){case"client":{let t=s.shift(),[o,n]=s;switch(t){case"pack":d.pack(o,n);break;case"unpack":d.unpack(o,n);break;case"info":d.info(o);break;default:a.values.help?(d.help(),process.exit(0)):(console.log("Client subcommand required: pack, unpack, info"),process.exit(1))}break}case"license":{a.values.help&&(f.help(),process.exit(0));let t=s.shift();if(!t)throw new Error("License URL required");let o=a.values.pssh;if(!o)throw new Error("PSSH required");let n=a.values.client,l=a.values.encrypt,p=a.values.header;await f({url:t,pssh:o,clientPath:n,encrypt:l,headers:p});break}case"pssh":break;case"serve":break;case"test":break;default:a.values.help?(R(),process.exit(0)):(console.log("Command not found"),process.exit(1))}})();
|