diff --git a/README.md b/README.md index 5a31324..1a8eda8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Latest released version available [here][bios-pw] and latest testing version (*s * Asus — current BIOS date. For example: ``01-02-2013`` * Compaq — 5 decimal digits (*e.g*. ``12345``) -* Dell — supports such series: ``595B``, ``D35B``, ``2A7B``, ``A95B``, ``1D3B``, ``6FF1``, ``1F66`` and ``1F5A``. *e.g*: ``1234567-2A7B`` or ``1234567890A-D35B`` for HDD. +* Dell — supports such series: ``595B``, ``D35B``, ``2A7B``, ``A95B``, ``1D3B``, ``6FF1``, ``1F66``, ``1F5A`` and ``BF97``. *e.g*: ``1234567-2A7B`` or ``1234567890A-D35B`` for HDD. * Fujitsu-Siemens — 5 decimal digits, 8 hexadecimal digits, 5x4 hexadecimal digits, 5x4 decimal digits * Hewlett-Packard — 5 decimal digits, 10 characters * Insyde H20 (Acer, HP) — 8 decimal digits diff --git a/html/index.html b/html/index.html index 488be9f..ceab7b5 100644 --- a/html/index.html +++ b/html/index.html @@ -49,7 +49,7 @@ - + diff --git a/src/keygen/dell.spec.ts b/src/keygen/dell.spec.ts index 7cf6f94..15c3a61 100644 --- a/src/keygen/dell.spec.ts +++ b/src/keygen/dell.spec.ts @@ -62,6 +62,16 @@ describe("Test calculateSuffix", () => { expect(suffix).toEqual([0x74, 0x6e, 0x76, 0x75, 0x69, 0x6f, 0x74, 0x68]); }); + it("Check tag suffix for: 1234567-BF97", () => { + let suffix = checkSuffix("1234567", DellTag.TagBF97, SuffixType.ServiceTag); + expect(suffix).toEqual([77, 78, 120, 56, 54, 70, 114, 56]); + }); + + it("Check tag suffix for: ABCDEFG-BF97", () => { + let suffix = checkSuffix("ABCDEFG", DellTag.TagBF97, SuffixType.ServiceTag); + expect(suffix).toEqual([51, 71, 109, 56, 90, 114, 51, 91]); + }); + // HDD it("Check hdd suffix for: 12345678901-595B", () => { let suffix = checkSuffix("12345678901", DellTag.Tag595B, SuffixType.HDD); @@ -102,6 +112,11 @@ describe("Test calculateSuffix", () => { let suffix = checkSuffix("12345678901", DellTag.Tag1F5A, SuffixType.HDD); expect(suffix).toEqual([48, 51, 113, 98, 107, 48, 99, 115]); }); + + it("Check hdd suffix for: 12345678901-BF97", () => { + let suffix = checkSuffix("12345678901", DellTag.TagBF97, SuffixType.HDD); + expect(suffix).toEqual([48, 100, 54, 107, 121, 48, 81, 54]); + }); }); describe("Test keygenDell", () => { @@ -176,6 +191,26 @@ describe("Test keygenDell", () => { .toEqual("x2zL5n7jj2Gl2TIh"); }); + it("Dell password for: 1234567-BF97", () => { + expect(keygenDell("1234567", DellTag.TagBF97, SuffixType.ServiceTag)) + .toEqual("2r09GZhU[r0kW2zr"); + }); + + it("Dell password for: OPENSRC-BF97", () => { + expect(keygenDell("OPENSRC", DellTag.TagBF97, SuffixType.ServiceTag)) + .toEqual("Dp29XkbyMrkBrp6Z"); + }); + + it("Dell password for: ABCDEFG-BF97", () => { + expect(keygenDell("ABCDEFG", DellTag.TagBF97, SuffixType.ServiceTag)) + .toEqual("kr9Z1cmPpahGzsQ["); + }); + + it("Dell password for: DELLSUX-BF97", () => { + expect(keygenDell("DELLSUX", DellTag.TagBF97, SuffixType.ServiceTag)) + .toEqual("rrNM2LrbD8nGsd2P"); + }); + // HDD it("Dell HDD password for: 1234567890A-595B", () => { expect(keygenDell("1234567890A", DellTag.Tag595B, SuffixType.HDD)) @@ -213,6 +248,18 @@ describe("Test keygenDell", () => { expect(keygenDell("12345678901", DellTag.Tag1F5A, SuffixType.HDD)) .toEqual("QwO5Dki1zeR1n1t2"); }); + it("Dell HDD password for: 12345678901-BF97", () => { + expect(keygenDell("12345678901", DellTag.TagBF97, SuffixType.HDD)) + .toEqual("nDrmUU6U5DI9ZLMI"); + }); + it("Dell HDD password for: 1234567890A-BF97", () => { + expect(keygenDell("1234567890A", DellTag.TagBF97, SuffixType.HDD)) + .toEqual("pRrky3r9ryEPNNJz"); + }); + it("Dell HDD password for: 234567890AB-BF97", () => { + expect(keygenDell("234567890AB", DellTag.TagBF97, SuffixType.HDD)) + .toEqual("h2RDrReN37I1NLmr"); + }); }); describe("Test Dell BIOS", () => { diff --git a/src/keygen/dell/encode.ts b/src/keygen/dell/encode.ts index e0e3220..2277a2b 100644 --- a/src/keygen/dell/encode.ts +++ b/src/keygen/dell/encode.ts @@ -188,11 +188,6 @@ class TagD35BEncoder extends Tag595BEncoder { } class Tag1D3BEncoder extends Tag595BEncoder { - protected f1 = encF1N; - protected f2 = encF2N; - protected f3 = encF3; - protected f4 = encF4N; - protected f5 = encF5N; public makeEncode(): void { for (let j = 0; j < 21; j++) { @@ -206,11 +201,6 @@ class Tag1D3BEncoder extends Tag595BEncoder { } class Tag1F66Encoder extends Tag595BEncoder { - protected f1 = encF1N; - protected f2 = encF2N; - protected f3 = encF3; - protected f4 = encF4N; - protected f5 = encF5N; protected md5table = md5magic2; public makeEncode(): void { @@ -281,17 +271,14 @@ class Tag1F66Encoder extends Tag595BEncoder { } class Tag6FF1Encoder extends Tag595BEncoder { - protected f1 = encF1N; - protected f2 = encF2N; - protected f3 = encF3; - protected f4 = encF4N; - protected f5 = encF5N; protected md5table = md5magic2; + protected counter1: number = 23; + public makeEncode(): void { let t: number = 0; - for (let j = 0; j < 23; j++) { + for (let j = 0; j < this.counter1; j++) { this.A |= 0xA08097; this.B ^= 0xA010908; this.C |= 0x60606161 - j; @@ -358,11 +345,6 @@ class Tag6FF1Encoder extends Tag595BEncoder { class Tag1F5AEncoder extends Tag595BEncoder { protected md5table = md5magic2; - protected f1 = encF1N; - protected f2 = encF2N; - protected f3 = encF3; - protected f4 = encF4N; - protected f5 = encF5N; protected incrementData() { this.encData[0] += this.B; @@ -410,6 +392,10 @@ class Tag1F5AEncoder extends Tag595BEncoder { } } +class TagBF97Encoder extends Tag6FF1Encoder { + protected counter1 = 31; +} + const encoders: {readonly [P in DellTag]: Encoder} = { "595B": Tag595BEncoder, "2A7B": Tag595BEncoder, // same as 595B @@ -418,7 +404,8 @@ const encoders: {readonly [P in DellTag]: Encoder} = { "D35B": TagD35BEncoder, "1F66": Tag1F66Encoder, "6FF1": Tag6FF1Encoder, - "1F5A": Tag1F5AEncoder + "1F5A": Tag1F5AEncoder, + "BF97": TagBF97Encoder }; export function blockEncode(encBlock: number[], tag: DellTag): number[] { diff --git a/src/keygen/dell/index.ts b/src/keygen/dell/index.ts index b3dafc9..04f2ef2 100644 --- a/src/keygen/dell/index.ts +++ b/src/keygen/dell/index.ts @@ -20,7 +20,8 @@ const extraCharacters: {readonly [P in DellTag]?: string} = { "1F5A": asciiPrintable, "1D3B": "0BfIUG1kuPvc8A9Nl5DLZYSno7Ka6HMgqsJWm65yCQR94b21OTp7VFX2z0jihE33d4xtrew0", "1F66": "0ewr3d4xtUG1ku0BfIp7VFb21OTSno7KDLZYqsJWa6HMgCQR94m65y9Nl5Pvc8AjihE3X2z0", - "6FF1": "08rptBxfbGVMz38IiSoeb360MKcLf4QtBCbWVzmH5wmZUcRR5DZG2xNCEv1nFtzsZB2bw1X0" + "6FF1": "08rptBxfbGVMz38IiSoeb360MKcLf4QtBCbWVzmH5wmZUcRR5DZG2xNCEv1nFtzsZB2bw1X0", + "BF97": "0Q2drGk99rkQFMxN[Z5y3DGr16h638myIL2rzz2pzcU7JWLJ1EGnqRN4seZPRM2aBXIjbkGZ" }; /* diff --git a/src/keygen/dell/types.ts b/src/keygen/dell/types.ts index 8813712..03e75d2 100644 --- a/src/keygen/dell/types.ts +++ b/src/keygen/dell/types.ts @@ -7,7 +7,8 @@ export enum DellTag { Tag1D3B = "1D3B", Tag6FF1 = "6FF1", Tag1F66 = "1F66", - Tag1F5A = "1F5A" + Tag1F5A = "1F5A", + TagBF97 = "BF97" } export const enum SuffixType {
VendorTypeHash Code/Serial example
Compaq5 decimal digits12345
Dellserial number1234567-595B
1234567-D35B
1234567-2A7B
1234567-1D3B
1234567-1F66
1234567-6FF1
1234567-1F5A
Dellserial number1234567-595B
1234567-D35B
1234567-2A7B
1234567-1D3B
1234567-1F66
1234567-6FF1
1234567-1F5A
1234567-BF97
Fujitsu-Siemens5 decimal digits12345
Fujitsu-Siemens8 hexadecimal digitsDEADBEEF
Fujitsu-Siemens5x4 hexadecimal digitsAAAA-BBBB-CCCC-DEAD-BEEF