Skip to content

Commit

Permalink
Add FSI 6x4 hex 203c-d001- generator
Browse files Browse the repository at this point in the history
This generator is based on PolloLoco work that can be found here:

https://gitlab.com/polloloco/fujitsu-bios-unlocker/
  • Loading branch information
bacher09 committed Nov 25, 2023
1 parent 2816ad2 commit 0480503
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ module.exports = {
],
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "error",
"jsdoc/newline-after-description": "error",
"max-classes-per-file": "off",
"new-parens": "error",
"no-bitwise": "error",
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 10 additions & 1 deletion src/keygen/fsi.spec.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down Expand Up @@ -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"]);
});
});
26 changes: 26 additions & 0 deletions src/keygen/fsi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-bitwise */
import { makeSolver } from "./utils";
import { Crc32 } from "./cryptoUtils";

function generateCRC16Table(): number[] {
let table: number[] = [];
Expand Down Expand Up @@ -142,6 +143,23 @@ 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 [];
}
if (serial.slice(0, 8) !== "203cd001") {
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",
Expand Down Expand Up @@ -173,3 +191,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)
});
3 changes: 2 additions & 1 deletion src/keygen/index.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -31,6 +31,7 @@ export const solvers: Solver[] = [
fsi20DecNewSolver,
fsi20DecOldSolver,
fsi24DecSolver,
fsi24Hex203cSolver,
hpMiniSolver,
hpInsydeSolver,
hpAMISolver,
Expand Down

0 comments on commit 0480503

Please sign in to comment.