From 081b7316bf0eeffa7b590a98a527b9d376326b33 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 18 Nov 2021 18:17:47 -0800 Subject: [PATCH] Improved agent hashing file. --- agents/hashagents.bat | 3 +- agents/hashagents.js | 17 +++-- agents/hashagents.json | 156 +++++++++++++++++++++++++++++++++++++++++ agents/hashagents.txt | 45 ------------ 4 files changed, 169 insertions(+), 52 deletions(-) create mode 100644 agents/hashagents.json delete mode 100644 agents/hashagents.txt diff --git a/agents/hashagents.bat b/agents/hashagents.bat index d07ad7fb..f604f967 100644 --- a/agents/hashagents.bat +++ b/agents/hashagents.bat @@ -1 +1,2 @@ -MeshService-signed.exe hashagents.js > hashagents.txt \ No newline at end of file +MeshService-signed.exe hashagents.js > hashagents.json +pause \ No newline at end of file diff --git a/agents/hashagents.js b/agents/hashagents.js index 2f392b29..ddf68a67 100644 --- a/agents/hashagents.js +++ b/agents/hashagents.js @@ -1,4 +1,4 @@ -var fs = require('fs'), r = ''; +var fs = require('fs'); var agents = { 'MeshService-signed.exe': 3, @@ -27,11 +27,16 @@ var agents = { 'meshagent_osx-universal-64': 10005 } -for (var i in agents) { r += hashAgent(i, agents[i]); } -console.log(r); +var agentinfo = []; +for (var i in agents) { + var info = getAgentInfo(i, agents[i]); + if (info != null) { agentinfo.push(info); } +} +console.log(JSON.stringify(agentinfo, null, 2)); process.exit(); -function hashAgent(filename, id) { - if (fs.existsSync(filename) != true) return ''; - return id + ': ' + filename + '\r\n' + getSHA384FileHash(filename).toString('hex') + '\r\n'; +function getAgentInfo(filename, id) { + if (fs.existsSync(filename) != true) return null; + var stats = fs.statSync(filename); + return { id: id, filename: filename, hash: getSHA384FileHash(filename).toString('hex'), size: stats.size, mtime: stats.mtime }; } diff --git a/agents/hashagents.json b/agents/hashagents.json new file mode 100644 index 00000000..e99bd20e --- /dev/null +++ b/agents/hashagents.json @@ -0,0 +1,156 @@ +[ + { + "id": 3, + "filename": "MeshService-signed.exe", + "hash": "2CDC48B46AB3580DF2B184CEA7A77F6DA61DC8B7F0A8D46076A3CB1AFB394D6302E7ACE9918B67754F48578C26967929", + "size": 3423040, + "mtime": "2021-08-30T21:06:32Z" + }, + { + "id": 4, + "filename": "MeshService64-signed.exe", + "hash": "80645B8D669A2A74B9E53CE2A19CEAA73E0F7F45808B1EBDA4007A85740A64871F0CB8D6FEF12ED25F6352A3C9ED6468", + "size": 3037504, + "mtime": "2021-08-30T21:06:35Z" + }, + { + "id": 5, + "filename": "meshagent_x86", + "hash": "AF99F40A4BBF394CB15E6196D2AC58B605DCE855297240687131CB91947DC2B35556C2F7E11D2BCB9B10D3D023006D29", + "size": 3592672, + "mtime": "2021-09-10T07:19:52Z" + }, + { + "id": 6, + "filename": "meshagent_x86-64", + "hash": "9EF3E973A6363C13C5311699494F6C52574408805DFD848589B59000BDE3E8A414884BB8FCAA912689E051A57503E977", + "size": 3667280, + "mtime": "2021-09-10T07:20:01Z" + }, + { + "id": 9, + "filename": "meshagent_arm", + "hash": "67191C284B94F8A491224128A7FCA46934D71AB40E85C3A711E93693D544BB42C9A29A936DAC70FD0FA3C6EA5444EB60", + "size": 3082440, + "mtime": "2021-09-10T07:20:18Z" + }, + { + "id": 7, + "filename": "meshagent_mips", + "hash": "CBF5734FA56F446B2638409520B05BA4F3FB0B21ECC7F4A449FD4E05F782C4D15E1B1B183C3D61E7B4F9957F42D4CDE5", + "size": 4459048, + "mtime": "2021-09-10T07:20:09Z" + }, + { + "id": 13, + "filename": "meshagent_pogo", + "hash": "8149F61A680EB7F423D2238C464F3D4B129CC7D8BE535EA90AC85AA4953090980AC76A950EE0FBD733D7F56C04A85C0F", + "size": 3090672, + "mtime": "2021-09-10T07:20:28Z" + }, + { + "id": 15, + "filename": "meshagent_poky", + "hash": "E105402B8E8FD16D0FF167F05B5A5D31AA00A59138BD59DA71FAC598CB1FD7DEF0DB678C890C4BCEED3D154D17D0D48C", + "size": 3722776, + "mtime": "2021-09-10T07:20:38Z" + }, + { + "id": 16, + "filename": "meshagent_osx-x86-64", + "hash": "87A62A4A2973CED1ECAA0B9041C146C021ADF629654DAA88D3F91291423610155E02B6520F64F00D460EF2994B9AEE20", + "size": 4602880, + "mtime": "2021-08-30T22:13:56Z" + }, + { + "id": 18, + "filename": "meshagent_poky64", + "hash": "DA5A4D60ECF4F9E8209B75A6DECFD0E441069992817AFAB35C2B7C15E23F1AC282112834C98C40F6E191C1AB1707CCC9", + "size": 3421528, + "mtime": "2021-09-10T07:20:49Z" + }, + { + "id": 19, + "filename": "meshagent_x86_nokvm", + "hash": "C442B07E3B8AE297637F4CD8FAC0265E933B1CFBAB32CF853FA820D7A5C458D8F1EABA6357930063CCA1535431858F75", + "size": 3311940, + "mtime": "2021-09-10T07:20:58Z" + }, + { + "id": 20, + "filename": "meshagent_x86-64_nokvm", + "hash": "D636882449476750999C1A74A302D97ECBD90E018F8D2708CA0AF64C6708A62D64A84AD6A543D50776DA888FC11AA5A0", + "size": 3372336, + "mtime": "2021-09-10T07:21:06Z" + }, + { + "id": 24, + "filename": "meshagent_arm-linaro", + "hash": "68FEC6927EEDC000FC768A47685B9240D72A625F11A69DE2198AD125096DAA93699C2BDAC130A4C8E060946FBF64F910", + "size": 2149632, + "mtime": "2021-09-10T07:21:19Z" + }, + { + "id": 25, + "filename": "meshagent_armhf", + "hash": "327956E768DCCF7B02DD1AE1E024169E2FCA1D7B605703CC8AE948E7FF94C8572BC561794C5667C0E51C3844DACFD4E1", + "size": 3109428, + "mtime": "2021-09-10T00:59:44Z" + }, + { + "id": 27, + "filename": "meshagent_armhf2", + "hash": "0AE840520D3B677B9767EA097F3AA5A1E24212529E688200F43935DB1541AB9FB441EC2C7BA8002D45299B04695FD037", + "size": 2837724, + "mtime": "2021-08-30T21:10:03Z" + }, + { + "id": 28, + "filename": "meshagent_mips24kc", + "hash": "E78A135132AD6E8C7CBAD0576FCC61FAE97D3AB0C29FCEFB704AA664B179AE296E2B562B84A7A0D717CB6C12A680289A", + "size": 4105420, + "mtime": "2021-08-30T22:02:32Z" + }, + { + "id": 29, + "filename": "meshagent_osx-arm-64", + "hash": "6B65D0949B5505A61552AD14DA6F59A8B98E922186F0027925BC64979D2D84EF76169ABCFF08A67515AE7368F63D0C87", + "size": 3843944, + "mtime": "2021-08-30T22:13:56Z" + }, + { + "id": 30, + "filename": "meshagent_freebsd_x86-64", + "hash": "D65C1F4180C03387F438F9051A7830C7F56DBFD618A951FB2142F7871AD998D5B61182FB693DDDDB2F31B3000D59E52D", + "size": 4599672, + "mtime": "2021-09-10T01:07:08Z" + }, + { + "id": 32, + "filename": "meshagent_aarch64", + "hash": "49216370F497A7C0DA531FA2DFC478582865E7C547FD54E44E84BA12A271CD7AC529F7B7A8F2C8F531726E625631A941", + "size": 3170528, + "mtime": "2021-09-10T00:59:00Z" + }, + { + "id": 40, + "filename": "meshagent_mipsel24kc", + "hash": "A94FE82E0265B1265B1C373722C448631035486E819132B037733BA205730DD71D8C8C16B1057B36B5569AEB4411ADB1", + "size": 4101068, + "mtime": "2021-08-30T22:03:12Z" + }, + { + "id": 41, + "filename": "meshagent_aarch64-cortex-a53", + "hash": "B481A87A8EB803E09118B6F55B9344403926EA9324B3C669D2BA37014DDB79655678BC7D8D7843AD19FFADBB130D0203", + "size": 3002552, + "mtime": "2021-08-30T22:03:50Z" + }, + { + "id": 10005, + "filename": "meshagent_osx-universal-64", + "hash": "52EB0C2321108E57A113AB3115E0DE74EA4B07F4B7D80E4FB146DE275D63B1354869071AE7F56097B0D6271205B1FDAD", + "size": 8464232, + "mtime": "2021-08-30T22:13:56Z" + } +] diff --git a/agents/hashagents.txt b/agents/hashagents.txt deleted file mode 100644 index e4f8b339..00000000 --- a/agents/hashagents.txt +++ /dev/null @@ -1,45 +0,0 @@ -3: MeshService-signed.exe -2CDC48B46AB3580DF2B184CEA7A77F6DA61DC8B7F0A8D46076A3CB1AFB394D6302E7ACE9918B67754F48578C26967929 -4: MeshService64-signed.exe -80645B8D669A2A74B9E53CE2A19CEAA73E0F7F45808B1EBDA4007A85740A64871F0CB8D6FEF12ED25F6352A3C9ED6468 -5: meshagent_x86 -AF99F40A4BBF394CB15E6196D2AC58B605DCE855297240687131CB91947DC2B35556C2F7E11D2BCB9B10D3D023006D29 -6: meshagent_x86-64 -9EF3E973A6363C13C5311699494F6C52574408805DFD848589B59000BDE3E8A414884BB8FCAA912689E051A57503E977 -9: meshagent_arm -67191C284B94F8A491224128A7FCA46934D71AB40E85C3A711E93693D544BB42C9A29A936DAC70FD0FA3C6EA5444EB60 -7: meshagent_mips -CBF5734FA56F446B2638409520B05BA4F3FB0B21ECC7F4A449FD4E05F782C4D15E1B1B183C3D61E7B4F9957F42D4CDE5 -13: meshagent_pogo -8149F61A680EB7F423D2238C464F3D4B129CC7D8BE535EA90AC85AA4953090980AC76A950EE0FBD733D7F56C04A85C0F -15: meshagent_poky -E105402B8E8FD16D0FF167F05B5A5D31AA00A59138BD59DA71FAC598CB1FD7DEF0DB678C890C4BCEED3D154D17D0D48C -16: meshagent_osx-x86-64 -87A62A4A2973CED1ECAA0B9041C146C021ADF629654DAA88D3F91291423610155E02B6520F64F00D460EF2994B9AEE20 -18: meshagent_poky64 -DA5A4D60ECF4F9E8209B75A6DECFD0E441069992817AFAB35C2B7C15E23F1AC282112834C98C40F6E191C1AB1707CCC9 -19: meshagent_x86_nokvm -C442B07E3B8AE297637F4CD8FAC0265E933B1CFBAB32CF853FA820D7A5C458D8F1EABA6357930063CCA1535431858F75 -20: meshagent_x86-64_nokvm -D636882449476750999C1A74A302D97ECBD90E018F8D2708CA0AF64C6708A62D64A84AD6A543D50776DA888FC11AA5A0 -24: meshagent_arm-linaro -68FEC6927EEDC000FC768A47685B9240D72A625F11A69DE2198AD125096DAA93699C2BDAC130A4C8E060946FBF64F910 -25: meshagent_armhf -327956E768DCCF7B02DD1AE1E024169E2FCA1D7B605703CC8AE948E7FF94C8572BC561794C5667C0E51C3844DACFD4E1 -27: meshagent_armhf2 -0AE840520D3B677B9767EA097F3AA5A1E24212529E688200F43935DB1541AB9FB441EC2C7BA8002D45299B04695FD037 -28: meshagent_mips24kc -E78A135132AD6E8C7CBAD0576FCC61FAE97D3AB0C29FCEFB704AA664B179AE296E2B562B84A7A0D717CB6C12A680289A -29: meshagent_osx-arm-64 -6B65D0949B5505A61552AD14DA6F59A8B98E922186F0027925BC64979D2D84EF76169ABCFF08A67515AE7368F63D0C87 -30: meshagent_freebsd_x86-64 -D65C1F4180C03387F438F9051A7830C7F56DBFD618A951FB2142F7871AD998D5B61182FB693DDDDB2F31B3000D59E52D -32: meshagent_aarch64 -49216370F497A7C0DA531FA2DFC478582865E7C547FD54E44E84BA12A271CD7AC529F7B7A8F2C8F531726E625631A941 -40: meshagent_mipsel24kc -A94FE82E0265B1265B1C373722C448631035486E819132B037733BA205730DD71D8C8C16B1057B36B5569AEB4411ADB1 -41: meshagent_aarch64-cortex-a53 -B481A87A8EB803E09118B6F55B9344403926EA9324B3C669D2BA37014DDB79655678BC7D8D7843AD19FFADBB130D0203 -10005: meshagent_osx-universal-64 -52EB0C2321108E57A113AB3115E0DE74EA4B07F4B7D80E4FB146DE275D63B1354869071AE7F56097B0D6271205B1FDAD -