From b34c8fecd62b7c0e26a51924802ce1b2d62da602 Mon Sep 17 00:00:00 2001 From: hexahigh <97455552+hexahigh@users.noreply.github.com> Date: Wed, 15 Mar 2023 19:13:33 +0100 Subject: [PATCH] update --- dbcreator2.js | 43 ++++++++++++++++++--------------- node_modules/.package-lock.json | 11 --------- package-lock.json | 23 ------------------ 3 files changed, 23 insertions(+), 54 deletions(-) diff --git a/dbcreator2.js b/dbcreator2.js index f99a2ee..b4db931 100644 --- a/dbcreator2.js +++ b/dbcreator2.js @@ -5,7 +5,7 @@ var crypto = require('crypto'); var os = require("os"); let arraynumber = 1 -let filetoadd2 = nil +let filetoadd2 = 0 const filetoadd = prompt("Enter path/name of file/folder to be added: "); @@ -16,7 +16,7 @@ function delay(milliseconds) { }); } -fs.readdir(filetoadd, (err, files) => { +const test1 = fs.readdir(filetoadd, (err, files) => { if (err) { console.error(`Error reading directory: ${err}`); return; @@ -31,28 +31,31 @@ fs.readdir(filetoadd, (err, files) => { console.log(fileNamesAndExtensions); }); +console.log(test1) +loop1() +function loop1() { + while (true) { + filetoadd2 = fileNamesAndExtensions[arraynumber] + let buff = fs.readFileSync(filetoadd2); + let outputdata0 = crypto.createHash("md5").update(buff).digest("hex"); + let outputdata = outputdata0.toString().toUpperCase(); -while(true) { - let filetoadd2 = fileNamesAndExtensions[arraynumber] - let buff = fs.readFileSync(filetoadd2); - let outputdata0 = crypto.createHash("md5").update(buff).digest("hex"); - let outputdata = outputdata0.toString().toUpperCase(); + let text = outputdata; + processInput() - let text = outputdata; - processInput() + //const directoryPath = '/path/to/directory'; // Replace with your directory path - //const directoryPath = '/path/to/directory'; // Replace with your directory path - - function processInput() { - fs.open('customdb.txt', 'a', 666, function (e, id) { - fs.write(id, text + os.EOL, null, 'utf8', function () { - fs.close(id, function () { - arraynumber = arraynumber + 1 - //console.log('Custom database is updated, check the dbcreator.txt file'); - //console.log('If the file is a virus, please submit the hash here:'); - //console.log('\x1b[32m%s\x1b[0m', "boof.eu.org/other/av-hashes") + function processInput() { + fs.open('customdb.txt', 'a', 666, function (e, id) { + fs.write(id, text + os.EOL, null, 'utf8', function () { + fs.close(id, function () { + arraynumber = arraynumber + 1 + //console.log('Custom database is updated, check the dbcreator.txt file'); + //console.log('If the file is a virus, please submit the hash here:'); + //console.log('\x1b[32m%s\x1b[0m', "boof.eu.org/other/av-hashes") + }); }); }); - }); + } } } diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 9e304b0..2718561 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -12,17 +12,6 @@ "node": ">=6" } }, - "node_modules/crypto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", - "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==", - "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in." - }, - "node_modules/fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" - }, "node_modules/prompt-sync": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz", diff --git a/package-lock.json b/package-lock.json index 630163a..3134b39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,6 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "crypto": "^1.0.1", - "fs": "^0.0.1-security", "prompt-sync": "^4.2.0" } }, @@ -22,17 +20,6 @@ "node": ">=6" } }, - "node_modules/crypto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", - "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==", - "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in." - }, - "node_modules/fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" - }, "node_modules/prompt-sync": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz", @@ -59,16 +46,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==" }, - "crypto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", - "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==" - }, - "fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" - }, "prompt-sync": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz",