Add FSI 6x4 hex 203c-d001- generator

This generator is based on PolloLoco work that can be found here:

https://gitlab.com/polloloco/fujitsu-bios-unlocker/
This commit is contained in:
Slava Bacherikov 2023-11-25 21:20:41 +02:00
parent 2816ad255f
commit d1a66e1234
5 changed files with 48 additions and 7 deletions

View file

@ -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",

View file

@ -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

View file

@ -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,16 @@ 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"]);
});
it("FSI key for 203C-D001-4F30-609D-5125-646a is 66b14918", () => {
expect(fsi24Hex203cSolver("203C-D001-4F30-609D-5125-646a")).toEqual(["66b14918"]);
});
});

View file

@ -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,24 @@ 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 [];
}
serial = serial.toLowerCase();
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",
@ -173,3 +192,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)
});

View file

@ -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,