diff --git a/README.md b/README.md index 112be5c..fe43fc6 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Latest released version available [here][bios-pw] and latest testing version (*s * Compaq — 5 decimal digits (*e.g*. ``12345``) * Dell — supports such series: ``595B``, ``D35B``, ``2A7B``, ``A95B``, ``1D3B``, ``6FF1``, ``1F66``, ``1F5A`` and ``BF97``, ``E7A8``. *e.g*: ``1234567-2A7B`` or ``1234567890A-D35B`` for HDD. * Dell Insyde BIOS (Latitude 3540) — *e.g.* ``5F3988D5E0ACE4BF-7QH8602`` (``7QH8602`` — service tag). -* Fujitsu-Siemens — 5 decimal digits, 8 hexadecimal digits, 5x4 hexadecimal digits, 5x4 decimal digits +* Fujitsu-Siemens — 5 decimal digits, 8 hexadecimal digits, 5x4 and 6x4 hexadecimal digits, 5x4 decimal digits * Hewlett-Packard — 5 decimal digits, 10 characters * Insyde H20 (Acer, HP) — 8 decimal digits, 10 decimal digits or HP `i ` (lowercase and uppercase) prefixed 8 digits. * Phoenix (generic) — 5 decimal digits @@ -27,14 +27,15 @@ Latest released version available [here][bios-pw] and latest testing version (*s ## More info * http://dogber1.blogspot.com/2009/05/table-of-reverse-engineered-bios.html -* https://sites.google.com/site/hpglserv/Home/article +* https://web.archive.org/web/20180913211958/https://sites.google.com/site/hpglserv/Home/article ## Thanks * [asyncritius](https://github.com/A-syncritus) — for major contribution to dell generator -* [dogbert](https://github.com/dogbert) — researched most of generators present here -* hpgl — for dell generator +* [dogbert](https://github.com/dogbert) — researched many generators present here +* hpgl — for initial dell generator * [let-def](https://github.com/let-def) — for Acer Insyde 10 digit +* [polloloco](https://github.com/polloloco) — for FSI 6x4 hex (`203c-d001`) [build-status]: https://github.com/bacher09/pwgen-for-bios/actions/workflows/build-test.yml/badge.svg [tests]: https://github.com/bacher09/pwgen-for-bios/actions/workflows/build-test.yml diff --git a/src/keygen/fsi.spec.ts b/src/keygen/fsi.spec.ts index 32c6aaa..9f8b396 100644 --- a/src/keygen/fsi.spec.ts +++ b/src/keygen/fsi.spec.ts @@ -1,4 +1,4 @@ -import { fsi20DecNewSolver, fsi20DecOldSolver, fsi24DecSolver, fsiHexSolver } from "./fsi"; +import { fsi20DecNewSolver, fsi20DecOldSolver, fsi24DecSolver, fsi24Hex203cSolver, fsiHexSolver } from "./fsi"; describe("Test Fujitsu-Siemens 5x4 hexadecimal BIOS", () => { it("FSI key for 1234-4321-1234-4321-1234 is 35682708", () => { @@ -63,3 +63,12 @@ describe("Test Fujitsu-Siemens 6x4 decimal", () => { expect(fsi24DecSolver("1234-1234-4321-1234-4321-BEEF")).toEqual([]); }); }); + +describe("Test Fujitsu-Siemens 6x4 hex 203c-d001", () => { + it("FSI key for 203c-d001-0000-001d-e960-227d is 494eab7c", () => { + expect(fsi24Hex203cSolver("203c-d001-0000-001d-e960-227d")).toEqual(["494eab7c"]); + }); + it("FSI key for 203c-d001-4f30-609d-5125-646a is 66b14918", () => { + expect(fsi24Hex203cSolver("203c-d001-4f30-609d-5125-646a")).toEqual(["66b14918"]); + }); +}); diff --git a/src/keygen/fsi.ts b/src/keygen/fsi.ts index 1c02c28..ea66168 100644 --- a/src/keygen/fsi.ts +++ b/src/keygen/fsi.ts @@ -1,5 +1,6 @@ /* eslint-disable no-bitwise */ import { makeSolver } from "./utils"; +import { Crc32 } from "./cryptoUtils"; function generateCRC16Table(): number[] { let table: number[] = []; @@ -142,6 +143,25 @@ function fsi20DecNewKeygen(serial: string): string { }).join(""); } +/* For Fujitsu-Siemens. 6x4 203c-d001-xxxx-xxxx-xxxx-xxxx + * Based on: https://gitlab.com/polloloco/fujitsu-bios-unlocker/ + */ +function fsiHex203Cd001Keygen(serial: string): string[] { + if (serial.length != 24) { + return []; + } + + const hexSerial = Array.from({length: 6}, (_, i) => i * 4).map(i => parseInt(serial.slice(i, i + 4), 16)); + if (hexSerial[0] != 0x203c || hexSerial[1] != 0xd001) { + return []; + } + let crc = new Crc32(); + crc.update(serial.slice(8).split("").map(c => c.charCodeAt(0))); + // JAMCRC + const output = ("0".repeat(8) + ((~crc.digest()) >>> 0).toString(16)).slice(-8); + return [output]; +} + export let fsiHexSolver = makeSolver({ name: "fsiHex", description: "Fujitsu-Siemens hexdigits", @@ -173,3 +193,11 @@ export let fsi24DecSolver = makeSolver({ inputValidator: (s) => /^[0-9ABCDEF]{4}\d{20}$/i.test(s), fun: (code: string) => [fsi24DecKeygen(code)] }); + +export let fsi24Hex203cSolver = makeSolver({ + name: "fsi24Hex203c", + description: "Fujitsu-Siemens Hex (6x4) 203c-d001-xxxx-xxxx-xxxx-xxxx", + examples: ["203c-d001-0000-001d-e960-227d"], + inputValidator: (s) => /^[0-9ABCDEF]{24}$/i.test(s), + fun: (code: string) => fsiHex203Cd001Keygen(code) +}); diff --git a/src/keygen/index.ts b/src/keygen/index.ts index f0a95f8..1f3c212 100644 --- a/src/keygen/index.ts +++ b/src/keygen/index.ts @@ -1,7 +1,7 @@ import { monotonicTime } from "../polyfills/performancePolyfill"; import { asusSolver } from "./asus"; import { dellHddSolver, dellLatitude3540Solver, dellSolver, hddOldSolver } from "./dell"; -import { fsi20DecNewSolver, fsi20DecOldSolver, fsi24DecSolver, fsiHexSolver } from "./fsi"; +import { fsi20DecNewSolver, fsi20DecOldSolver, fsi24DecSolver, fsiHexSolver, fsi24Hex203cSolver } from "./fsi"; import { hpAMISolver } from "./hpami"; import { hpMiniSolver } from "./hpmini"; import { acerInsyde10Solver, hpInsydeSolver, insydeSolver } from "./insyde"; @@ -31,6 +31,7 @@ export const solvers: Solver[] = [ fsi20DecNewSolver, fsi20DecOldSolver, fsi24DecSolver, + fsi24Hex203cSolver, hpMiniSolver, hpInsydeSolver, hpAMISolver,