From 285e51248387b320854f425df1722e13fafa39ce Mon Sep 17 00:00:00 2001 From: Matt C Date: Tue, 15 May 2018 16:04:57 +0100 Subject: [PATCH] Actually made these ops work --- src/core/lib/PGP.mjs | 6 ++--- src/core/operations/DisassembleX86.mjs | 2 +- src/core/operations/GeneratePGPKeyPair.mjs | 5 ++-- src/core/operations/PGPDecrypt.mjs | 5 ++-- src/core/operations/PGPDecryptAndVerify.mjs | 5 ++-- src/core/operations/PGPEncrypt.mjs | 5 ++-- src/core/operations/PGPEncryptAndSign.mjs | 5 ++-- ...ssembleX86-64.js => DisassembleX86-64.mjs} | 26 +++++++++---------- 8 files changed, 32 insertions(+), 27 deletions(-) rename src/core/vendor/{DisassembleX86-64.js => DisassembleX86-64.mjs} (99%) diff --git a/src/core/lib/PGP.mjs b/src/core/lib/PGP.mjs index 3b034ec5..ea222ae8 100644 --- a/src/core/lib/PGP.mjs +++ b/src/core/lib/PGP.mjs @@ -10,9 +10,9 @@ * */ -import * as kbpgp from "kbpgp"; -import { promisify } from "es6-promisify"; - +import kbpgp from "kbpgp"; +import promisifyDefault from "es6-promisify"; +const promisify = promisifyDefault.promisify; /** * Progress callback * diff --git a/src/core/operations/DisassembleX86.mjs b/src/core/operations/DisassembleX86.mjs index 5b207205..00fe6083 100644 --- a/src/core/operations/DisassembleX86.mjs +++ b/src/core/operations/DisassembleX86.mjs @@ -5,7 +5,7 @@ */ import Operation from "../Operation"; -import disassemble from "../vendor/DisassembleX86-64.js"; +import * as disassemble from "../vendor/DisassembleX86-64"; /** * Disassemble x86 operation */ diff --git a/src/core/operations/GeneratePGPKeyPair.mjs b/src/core/operations/GeneratePGPKeyPair.mjs index d7cf6ba3..77a60fae 100644 --- a/src/core/operations/GeneratePGPKeyPair.mjs +++ b/src/core/operations/GeneratePGPKeyPair.mjs @@ -7,9 +7,10 @@ */ import Operation from "../Operation"; -import * as kbpgp from "kbpgp"; -import { promisify } from "es6-promisify"; +import kbpgp from "kbpgp"; import { getSubkeySize, ASP } from "../lib/PGP"; +import promisifyDefault from "es6-promisify"; +const promisify = promisifyDefault.promisify; /** * Generate PGP Key Pair operation */ diff --git a/src/core/operations/PGPDecrypt.mjs b/src/core/operations/PGPDecrypt.mjs index 47ce787a..ba94fa9a 100644 --- a/src/core/operations/PGPDecrypt.mjs +++ b/src/core/operations/PGPDecrypt.mjs @@ -5,9 +5,10 @@ */ import Operation from "../Operation"; -import * as kbpgp from "kbpgp"; -import { promisify } from "es6-promisify"; +import kbpgp from "kbpgp"; import { ASP, importPrivateKey } from "../lib/PGP"; +import promisifyDefault from "es6-promisify"; +const promisify = promisifyDefault.promisify; /** * PGP Decrypt operation diff --git a/src/core/operations/PGPDecryptAndVerify.mjs b/src/core/operations/PGPDecryptAndVerify.mjs index d02d6d2e..63a16019 100644 --- a/src/core/operations/PGPDecryptAndVerify.mjs +++ b/src/core/operations/PGPDecryptAndVerify.mjs @@ -5,9 +5,10 @@ */ import Operation from "../Operation"; -import * as kbpgp from "kbpgp"; -import { promisify } from "es6-promisify"; +import kbpgp from "kbpgp"; import { ASP, importPrivateKey, importPublicKey } from "../lib/PGP"; +import promisifyDefault from "es6-promisify"; +const promisify = promisifyDefault.promisify; /** * PGP Decrypt and Verify operation diff --git a/src/core/operations/PGPEncrypt.mjs b/src/core/operations/PGPEncrypt.mjs index b4193a80..b2aa50dc 100644 --- a/src/core/operations/PGPEncrypt.mjs +++ b/src/core/operations/PGPEncrypt.mjs @@ -5,9 +5,10 @@ */ import Operation from "../Operation"; -import * as kbpgp from "kbpgp"; -import { promisify } from "es6-promisify"; +import kbpgp from "kbpgp"; import { ASP } from "../lib/PGP"; +import promisifyDefault from "es6-promisify"; +const promisify = promisifyDefault.promisify; /** * PGP Encrypt operation */ diff --git a/src/core/operations/PGPEncryptAndSign.mjs b/src/core/operations/PGPEncryptAndSign.mjs index 165bc9be..72631987 100644 --- a/src/core/operations/PGPEncryptAndSign.mjs +++ b/src/core/operations/PGPEncryptAndSign.mjs @@ -5,9 +5,10 @@ */ import Operation from "../Operation"; -import * as kbpgp from "kbpgp"; -import { promisify } from "es6-promisify"; +import kbpgp from "kbpgp"; import { ASP, importPrivateKey, importPublicKey } from "../lib/PGP"; +import promisifyDefault from "es6-promisify"; +const promisify = promisifyDefault.promisify; /** * PGP Encrypt and Sign operation diff --git a/src/core/vendor/DisassembleX86-64.js b/src/core/vendor/DisassembleX86-64.mjs similarity index 99% rename from src/core/vendor/DisassembleX86-64.js rename to src/core/vendor/DisassembleX86-64.mjs index e320c6c2..f0d30511 100644 --- a/src/core/vendor/DisassembleX86-64.js +++ b/src/core/vendor/DisassembleX86-64.mjs @@ -3316,7 +3316,7 @@ If input "type" is set 5 it will adjust the mnemonic array to decode Centaur ins If input "type" is set 6 it will adjust the mnemonic array to decode instruction for the X86/486 CPU which conflict with the vector unit instructions with UMOV. -------------------------------------------------------------------------------------------------------------------------*/ -function CompatibilityMode( type ) +export function CompatibilityMode( type ) { //Reset the changeable sections of the Mnemonics array, and operand encoding array. @@ -3515,7 +3515,7 @@ The function "GetPosition()" Gives back the current base address in it's proper If the hex input is invalid returns false. -------------------------------------------------------------------------------------------------------------------------*/ -function LoadBinCode( HexStr ) +export function LoadBinCode( HexStr ) { //Clear BinCode, and Reset Code Position in Bin Code array. @@ -3605,7 +3605,7 @@ segment, and offset address. Note that the Code Segment is used in 16 bit code. if set 36, or higher. Effects instruction location in memory when decoding a program. -------------------------------------------------------------------------------------------------------------------------*/ -function SetBasePosition( Address ) +export function SetBasePosition( Address ) { //Split the Segment:offset. @@ -5652,7 +5652,7 @@ function Reset() do an linear disassemble. -------------------------------------------------------------------------------------------------------------------------*/ -function LDisassemble() +export function LDisassemble() { var Instruction = ""; //Stores the Decoded instruction. var Out = ""; //The Disassemble output @@ -5709,13 +5709,13 @@ function LDisassemble() * The following code has been added to expose public methods for use in CyberChef */ -export default { - LoadBinCode: LoadBinCode, - LDisassemble: LDisassemble, - SetBasePosition: SetBasePosition, - CompatibilityMode: CompatibilityMode, - - setBitMode: val => { BitMode = val; }, - setShowInstructionHex: val => { ShowInstructionHex = val; }, - setShowInstructionPos: val => { ShowInstructionPos = val; }, +export function setBitMode (val) { + BitMode = val; }; +export function setShowInstructionHex (val) { + ShowInstructionHex = val; +}; +export function setShowInstructionPos (val) { + ShowInstructionPos = val; +}; +