Updated dependencies

feature-extract-files
n1474335 2018-01-26 19:14:05 +00:00
parent 614af0602a
commit 1c711f5e03
9 changed files with 1722 additions and 256 deletions

1901
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1",
"css-loader": "^0.28.7",
"css-loader": "^0.28.9",
"exports-loader": "^0.6.4",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.6",
@ -46,7 +46,7 @@
"grunt-eslint": "^20.1.0",
"grunt-exec": "~3.0.0",
"grunt-execute": "^0.2.2",
"grunt-jsdoc": "^2.2.0",
"grunt-jsdoc": "^2.2.1",
"grunt-webpack": "^3.0.2",
"html-webpack-plugin": "^2.30.1",
"imports-loader": "^0.7.1",
@ -56,19 +56,19 @@
"less-loader": "^4.0.5",
"postcss-css-variables": "^0.8.0",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.9",
"postcss-loader": "^2.0.10",
"style-loader": "^0.19.1",
"url-loader": "^0.6.2",
"val-loader": "^1.1.0",
"web-resource-inliner": "^4.2.0",
"web-resource-inliner": "^4.2.1",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.9.7",
"webpack-dev-server": "^2.11.1",
"webpack-node-externals": "^1.6.0",
"worker-loader": "^1.1.0"
},
"dependencies": {
"babel-polyfill": "^6.26.0",
"bignumber.js": "^5.0.0",
"bignumber.js": "^6.0.0",
"bootstrap": "^3.3.7",
"bootstrap-colorpicker": "^2.5.2",
"bootstrap-switch": "^3.3.4",
@ -81,14 +81,14 @@
"exif-parser": "^0.1.12",
"file-saver": "^1.3.3",
"highlight.js": "^9.12.0",
"jquery": "^3.2.1",
"jquery": "^3.3.1",
"js-crc": "^0.2.0",
"js-sha3": "^0.7.0",
"jsbn": "^1.1.0",
"jsonpath": "^1.0.0",
"jsrsasign": "8.0.4",
"lodash": "^4.17.4",
"loglevel": "^1.6.0",
"loglevel": "^1.6.1",
"loglevel-message-prefix": "^3.0.0",
"moment": "^2.20.1",
"moment-timezone": "^0.5.14",

View File

@ -2455,7 +2455,7 @@ const OperationConfig = {
]
},
"Windows Filetime to UNIX Timestamp": {
module: "JSBN",
module: "Default",
description: "Converts a Windows Filetime value to a UNIX timestamp.<br><br>A Windows Filetime is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 UTC.<br><br>A UNIX timestamp is a 32-bit value representing the number of seconds since January 1, 1970 UTC (the UNIX epoch).<br><br>This operation also supports UNIX timestamps in milliseconds, microseconds and nanoseconds.",
inputType: "string",
outputType: "string",
@ -2473,7 +2473,7 @@ const OperationConfig = {
]
},
"UNIX Timestamp to Windows Filetime": {
module: "JSBN",
module: "Default",
description: "Converts a UNIX timestamp to a Windows Filetime value.<br><br>A Windows Filetime is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 UTC.<br><br>A UNIX timestamp is a 32-bit value representing the number of seconds since January 1, 1970 UTC (the UNIX epoch).<br><br>This operation also supports UNIX timestamps in milliseconds, microseconds and nanoseconds.",
inputType: "string",
outputType: "string",

View File

@ -10,6 +10,7 @@ import Convert from "../../operations/Convert.js";
import DateTime from "../../operations/DateTime.js";
import Endian from "../../operations/Endian.js";
import Entropy from "../../operations/Entropy.js";
import Filetime from "../../operations/Filetime.js";
import FileType from "../../operations/FileType.js";
import Hexdump from "../../operations/Hexdump.js";
import HTML from "../../operations/HTML.js";
@ -39,6 +40,7 @@ import UUID from "../../operations/UUID.js";
* - Utils.js
* - otp
* - crypto
* - bignumber.js
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
@ -157,6 +159,8 @@ OpModules.Default = {
"Mean": Arithmetic.runMean,
"Median": Arithmetic.runMedian,
"Standard Deviation": Arithmetic.runStdDev,
"Windows Filetime to UNIX Timestamp": Filetime.runFromFiletimeToUnix,
"UNIX Timestamp to Windows Filetime": Filetime.runToFiletimeFromUnix,
/*

View File

@ -1,5 +1,4 @@
import IP from "../../operations/IP.js";
import Filetime from "../../operations/Filetime.js";
/**
@ -21,8 +20,6 @@ OpModules.JSBN = {
"Parse IPv4 header": IP.runParseIPv4Header,
"Change IP format": IP.runChangeIpFormat,
"Group IP addresses": IP.runGroupIps,
"Windows Filetime to UNIX Timestamp": Filetime.runFromFiletimeToUnix,
"UNIX Timestamp to Windows Filetime": Filetime.runToFiletimeFromUnix,
};
export default OpModules;

View File

@ -69,7 +69,7 @@ const BCD = {
runToBCD: function(input, args) {
if (input.isNaN())
return "Invalid input";
if (!input.floor().equals(input))
if (!input.integerValue(BigNumber.ROUND_DOWN).isEqualTo(input))
return "Fractional values are not supported by BCD";
const encoding = BCD.ENCODING_LOOKUP[args[0]],

View File

@ -555,7 +555,7 @@ DES uses a key length of 8 bytes (64 bits).`;
return forge.util.bytesToHex(bytes);
case "Integer":
for (i = bytes.length - 1; i >= 0; i--) {
value = value.mul(256).plus(bytes.charCodeAt(i));
value = value.times(256).plus(bytes.charCodeAt(i));
}
return value.toFixed();
case "Byte array":

View File

@ -68,7 +68,7 @@ const Convert = {
let inputUnits = args[0],
outputUnits = args[1];
input = input.mul(Convert.DISTANCE_FACTOR[inputUnits]);
input = input.times(Convert.DISTANCE_FACTOR[inputUnits]);
return input.div(Convert.DISTANCE_FACTOR[outputUnits]);
},
@ -148,7 +148,7 @@ const Convert = {
let inputUnits = args[0],
outputUnits = args[1];
input = input.mul(Convert.DATA_FACTOR[inputUnits]);
input = input.times(Convert.DATA_FACTOR[inputUnits]);
return input.div(Convert.DATA_FACTOR[outputUnits]);
},
@ -228,7 +228,7 @@ const Convert = {
let inputUnits = args[0],
outputUnits = args[1];
input = input.mul(Convert.AREA_FACTOR[inputUnits]);
input = input.times(Convert.AREA_FACTOR[inputUnits]);
return input.div(Convert.AREA_FACTOR[outputUnits]);
},
@ -339,7 +339,7 @@ const Convert = {
let inputUnits = args[0],
outputUnits = args[1];
input = input.mul(Convert.MASS_FACTOR[inputUnits]);
input = input.times(Convert.MASS_FACTOR[inputUnits]);
return input.div(Convert.MASS_FACTOR[outputUnits]);
},
@ -404,7 +404,7 @@ const Convert = {
let inputUnits = args[0],
outputUnits = args[1];
input = input.mul(Convert.SPEED_FACTOR[inputUnits]);
input = input.times(Convert.SPEED_FACTOR[inputUnits]);
return input.div(Convert.SPEED_FACTOR[outputUnits]);
},

View File

@ -1,4 +1,4 @@
import {BigInteger} from "jsbn";
import BigNumber from "bignumber.js";
/**
* Windows Filetime operations.
@ -35,27 +35,29 @@ const Filetime = {
let units = args[0],
format = args[1];
if (!input) return "";
if (format === "Hex") {
input = new BigInteger(input, 16);
input = new BigNumber(input, 16);
} else {
input = new BigInteger(input);
input = new BigNumber(input);
}
input = input.subtract(new BigInteger("116444736000000000"));
input = input.minus(new BigNumber("116444736000000000"));
if (units === "Seconds (s)"){
input = input.divide(new BigInteger("10000000"));
input = input.dividedBy(new BigNumber("10000000"));
} else if (units === "Milliseconds (ms)") {
input = input.divide(new BigInteger("10000"));
input = input.dividedBy(new BigNumber("10000"));
} else if (units === "Microseconds (μs)") {
input = input.divide(new BigInteger("10"));
input = input.dividedBy(new BigNumber("10"));
} else if (units === "Nanoseconds (ns)") {
input = input.multiply(new BigInteger("100"));
input = input.multipliedBy(new BigNumber("100"));
} else {
throw "Unrecognised unit";
}
return input.toString();
return input.toFixed();
},
@ -71,26 +73,28 @@ const Filetime = {
let units = args[0],
format = args[1];
input = new BigInteger(input);
if (!input) return "";
input = new BigNumber(input);
if (units === "Seconds (s)"){
input = input.multiply(new BigInteger("10000000"));
input = input.multipliedBy(new BigNumber("10000000"));
} else if (units === "Milliseconds (ms)") {
input = input.multiply(new BigInteger("10000"));
input = input.multipliedBy(new BigNumber("10000"));
} else if (units === "Microseconds (μs)") {
input = input.multiply(new BigInteger("10"));
input = input.multiplyiedBy(new BigNumber("10"));
} else if (units === "Nanoseconds (ns)") {
input = input.divide(new BigInteger("100"));
input = input.dividedBy(new BigNumber("100"));
} else {
throw "Unrecognised unit";
}
input = input.add(new BigInteger("116444736000000000"));
input = input.plus(new BigNumber("116444736000000000"));
if (format === "Hex"){
return input.toString(16);
} else {
return input.toString();
return input.toFixed();
}
},