Make ui for typescript version

Currently UI is based on old version of this project.
This commit is contained in:
Slava Bacherikov committed 2018-01-30 19:26:33 +02:00
1 parent 485063c43a
commit 8c14f3794f
7 files changed
+204 -60

No files matched your search

+18 -16
View File
@@ -9,7 +9,9 @@
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript" src="${script_file}" ></script>
<style>
input#serial_id, div#answer { font-family: monospace }
</style>
</head>
<body>
<div class="topbar">
@@ -27,15 +29,15 @@
<div class="hero-unit">
<h1></h1>
<p>BIOS Password Recovery for Laptops</p>
Quick and easy way to recover BIOS passwords on laptops. More details <a href="http://dogber1.blogspot.com/2009/05/table-of-reverse-engineered-bios.html">here</a>.
Quick and easy way to recover BIOS passwords on laptops. Based on research by <a href="http://dogber1.blogspot.com/2009/05/table-of-reverse-engineered-bios.html">Dogbert</a> and <a href="http://asyncrit.us">Asyncritus</a>.
</div>
<div class="row" >
<div id="control_id" >
<h2>Enter your code</h2><br/>
<form name="pwgen" id="form_id">
<input placeholder="Code" type="text" name="serial" id="serial_id" onkeypress="enterPress(event);" />
<input placeholder="Code" type="text" name="serial" id="serial_id" />
<br/><br/>
<input type="button" class="btn primary" name="serial" id="button_id" value="Get password" onclick="calcPass()" />
<input type="button" class="btn primary" name="serial" id="button_id" value="Get password" />
</form>
</div>
<div id="result_id">
@@ -46,18 +48,18 @@
</div>
<table><tbody>
<tr style="background: #ddd;"><th>Vendor</th><th>Type</th><th>Hash Code/Serial example</th></tr>
<tr><td class="s3" style="font-weight: bold;">Compaq</td><td class="s4">5 decimal digits</td><td class="s5" style="font-family: arial;">12345</td></tr>
<tr><td class="s3" style="font-weight: bold;">Dell</td><td class="s4">serial number</td><td class="s5" style="font-family: arial;">1234567-595B<br>1234567-D35B<br>1234567-2A7B<br>1234567-1D3B</td></tr>
<tr><td class="s7" style="font-weight: bold;">Fujitsu-Siemens</td><td class="s8">5 decimal digits</td><td class="s9" style="font-family: arial;">12345</td></tr>
<tr><td class="s7" style="font-weight: bold;">Fujitsu-Siemens</td><td class="s8">8 hexadecimal digits</td><td class="s9" style="font-family: arial;">DEADBEEF</td></tr>
<tr><td class="s7" style="font-weight: bold;">Fujitsu-Siemens</td><td class="s8">5x4 hexadecimal digits</td><td class="s9" style="font-family: arial;">AAAA-BBBB-CCCC-DEAD-BEEF</td></tr>
<tr><td class="s7" style="font-weight: bold;">Fujitsu-Siemens</td><td class="s8">5x4 decimal digits</td><td class="s9" style="font-family: arial;">1234-4321-1234-4321-1234</td></tr>
<tr><td class="s7" style="font-weight: bold;">Hewlett-Packard</td><td class="s8">5 decimal digits</td><td class="s9" style="font-family: arial;">12345</td></tr>
<tr><td class="s7" style="font-weight: bold;">Hewlett-Packard/Compaq Netbooks</td><td class="s8">10 characters</td><td class="s9" style="font-family: arial;">CNU1234ABC</td></tr>
<tr><td class="s11" style="font-weight: bold;">Insyde H20 (generic)</td><td class="s8">8 decimal digits</td><td class="s9" style="font-family: arial;">03133610</td></tr>
<tr><td class="s11" style="font-weight: bold;">Phoenix (generic)</td><td class="s8">5 decimal digits</td><td class="s9" style="font-family: arial;">12345</td></tr>
<tr><td class="s7" style="font-weight: bold;">Sony</td><td class="s8">7 digit serial number</td><td class="s9" style="font-family: arial;">1234567</td></tr>
<tr><td class="s7" style="font-weight: bold;">Samsung</td><td class="s8">12 hexadecimal digits</td><td class="s9" style="font-family: arial;">07088120410C0000</td></tr>
<tr><td class="s3" style="font-weight: bold;">Compaq</td><td class="s4">5 decimal digits</td><td class="s5" style="font-family: monospace;">12345</td></tr>
<tr><td class="s3" style="font-weight: bold;">Dell</td><td class="s4">serial number</td><td class="s5" style="font-family: monospace;">1234567-595B<br>1234567-D35B<br>1234567-2A7B<br>1234567-1D3B<br>1234567-1F66<br>1234567-6FF1</td></tr>
<tr><td class="s7" style="font-weight: bold;">Fujitsu-Siemens</td><td class="s8">5 decimal digits</td><td class="s9" style="font-family: monospace;">12345</td></tr>
<tr><td class="s7" style="font-weight: bold;">Fujitsu-Siemens</td><td class="s8">8 hexadecimal digits</td><td class="s9" style="font-family: monospace;">DEADBEEF</td></tr>
<tr><td class="s7" style="font-weight: bold;">Fujitsu-Siemens</td><td class="s8">5x4 hexadecimal digits</td><td class="s9" style="font-family: monospace;">AAAA-BBBB-CCCC-DEAD-BEEF</td></tr>
<tr><td class="s7" style="font-weight: bold;">Fujitsu-Siemens</td><td class="s8">5x4 decimal digits</td><td class="s9" style="font-family: monospace;">1234-4321-1234-4321-1234</td></tr>
<tr><td class="s7" style="font-weight: bold;">Hewlett-Packard</td><td class="s8">5 decimal digits</td><td class="s9" style="font-family: monospace;">12345</td></tr>
<tr><td class="s7" style="font-weight: bold;">Hewlett-Packard/Compaq Netbooks</td><td class="s8">10 characters</td><td class="s9" style="font-family: monospace;">CNU1234ABC</td></tr>
<tr><td class="s11" style="font-weight: bold;">Insyde H20 (generic)</td><td class="s8">8 decimal digits</td><td class="s9" style="font-family: monospace;">03133610</td></tr>
<tr><td class="s11" style="font-weight: bold;">Phoenix (generic)</td><td class="s8">5 decimal digits</td><td class="s9" style="font-family: monospace;">12345</td></tr>
<tr><td class="s7" style="font-weight: bold;">Sony</td><td class="s8">7 digit serial number</td><td class="s9" style="font-family: monospace;">1234567</td></tr>
<tr><td class="s7" style="font-weight: bold;">Samsung</td><td class="s8">12 hexadecimal digits</td><td class="s9" style="font-family: monospace;">07088120410C0000</td></tr>
</tbody></table>
<footer style="text-align: center;">
-30
View File
@@ -1,30 +0,0 @@
<html>
<head>
<script type="text/javascript" src="./decrypt_bios.js">
</script>
<script type="text/javascript" >
function calcPass(){
var serial = document.getElementById('serial_id').value;
var str = "";
var pass_object = autoGetBiosPwd(serial);
for(var i in pass_object){
str += i + " : " + pass_object[i] + "<br />"
}
var an = document.getElementById("answer");
an.innerHTML = str;
}
</script>
</head>
<body>
Text
<form name="pwgen" id="form_id">
<input type="text" name="serial" id="serial_id" />
<input type="button" name="serial" id="button_id" value="Calc" onclick="calcPass()" />
</form>
<div id="answer">
</div>
</body>
</html>
+21 -14
View File
@@ -9,31 +9,38 @@
"typescript": "^2.6.2"
},
"devDependencies": {
"clean-webpack-plugin": "^0.1.18",
"copy-webpack-plugin": "^4.3.1",
"coveralls": "^3.0.0",
"gulp": "^3.9.1",
"gulp-istanbul": "^1.1.3",
"gulp-sourcemaps": "^2.6.4",
"gulp-tslint": "^8.1.2",
"gulp-typescript": "^3.2.3",
"gulp-sourcemaps": "^2.6.4",
"html-webpack-plugin": "^2.30.1",
"istanbul": "^0.4.5",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-jasmine": "^1.1.1",
"karma-sauce-launcher": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.9",
"remap-istanbul": "^0.10.1",
"ts-loader": "^3.3.1",
"tslint": "^5.8.0",
"typescript": "^2.6.2",
"webpack": "^3.10.0",
"karma": "^2.0.0",
"karma-jasmine": "^1.1.1",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-sauce-launcher": "^1.2.0",
"karma-webpack": "^2.0.9",
"karma-sourcemap-loader": "^0.3.7",
"ts-loader": "^3.3.1",
"istanbul": "^0.4.5",
"gulp-istanbul": "^1.1.3",
"remap-istanbul": "^0.10.1",
"coveralls": "^3.0.0"
"webpack-closure-compiler": "^2.1.6",
"webpack-dev-server": "^2.11.1"
},
"scripts": {
"test": "gulp test",
"lint": "gulp lint",
"cover": "gulp coverage",
"browser-test": "karma start"
"browser-test": "karma start",
"webpack": "webpack",
"dev-server": "webpack-dev-server"
},
"repository": {
"type": "git",
+8
View File
@@ -0,0 +1,8 @@
import { keygen } from "./keygen";
describe("BIOS keygen", () => {
it("Sony key for 1234567 is 9648669", () => {
let keysList = keygen("1234567");
expect(keysList[0][1]).toEqual(["9648669"]);
});
});
+40
View File
@@ -0,0 +1,40 @@
import { dellHddSolver, dellSolver, hddOldSolver } from "./dell";
import { fsi20DecNewSolver, fsi20DecOldSolver, fsiHexSolver } from "./fsi";
import { hpMiniSolver } from "./hpmini";
import { insydeSolver } from "./insyde";
import {
phoenixFsiLSolver, phoenixFsiPSolver, phoenixFsiSolver,
phoenixFsiSSolver, phoenixFsiXSolver, phoenixHPCompaqSolver, phoenixSolver
} from "./phoenix";
import { samsungSolver } from "./samsung";
import { sonySolver } from "./sony";
import { Solver } from "./utils";
export type KeygenResult = [Solver, string[]];
export const solvers: Solver[] = [
sonySolver,
samsungSolver,
hddOldSolver,
dellSolver,
dellHddSolver,
fsiHexSolver,
fsi20DecNewSolver,
fsi20DecOldSolver,
hpMiniSolver,
insydeSolver,
phoenixSolver,
phoenixHPCompaqSolver,
phoenixFsiSolver,
phoenixFsiLSolver,
phoenixFsiPSolver,
phoenixFsiSSolver,
phoenixFsiXSolver
];
// NOTE: In future this function can change or even be removed
export function keygen(serial: string): KeygenResult[] {
return solvers
.map((solver): KeygenResult => [solver, solver(serial)])
.filter(([_, passwords]) => passwords !== undefined && passwords.length >= 1);
}
+48
View File
@@ -0,0 +1,48 @@
import { keygen, KeygenResult } from "./keygen";
/// <reference types="dom" />
let form = document.getElementById("form_id") as HTMLFormElement;
let serialInput = document.getElementById("serial_id") as HTMLInputElement;
let tryThis = document.getElementById("try_this") as HTMLElement;
let dellNote = document.getElementById("dell_note") as HTMLElement;
let answerElement = document.getElementById("answer") as HTMLDivElement;
function renderResult(results: KeygenResult[]): void {
let table = document.createElement("table");
table.classList.add("answer_table");
results.forEach(([solver, passwords]) => {
let trElem = document.createElement("tr");
let tdNameElem = document.createElement("td");
tdNameElem.appendChild(document.createTextNode(solver.biosName));
trElem.appendChild(tdNameElem);
let tdElem = document.createElement("td");
passwords.forEach((pwd, index) => {
if (index > 0) {
tdElem.appendChild(document.createElement("br"));
}
tdElem.appendChild(document.createTextNode(pwd));
});
trElem.appendChild(tdElem);
table.appendChild(trElem);
});
answerElement.appendChild(table);
}
form.addEventListener("submit", (event) => {
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
answerElement.innerHTML = ""; // remove old table
let results = keygen(serialInput.value);
if (results.length > 0) {
tryThis.style.display = "";
dellNote.style.display = "";
renderResult(results);
} else {
tryThis.style.display = "none";
dellNote.style.display = "none";
}
}, true);
+69
View File
@@ -0,0 +1,69 @@
const path = require('path');
const os = require('os');
const ClosureCompilerPlugin = require('webpack-closure-compiler');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
function makeClosureCompiler() {
var pluginOptions = {
compiler: {
compilation_level: "ADVANCED",
create_source_map: true
},
concurrency: os.cpus().length
};
if (process.env.CLOSURE_PATH) {
pluginOptions.compiler.jar = process.env.CLOSURE_PATH;
}
return new ClosureCompilerPlugin(pluginOptions);
}
var plugins = [
new CleanWebpackPlugin(['dist']),
new CopyWebpackPlugin([
{ from: 'assets/bootstrap.min.css'}
]),
new HtmlWebpackPlugin({
minify: {
collapseWhitespace: true,
conservativeCollapse: true,
removeComments: true
},
inject: true,
template: 'html/index.html'
})
];
if (process.env.PRODUCTION) {
plugins.push(makeClosureCompiler());
}
module.exports = {
entry: "./src/ui.ts",
output: {
filename: "bundle.[hash].js",
path: path.join(__dirname, "dist")
},
plugins: plugins,
devtool: "source-map",
devServer: {
contentBase: path.join(__dirname, "dist"),
port: 9000
},
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [{loader: 'ts-loader', options: {transpileOnly: true}}]
}
]
}
}