2016-11-28 11:42:58 +01:00
|
|
|
/**
|
|
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2016
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2017-04-09 15:06:59 +02:00
|
|
|
// Styles
|
2017-05-19 00:24:24 +02:00
|
|
|
import "./stylesheets/index.js";
|
2017-03-23 19:41:36 +01:00
|
|
|
|
|
|
|
// Libs
|
2018-06-09 11:43:36 +02:00
|
|
|
import "arrive";
|
2018-06-20 01:18:59 +02:00
|
|
|
import "snackbarjs";
|
2018-06-09 11:43:36 +02:00
|
|
|
import "bootstrap-material-design";
|
2017-03-23 19:41:36 +01:00
|
|
|
import "bootstrap-colorpicker";
|
2018-03-26 23:25:36 +02:00
|
|
|
import moment from "moment-timezone";
|
2018-05-16 12:39:30 +02:00
|
|
|
import * as CanvasComponents from "../core/lib/CanvasComponents";
|
2017-03-23 19:41:36 +01:00
|
|
|
|
|
|
|
// CyberChef
|
2018-05-15 19:36:45 +02:00
|
|
|
import App from "./App";
|
2018-05-06 13:24:01 +02:00
|
|
|
import Categories from "../core/config/Categories.json";
|
2018-03-27 00:14:23 +02:00
|
|
|
import OperationConfig from "../core/config/OperationConfig.json";
|
2017-03-23 19:41:36 +01:00
|
|
|
|
2017-03-21 23:41:44 +01:00
|
|
|
|
2016-11-28 11:42:58 +01:00
|
|
|
/**
|
|
|
|
* Main function used to build the CyberChef web app.
|
|
|
|
*/
|
2017-04-13 19:31:26 +02:00
|
|
|
function main() {
|
2017-04-13 19:08:50 +02:00
|
|
|
const defaultFavourites = [
|
2016-11-28 11:42:58 +01:00
|
|
|
"To Base64",
|
|
|
|
"From Base64",
|
|
|
|
"To Hex",
|
|
|
|
"From Hex",
|
|
|
|
"To Hexdump",
|
|
|
|
"From Hexdump",
|
|
|
|
"URL Decode",
|
|
|
|
"Regular expression",
|
|
|
|
"Entropy",
|
2018-01-14 17:07:39 +01:00
|
|
|
"Fork",
|
|
|
|
"Magic"
|
2016-11-28 11:42:58 +01:00
|
|
|
];
|
2017-02-09 16:09:33 +01:00
|
|
|
|
2017-04-13 19:08:50 +02:00
|
|
|
const defaultOptions = {
|
2017-12-27 13:29:10 +01:00
|
|
|
updateUrl: true,
|
|
|
|
showHighlighter: true,
|
|
|
|
treatAsUtf8: true,
|
|
|
|
wordWrap: true,
|
|
|
|
showErrors: true,
|
|
|
|
errorTimeout: 4000,
|
|
|
|
attemptHighlight: true,
|
|
|
|
theme: "classic",
|
|
|
|
useMetaKey: false,
|
2018-01-06 16:29:58 +01:00
|
|
|
ioDisplayThreshold: 512,
|
2018-08-03 21:18:19 +02:00
|
|
|
logLevel: "info",
|
|
|
|
autoMagic: true,
|
2019-03-19 15:38:46 +01:00
|
|
|
imagePreview: true,
|
2019-04-03 13:00:47 +02:00
|
|
|
syncTabs: true
|
2016-11-28 11:42:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
document.removeEventListener("DOMContentLoaded", main, false);
|
2017-03-23 18:52:20 +01:00
|
|
|
window.app = new App(Categories, OperationConfig, defaultFavourites, defaultOptions);
|
2016-11-28 11:42:58 +01:00
|
|
|
window.app.setup();
|
2017-04-13 19:31:26 +02:00
|
|
|
}
|
2016-11-28 11:42:58 +01:00
|
|
|
|
2017-03-22 17:55:21 +01:00
|
|
|
window.compileTime = moment.tz(COMPILE_TIME, "DD/MM/YYYY HH:mm:ss z", "UTC").valueOf();
|
|
|
|
window.compileMessage = COMPILE_MSG;
|
2016-11-28 11:42:58 +01:00
|
|
|
|
2017-03-27 20:43:50 +02:00
|
|
|
// Make libs available to operation outputs
|
|
|
|
window.CanvasComponents = CanvasComponents;
|
|
|
|
|
2016-11-28 11:42:58 +01:00
|
|
|
document.addEventListener("DOMContentLoaded", main, false);
|
2018-04-05 17:58:19 +02:00
|
|
|
|