Skip to content

Commit

Permalink
Add support for Acer Insyde 10 digits
Browse files Browse the repository at this point in the history
  • Loading branch information
bacher09 committed Jun 5, 2020
1 parent b99bdd7 commit 4b4ccc7
Show file tree
Hide file tree
Showing 7 changed files with 606 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Latest released version available [here][bios-pw] and latest testing version (*s
* [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
* [let-def](https://github.com/let-def) — for Acer Insyde 10 digit

[build-status]: https://api.travis-ci.org/bacher09/pwgen-for-bios.svg?branch=master
[travis]: https://travis-ci.org/bacher09/pwgen-for-bios
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"scripts": {
"test": "ts-node ./node_modules/jasmine/bin/jasmine --config=jasmine.json",
"lint": "tslint src/*.ts",
"lint": "tslint src/**/*.ts",
"cover": "nyc -r text -e .ts -x '**/*.spec.ts' npm test",
"send-coverage": "nyc report --reporter=text-lcov | coveralls",
"all": "npm test && npm run lint && npm run cover && npm run browser-test",
Expand Down
3 changes: 2 additions & 1 deletion src/keygen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { asusSolver } from "./asus";
import { dellHddSolver, dellSolver, hddOldSolver } from "./dell";
import { fsi20DecNewSolver, fsi20DecOldSolver, fsi24DecSolver, fsiHexSolver } from "./fsi";
import { hpMiniSolver } from "./hpmini";
import { insydeSolver } from "./insyde";
import { acerInsyde10Solver, insydeSolver } from "./insyde";
import {
phoenixFsiLSolver, phoenixFsiPSolver, phoenixFsiSolver,
phoenixFsiSSolver, phoenixFsiXSolver, phoenixHPCompaqSolver, phoenixSolver
Expand All @@ -17,6 +17,7 @@ export type KeygenResult = [Solver, string[], number];

export const solvers: Solver[] = [
asusSolver,
acerInsyde10Solver,
sonySolver,
sony4x4Solver,
samsungSolver,
Expand Down
62 changes: 62 additions & 0 deletions src/keygen/insyde.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { insydeSolver } from "./insyde";
import { acerInsyde10Solver, AES128, Crc64, Sha256 } from "./insyde";

describe("Insyde BIOS", () => {
it("Insyde key for 03133610 is 12891236", () => {
Expand All @@ -13,3 +14,64 @@ describe("Insyde BIOS", () => {
expect(insydeSolver("1234567")).toEqual([]);
});
});

describe("Acer Insyde 10 BIOS", () => {
it("Check Acer solver", () => {
expect(acerInsyde10Solver("0173549286")).toEqual(["e0eac38fdfcfd74a"]);
expect(acerInsyde10Solver("1014206418")).toEqual(["3c0a50907bc2c604"]);
expect(acerInsyde10Solver("1765418418")).toEqual(["5f54e355b83e969c"]);
expect(acerInsyde10Solver("1858408509")).toEqual(["c4791532114cfbab"]);
expect(acerInsyde10Solver("1925715998")).toEqual(["f21cce78c0987233"]);
expect(acerInsyde10Solver("2051611322")).toEqual(["1c648cb56e8a64bb"]);
expect(acerInsyde10Solver("2036529205")).toEqual(["f2e874332b6f50b1"]);
expect(acerInsyde10Solver("1768688657")).toEqual(["80774329818c3312"]);
expect(acerInsyde10Solver("1746144265")).toEqual(["c3d46da5f6f3c75b"]);
expect(acerInsyde10Solver("1611926546")).toEqual(["f61c86479a8a6b20"]);
expect(acerInsyde10Solver("1355047683")).toEqual(["7fe913d78ffc5ed1"]);
expect(acerInsyde10Solver("1373072054")).toEqual(["aebeae5c425684cd"]);
expect(acerInsyde10Solver("1373899792")).toEqual(["a26970a4ffb62d49"]);
expect(acerInsyde10Solver("1395185025")).toEqual(["a763280d9f7396ec"]);
});
});

describe("Utils", () => {
it("sha256", () => {
expect(new Sha256([]).hexdigest())
.toEqual("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");

expect(new Sha256([1]).hexdigest())
.toEqual("4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a");

expect(new Sha256([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).hexdigest())
.toEqual("c848e1013f9f04a9d63fa43ce7fd4af035152c7c669a4a404b67107cee5f2e4e");

expect(new Sha256("test".split("").map((v) => v.charCodeAt(0))).hexdigest())
.toEqual("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08");

expect(new Sha256("0".repeat(256).split("").map((v) => v.charCodeAt(0))).hexdigest())
.toEqual("67f022195ee405142968ca1b53ae2513a8bab0404d70577785316fa95218e8ba");

expect(new Sha256("0".repeat(56).split("").map((v) => v.charCodeAt(0))).hexdigest())
.toEqual("bd03ac1428f0ea86f4b83a731ffc7967bb82866d8545322f888d2f6e857ffc18");
});
it("AES128", () => {
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
const myaes = new AES128(numbers);
expect(myaes.encryptBlock(numbers))
.toEqual([52, 195, 59, 127, 20, 253, 83, 220, 234, 37, 224, 26, 2, 225, 103, 39]);

expect(myaes.encryptBlock("123456789abcdefg".split("").map((v) => v.charCodeAt(0))))
.toEqual([111, 52, 225, 193, 98, 40, 19, 168, 122, 34, 93, 3, 146, 166, 202, 100]);
});
it("crc64", () => {
let mycrc = new Crc64(Crc64.ECMA_POLYNOMIAL);
mycrc.update([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
expect(mycrc.hexdigest()).toEqual("335a089168033fbe");
mycrc.reset();
mycrc.update([0x80]);
expect(mycrc.hexdigest()).toEqual("c96c5795d7870f42");
mycrc.reset();
mycrc.update([0xde, 0xad, 0xbe, 0xef]);
expect(mycrc.hexdigest()).toEqual("fc232c18806871af");
});
});
Loading

0 comments on commit 4b4ccc7

Please sign in to comment.