Loading Joe Sandbox Report ...

Edit tour

Windows Analysis Report
T710XblGiM.docm

Overview

General Information

Sample name:T710XblGiM.docm
renamed because original name is a hash value
Original sample name:140cc4e8f36d4403a99ed1557d11771bcdcd169f70b014f99e658b917f9ced2d.docm
Analysis ID:1590803
MD5:ef866288253b0d4d74a3aa7e8ee483cd
SHA1:befbd6f0cba766ebaf10d5de734936a982ab7d8a
SHA256:140cc4e8f36d4403a99ed1557d11771bcdcd169f70b014f99e658b917f9ced2d
Tags:app8490744docmhko247blackuser-JAMESWT_MHT
Infos:

Detection

Score:72
Range:0 - 100
Whitelisted:false
Confidence:100%

Signatures

Multi AV Scanner detection for submitted file
Document contains OLE streams with names of living off the land binaries
Document contains VBA stomped code (only p-code) potentially bypassing AV detection
Document contains an embedded VBA macro with suspicious strings
Document contains an embedded VBA with base64 encoded strings
Document contains an embedded VBA with many GOTO operations indicating source code obfuscation
Document contains an embedded macro with GUI obfuscation
Document contains an embedded VBA macro which executes code when the document is opened / closed
Document contains an embedded VBA which might only executes on specific systems (country or language check)
Document contains embedded VBA macros

Classification

  • System is w10x64
  • WINWORD.EXE (PID: 2376 cmdline: "C:\Program Files (x86)\Microsoft Office\Root\Office16\WINWORD.EXE" /Automation -Embedding MD5: 1A0C2C2E7D9C4BC18E91604E9B0C7678)
  • cleanup
No configs have been found
No yara matches

System Summary

barindex
Source: File createdAuthor: Nasreddine Bencherchali (Nextron Systems): Data: EventID: 11, Image: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE, ProcessId: 2376, TargetFilename: C:\Users\user\Desktop\~$10XblGiM.docm
No Suricata rule has matched

Click to jump to signature section

Show All Signature Results

AV Detection

barindex
Source: T710XblGiM.docmVirustotal: Detection: 37%Perma Link
Source: T710XblGiM.docmReversingLabs: Detection: 28%
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEFile opened: C:\Program Files (x86)\Microsoft Office\root\vfs\SystemX86\MSVCR100.dllJump to behavior

System Summary

barindex
Source: T710XblGiM.docmStream path 'VBA/Module1' : .....x...B#..\......#..F<..........(~................... .D.|........................OpenNotepad.OpenNotepad.OpenNotepad.......OpenNotepad.OpenNotepad.OpenNotepad.OpenNotepad.OpenNotepad...................................................................................x........................................ME.....................0.......<X......<.......<.......<......6......<.......<(.............................<`......<h......<p......<x......<...................... ........`.................... ...8k.........=.=................`.......`.......`B...............H...........`....H..............`..............X...`........6.....`................... .%..........p...`>.......................`........`f.......... ................................<...........................(..............0...H...p.........@...x......X......`...@...........@.....x.. ...@..`......@.....H......@..0......@.........@............@........@..X.........@........@...........@............@.. ...p......@..8...X......@..P...@......@..p...(......@............@...........@........8..................8......@...@...........@..0...............@..H.........@..`.........@..x...h......@.....P.........X.../..........@....0.. ...X........................h.........@........ ...@........ ...@.0..... ...@.H..... ...@.`..... ...@.x..... ...@...... ...@....p.. ...@....X.. ...@....@.. ...@....(.. ...@........ ...@. ..... ...@.8..... ...@.P..... ...@.h..... ...@...... ...@...... ...@....h.. ...@....P.. ...@....8.. ...@. .. ...&.d..N.......@....... ...@............@... ...@.p..... ...@./.. ......p.../.@...........p...2.....@...... ...@...... ...@.....h.. ...@. ...P.. ...@.8.. ............ ...@....... ...@....... ...@....... ...@.....p.. ...@.....X.. ...@.....@.. ................................h...(.. ...@........ ...@....... ...@....... ...@....... ...@....... ...@....... ...@....... ...@.....h.. ...@.....P.. ...@.....8.. ...@..... .. ...@........ ...@....... ...@....... ...@....... ...@....... ...@....... ...@.....x.. ...@.....`.. ...@.....H.. ...@.....0.. ...@........ ...@........ ...@....... ...@....... ...@....... ...@....... ...@....... ...@.....p.. ...@.....X.. ...@.....@.. ...@.....(.. ...@........ ........N..........p..... ......(.........@....... ...@....... ...@...../.. ...........J...................M........p..... ...@.....p.. ...@.....X.. ...@.....@.. ...@.....(.. .........X..... ...@....... ...@....... ...@.....x.. ...@.....`.. ...@.....H.. ...@.....0.. ...@........ ...@........ ...@....... ...@....... ...@....... ...@....... ...@....... ...@.....p.. ...@.....X.. ...@.....@.. ...@.....(.. ...@........ ...@....... ...@....... ...@....... ...@....... ...@....... ...@....... ...@.....h.. ...@.....P.. ...@.....8.. ...@..... .. ........N..........p...... ......(.........@....... ...@....... ...@...../.. ..........._...................b.......... ...@....... ...@.....h.. ...@.....P.. ...@.....8.. ...`..... ...@....... ...@....... ...@.....x.. ...@.....p.. ...@.....h.. ...@.....`.. ...@..
Source: T710XblGiM.docmStream path 'VBA/_VBA_PROJECT' : a..............................*.\.G.{.0.0.0.2.0.4.E.F.-.0.0.0.0.-.0.0.0.0.-.C.0.0.0.-.0.0.0.0.0.0.0.0.0.0.4.6.}.#.4...2.#.9.#.C.:.\.P.R.O.G.R.A.~.1.\.C.O.M.M.O.N.~.1.\.M.I.C.R.O.S.~.1.\.V.B.A.\.V.B.A.7...1.\.V.B.E.7...D.L.L.#.V.i.s.u.a.l. .B.a.s.i.c. .F.o.r. .A.p.p.l.i.c.a.t.i.o.n.s...............*.\.G.{.0.0.0.2.0.9.0.5.-.0.0.0.0.-.0.0.0.0.-.C.0.0.0.-.0.0.0.0.0.0.0.0.0.0.4.6.}.#.8...7.#.0.#.C.:.\.P.r.o.g.r.a.m. .F.i.l.e.s.\.M.i.c.r.o.s.o.f.t. .O.f.f.i.c.e.\.O.f.f.i.c.e.1.6.\.M.S.W.O.R.D...O.L.B.#.M.i.c.r.o.s.o.f.t. .W.o.r.d. .1.6...0. .O.b.j.e.c.t. .L.i.b.r.a.r.y..............*.\.G.{.0.0.0.2.0.4.3.0.-.0.0.0.0.-.0.0.0.0.-.C.0.0.0.-.0.0.0.0.0.0.0.0.0.0.4.6.}.#.2...0.#.0.#.C.:.\.W.i.n.d.o.w.s.\.S.y.s.t.e.m.3.2.\.s.t.d.o.l.e.2...t.l.b.#.O.L.E. .A.u.t.o.m.a.t.i.o.n...............*.\.C.N.o.r.m.a.l...*.\.C.N.o.r.m.a.l.oi........(.*.\.G.{.2.D.F.8.D.0.4.C.-.5.B.F.A.-.1.0.1.B.-.B.D.E.5.-.0.0.A.A.0.0.4.4.D.E.5.2.}.#.2...8.#.0.#.C.:.\.P.r.o.g.r.a.m. .F.i.l.e.s.\.C.o.m.m.o.n. .F.i.l.e.s.\.M.i.c.r.o.s.o.f.t. .S.h.a.r.e.d.\.O.F.F.I.C.E.1.6.\.M.S.O...D.L.L.#.M.i.c.r.o.s.o.f.t. .O.f.f.i.c.e. .1.6...0. .O.b.j.e.c.t. .L.i.b.r.a.r.y..............*.\.G.{.F.5.0.7.8.F.1.8.-.C.5.5.1.-.1.1.D.3.-.8.9.B.9.-.0.0.0.0.F.8.1.F.E.2.2.1.}.#.6...0.#.0.#.C.:.\.W.i.n.d.o.w.s.\.S.y.s.t.e.m.3.2.\.m.s.x.m.l.6...d.l.l.#.M.i.c.r.o.s.o.f.t. .X.M.L.,. .v.6...0.................................................".........Noi..............................(....T.h.i.s.D.o.c.u.m.e.n.t...0.8.6.9.6.f.9.9.4.e.%...T.h.i.s.D.o.c.u.m.e.n.t.6................M.o.d.u.l.e.1...0.=.6.9.6.f.9.9.4.f.6...M.o.d.u.l.e.1.~.......`... ....L<....M.o.d.u.l.e.2...0.:.6.9.6.f.9.9.4.e.....M.o.d.u.l.e.2.1......@....6....M.o.d.u.l.e.3...0.>.6.9.6.f.9.9.4.f....M.o.d.u.l.e.3.o......`................ ...`...@....\c3Ka.1....`.....oqL............h7.L.>dCc.... ....X_TD#2u3g....@............$............b..*.......currency..L.......Error........_..Wordk....VBA....Win16~....Win32......Win64x.....Mac....VBA6#....VBA7#....Project1......stdole`....Project-....ThisDocument<........_Evaluate.....Normal...(....Office.u....Documentj........OpenNotepad....%.C:\duong_dan_toi_dll\TenDLLCuaBan.dll}........RunNotepad.........Document_Open....Module1b...%.C:\duong dan toi dll\TenDLLCuaBan.dll..5.C:\Users\ADMIN\Desktop\Demo\bin\Debug\net8.0\Demo.dll..-.C:\du?ng_d?n_t?i_DLL_c?a_b?n\TenDLLCuaBan.dll;N........HexToBinaryP........hexStringn........i`.........lengthY........byteArrayY........GetDataFromURL........url........httpg....CreateObject........Send........Status+........responseTextw........ExecuteDecryptedCodeB........EncodedBinaryn........binaryDataNa........SavePath-........fileNum#....MsgBoxR....vbExclamation....Environ.,....shellV....vbHideW...._B_var_Environ/...._B_var_Midp........SaveBinaryToFile.........filePathO........ConvertTxtToExe........txtFilePathq........exeFilePath........E\........._B_var_E.........bufferSize........buffer-....EOF....LOFc........RunDecrypted#T........exeNum.,........lmd........di\........AESDecrypt.....
Source: T710XblGiM.docmOLE, VBA macro line: Private Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As LongPtr)
Source: T710XblGiM.docmOLE, VBA macro line: Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As LongPtr)
Source: T710XblGiM.docmOLE, VBA macro line: Private Declare PtrSafe Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpWideCharStr As LongPtr, ByVal cchWideChar As Long, lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpDefaultChar As LongPtr, ByVal lpUsedDefaultChar As LongPtr) As Long
Source: T710XblGiM.docmOLE, VBA macro line: Private Declare PtrSafe Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpWideCharStr As LongPtr, ByVal cchWideChar As Long) As Long
Source: T710XblGiM.docmOLE, VBA macro line: Private Declare PtrSafe Function FormatMessage Lib "kernel32" Alias "FormatMessageA" (ByVal dwFlags As Long, ByVal lpSource As LongPtr, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVal nSize As Long, ByVal Args As LongPtr) As Long
Source: T710XblGiM.docmOLE, VBA macro line: Private Declare Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpWideCharStr As LongPtr, ByVal cchWideChar As Long, lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpDefaultChar As LongPtr, ByVal lpUsedDefaultChar As LongPtr) As Long
Source: T710XblGiM.docmOLE, VBA macro line: Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpWideCharStr As LongPtr, ByVal cchWideChar As Long) As Long
Source: T710XblGiM.docmOLE, VBA macro line: Private Declare Function FormatMessage Lib "kernel32" Alias "FormatMessageA" (ByVal dwFlags As Long, ByVal lpSource As LongPtr, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVal nSize As Long, ByVal Args As LongPtr) As Long
Source: VBA code instrumentationOLE, VBA macro: Module Module3, Function pvCryptoAesCtrInit, String ObjectLength
Source: VBA code instrumentationOLE, VBA macro: Module Module3, Function pvCryptoAesCtrInit, String HashDigestLength
Source: T710XblGiM.docmStream path 'VBA/Module1' : Found suspicious string wscript.shell in non macro stream
Source: T710XblGiM.docmOLE, VBA macro line: Private Sub Document_Open()
Source: VBA code instrumentationOLE, VBA macro: Module ThisDocument, Function Document_OpenName: Document_Open
Source: T710XblGiM.docmOLE indicator, VBA macros: true
Source: classification engineClassification label: mal72.expl.evad.winDOCM@2/2@0/0
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEFile created: C:\Users\user\Desktop\~$10XblGiM.docmJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEFile created: C:\Users\user\AppData\Local\Temp\{754FD31E-97E7-4314-BD0C-9D5CFCE1B547} - OProcSessId.datJump to behavior
Source: T710XblGiM.docmOLE indicator, Word Document stream: true
Source: T710XblGiM.docmOLE document summary: title field not present or empty
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEFile read: C:\Users\desktop.iniJump to behavior
Source: T710XblGiM.docmVirustotal: Detection: 37%
Source: T710XblGiM.docmReversingLabs: Detection: 28%
Source: unknownProcess created: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE "C:\Program Files (x86)\Microsoft Office\Root\Office16\WINWORD.EXE" /Automation -Embedding
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess created: unknown unknownJump to behavior
Source: Window RecorderWindow detected: More than 3 window changes detected
Source: T710XblGiM.docmInitial sample: OLE zip file path = [trash]/0000.dat
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEKey opened: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\CommonJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEFile opened: C:\Program Files (x86)\Microsoft Office\root\vfs\SystemX86\MSVCR100.dllJump to behavior

Data Obfuscation

barindex
Source: T710XblGiM.docmStream path 'VBA/Module3' : High number of GOTO operations
Source: VBA code instrumentationOLE, VBA macro, High number of GOTO operations: Module Module3Name: Module3
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: FAILCRITICALERRORS | NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: T710XblGiM.docmStream path 'VBA/Module3' : , ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVa
Source: C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXEProcess information queried: ProcessInformationJump to behavior

HIPS / PFW / Operating System Protection Evasion

barindex
Source: T710XblGiM.docmOLE indicator, VBA stomping: true
ReconnaissanceResource DevelopmentInitial AccessExecutionPersistencePrivilege EscalationDefense EvasionCredential AccessDiscoveryLateral MovementCollectionCommand and ControlExfiltrationImpact
Gather Victim Identity Information42
Scripting
Valid AccountsWindows Management Instrumentation42
Scripting
1
Process Injection
1
Masquerading
OS Credential Dumping1
Process Discovery
Remote ServicesData from Local SystemData ObfuscationExfiltration Over Other Network MediumAbuse Accessibility Features
CredentialsDomainsDefault AccountsScheduled Task/Job1
Obfuscated Files or Information
Boot or Logon Initialization Scripts1
Process Injection
LSASS Memory1
File and Directory Discovery
Remote Desktop ProtocolData from Removable MediaJunk DataExfiltration Over BluetoothNetwork Denial of Service
Email AddressesDNS ServerDomain AccountsAtLogon Script (Windows)Logon Script (Windows)1
Deobfuscate/Decode Files or Information
Security Account Manager1
System Information Discovery
SMB/Windows Admin SharesData from Network Shared DriveSteganographyAutomated ExfiltrationData Encrypted for Impact
Hide Legend

Legend:

  • Process
  • Signature
  • Created File
  • DNS/IP Info
  • Is Dropped
  • Is Windows Process
  • Number of created Registry Values
  • Number of created Files
  • Visual Basic
  • Delphi
  • Java
  • .Net C# or VB.NET
  • C, C++ or other language
  • Is malicious
  • Internet

This section contains all screenshots as thumbnails, including those not shown in the slideshow.


windows-stand
SourceDetectionScannerLabelLink
T710XblGiM.docm38%VirustotalBrowse
T710XblGiM.docm29%ReversingLabsWin32.Exploit.Generic
No Antivirus matches
No Antivirus matches
No Antivirus matches
No Antivirus matches
NameIPActiveMaliciousAntivirus DetectionReputation
bg.microsoft.map.fastly.net
199.232.214.172
truefalse
    high
    No contacted IP infos
    Joe Sandbox version:42.0.0 Malachite
    Analysis ID:1590803
    Start date and time:2025-01-14 14:42:58 +01:00
    Joe Sandbox product:CloudBasic
    Overall analysis duration:0h 4m 37s
    Hypervisor based Inspection enabled:false
    Report type:full
    Cookbook file name:defaultwindowsofficecookbook.jbs
    Analysis system description:Windows 10 x64 22H2 with Office Professional Plus 2019, Chrome 117, Firefox 118, Adobe Reader DC 23, Java 8 Update 381, 7zip 23.01
    Number of analysed new started processes analysed:13
    Number of new started drivers analysed:0
    Number of existing processes analysed:0
    Number of existing drivers analysed:0
    Number of injected processes analysed:0
    Technologies:
    • HCA enabled
    • EGA enabled
    • GSI enabled (VBA)
    • AMSI enabled
    Analysis Mode:default
    Analysis stop reason:Timeout
    Sample name:T710XblGiM.docm
    renamed because original name is a hash value
    Original Sample Name:140cc4e8f36d4403a99ed1557d11771bcdcd169f70b014f99e658b917f9ced2d.docm
    Detection:MAL
    Classification:mal72.expl.evad.winDOCM@2/2@0/0
    Cookbook Comments:
    • Found application associated with file extension: .docm
    • Found Word or Excel or PowerPoint or XPS Viewer
    • Attach to Office via COM
    • Scroll down
    • Close Viewer
    • Exclude process from analysis (whitelisted): MpCmdRun.exe, dllhost.exe, RuntimeBroker.exe, WMIADAP.exe, SIHClient.exe, backgroundTaskHost.exe, conhost.exe, svchost.exe
    • Excluded IPs from analysis (whitelisted): 52.109.28.46, 52.113.194.132, 52.109.68.129, 199.232.214.172, 184.28.90.27, 20.189.173.8, 52.111.243.43, 52.111.243.42, 52.111.243.41, 52.111.243.40, 2.20.245.225, 2.20.245.216, 2.23.240.50, 2.22.50.144, 2.22.50.131, 40.126.31.69, 52.149.20.212, 13.107.246.45
    • Excluded domains from analysis (whitelisted): e1324.dscd.akamaiedge.net, slscr.update.microsoft.com, templatesmetadata.office.net.edgekey.net, a767.dspw65.akamai.net, eur.roaming1.live.com.akadns.net, fs-wildcard.microsoft.com.edgekey.net, fs-wildcard.microsoft.com.edgekey.net.globalredir.akadns.net, ecs-office.s-0005.s-msedge.net, roaming.officeapps.live.com, onedscolprdwus07.westus.cloudapp.azure.com, ocsp.digicert.com, login.live.com, e16604.g.akamaiedge.net, frc-azsc-000.roaming.officeapps.live.com, officeclient.microsoft.com, templatesmetadata.office.net, prod.fs.microsoft.com.akadns.net, wu-b-net.trafficmanager.net, ecs.office.com, self-events-data.trafficmanager.net, fs.microsoft.com, otelrules.azureedge.net, ctldl.windowsupdate.com.delivery.microsoft.com, prod.configsvc1.live.com.akadns.net, self.events.data.microsoft.com, osiprod-frc-buff-azsc-000.francecentral.cloudapp.azure.com, uci.cdn.office.net, ctldl.windowsupdate.com, prod.roaming1.live.com.akadns.net, s-0005-office.config.skype.com, fe3cr.del
    • Not all processes where analyzed, report is missing behavior information
    • Report size getting too big, too many NtQueryAttributesFile calls found.
    • Report size getting too big, too many NtQueryValueKey calls found.
    • Report size getting too big, too many NtReadVirtualMemory calls found.
    No simulations
    No context
    MatchAssociated Sample Name / URLSHA 256DetectionThreat NameLinkContext
    bg.microsoft.map.fastly.nethttps://biomed.acemlna.com/lt.php?x=3TZy~GE4J6XM5p79_du5VOds1H_TjdEjvPthjaTKJ3DP65RA_ky.0.Rv2Y2liNA~j-xAXHXFJFQNDb.y_ELGV.Fw3Hyoi8Get hashmaliciousUnknownBrowse
    • 199.232.210.172
    P-04071A.xlsGet hashmaliciousUnknownBrowse
    • 199.232.210.172
    P-04071A.xlsGet hashmaliciousUnknownBrowse
    • 199.232.210.172
    hJ1bl8p7dJ.exeGet hashmaliciousUnknownBrowse
    • 199.232.214.172
    nNnzvybxiy.exeGet hashmaliciousUnknownBrowse
    • 199.232.210.172
    pdf_2025 QUOTATION - #202401146778.pdf (83kb).com.exeGet hashmaliciousPureLog Stealer, QuasarBrowse
    • 199.232.214.172
    PO 2025918 pdf.exeGet hashmaliciousFormBook, PureLog StealerBrowse
    • 199.232.210.172
    1579614525244583223.jsGet hashmaliciousStrela DownloaderBrowse
    • 199.232.210.172
    New purchase order.exeGet hashmaliciousFormBook, PureLog StealerBrowse
    • 199.232.210.172
    35491083472324549.jsGet hashmaliciousStrela DownloaderBrowse
    • 199.232.214.172
    No context
    No context
    No context
    Process:C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE
    File Type:GIF image data, version 89a, 15 x 15
    Category:dropped
    Size (bytes):663
    Entropy (8bit):5.949125862393289
    Encrypted:false
    SSDEEP:12:PlrojAxh4bxdtT/CS3wkxWHMGBJg8E8gKVYQezuYEecp:trPsTTaWKbBCgVqSF
    MD5:ED3C1C40B68BA4F40DB15529D5443DEC
    SHA1:831AF99BB64A04617E0A42EA898756F9E0E0BCCA
    SHA-256:039FE79B74E6D3D561E32D4AF570E6CA70DB6BB3718395BE2BF278B9E601279A
    SHA-512:C7B765B9AFBB9810B6674DBC5C5064ED96A2682E78D5DFFAB384D81EDBC77D01E0004F230D4207F2B7D89CEE9008D79D5FBADC5CB486DA4BC43293B7AA878041
    Malicious:false
    Reputation:high, very likely benign file
    Preview:GIF89a....w..!..MSOFFICE9.0.....sRGB......!..MSOFFICE9.0.....msOPMSOFFICE9.0Dn&P3.!..MSOFFICE9.0.....cmPPJCmp0712.........!.......,....................'..;..b...RQ.xx..................,+................................yy..;..b.........................qp.bb..........uv.ZZ.LL.......xw.jj.NN.A@....zz.mm.^_.........yw........yx.xw.RR.,*.++............................................................................................................................................................................................................8....>.......................4567...=..../0123.....<9:.()*+,-.B.@...."#$%&'....... !............C.?....A;<...HT(..;
    Process:C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE
    File Type:data
    Category:dropped
    Size (bytes):162
    Entropy (8bit):4.857162623927135
    Encrypted:false
    SSDEEP:3:qkD/9mPP7IJ5cztf9aYqcPe++y5uhmXbnVqscR4v:q2ZJ5cztla5hDy55qscCv
    MD5:D23487BD0F8534C41C97D952DE948F3C
    SHA1:A4CC376F796DC16F76038150CF3A021CFD0047CB
    SHA-256:861192EBDF109C5BD0D712DEE4E165EF1A54CE82C01C62B172695A50256B6FDB
    SHA-512:CDC3F06F0281B997D366C2AAE4F231E908C9D43789BBC33DA1D0708EAED3E3FE1151E01A95BE5FEBC2F44A78B7BF5458092CB0D19720C82BBDC559BDDF14CC68
    Malicious:false
    Reputation:low
    Preview:.user...................................................t.i.n.a...XC...m...jmCU.~...9]...zj.....4g...uyj;...NG"......WLY.[.c.p.f......{....'..}..j.........=.j
    File type:Microsoft Word 2007+
    Entropy (8bit):7.854143932777862
    TrID:
    • Word Microsoft Office Open XML Format document with Macro (52004/1) 37.96%
    • Word Microsoft Office Open XML Format document (49504/1) 36.13%
    • Word Microsoft Office Open XML Format document (27504/1) 20.07%
    • ZIP compressed archive (8000/1) 5.84%
    File name:T710XblGiM.docm
    File size:112'673 bytes
    MD5:ef866288253b0d4d74a3aa7e8ee483cd
    SHA1:befbd6f0cba766ebaf10d5de734936a982ab7d8a
    SHA256:140cc4e8f36d4403a99ed1557d11771bcdcd169f70b014f99e658b917f9ced2d
    SHA512:e3c475ffa0ea7483211653e5f5673e21ec6856652b062d0875a6a80140e8fada272ccb20a8cab602ab704061776a829242423ed611e7b13118413dbefd2bd4f8
    SSDEEP:3072:6hTGaBzQcIJNw2zISljsX7h/0lP2rzPFeccqKQ:6NFBziLzzSG2rjNL
    TLSH:CDB31224A41498DDE0D2497451DA78F9E14092722B323E7E79BAD89A2C373C52B1BF4F
    File Content Preview:PK..........!...$.....".......[Content_Types].xml ...(.........................................................................................................................................................................................................
    Icon Hash:1d35646ca6a49919
    Document Type:OpenXML
    Number of OLE Files:1
    Has Summary Info:
    Application Name:
    Encrypted Document:False
    Contains Word Document Stream:True
    Contains Workbook/Book Stream:False
    Contains PowerPoint Document Stream:False
    Contains Visio Document Stream:False
    Contains ObjectPool Stream:False
    Flash Objects Count:0
    Contains VBA Macros:True
    Title:
    Subject:
    Author:ADMIN
    Keywords:
    Template:Normal.dotm
    Last Saved By:ADMIN
    Revion Number:177
    Total Edit Time:385
    Create Time:2024-10-09T19:56:00Z
    Last Saved Time:2024-12-13T08:04:00Z
    Number of Pages:2
    Number of Words:332
    Number of Characters:1897
    Creating Application:Microsoft Office Word
    Security:0
    Number of Lines:15
    Number of Paragraphs:4
    Thumbnail Scaling Desired:false
    Company:
    Contains Dirty Links:false
    Shared Document:false
    Changed Hyperlinks:false
    Application Version:16.0000
    General
    Stream Path:VBA/Module2
    VBA File Name:Module2
    Stream Size:14057
    Data ASCII:. . . . . . . . . J 6 . . . . . . . . Q 6 . . 6 . . . . . . . . . . ( 1 . . . . . . . . . . . . . . . . . . . X . 0 . . . . . f ' K . . . . . . . . . . . . . . . . R t l M o v e M e m o r y . . . R t l M o v e M e m o r y . . . V a r P t r . . h t o n l . . . V a r P t r . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . h t o n l . . . . . H . . . . . . . . . . . . . . . . . . . . . . . . . S y s t e m F u n c t i o n 0 3 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B
    Data Raw:01 16 03 00 01 10 07 00 00 4a 36 00 00 f4 06 00 00 d0 07 00 00 ff ff ff ff 51 36 00 00 bd 36 00 00 00 00 00 00 01 00 00 00 a1 28 d4 31 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 00 00 01 01 20 06 00 00 20 00 58 00 30 00 00 00 ff ff 01 00 66 c4 27 4b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 74 6c 4d 6f 76 65 4d 65 6d 6f 72 79 00 00 00 52 74 6c 4d 6f 76 65 4d 65 6d 6f 72 79
    Attribute VB_Name = "Module2"
    

    General
    Stream Path:VBA/Module3
    VBA File Name:Module3
    Stream Size:54332
    Data ASCII:. . . . . h . . . Z . . L . . . P . . . [ . . . . . . . . . . . . . ( o . . . . . . . . . . . . . D . . . . . " . . . . [ . . . . . . . . . . . . . . . . . . . R t l M o v e M e m o r y . . . . . ( . P . . . . . . . . . . . . . . . . . . . . . . . . . . . V a r P t r . . . . . . x . . . 0 . . . . . . . . . . . . . . . . . . . . . . . h t o n l . . . . . 6 . . . . X . . . . . . . . . . . . . . . . . . . . . . . S y s t e m F u n c t i o n 0 3 6 . . . . . B . . . . . . . . . . . . . . . . . . . . . . . . .
    Data Raw:01 16 03 00 06 68 05 00 00 da 5a 00 00 4c 05 00 00 50 06 00 00 ff ff ff ff 8e 5b 00 00 c6 ac 00 00 08 00 00 00 01 00 00 00 a1 28 6f b0 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 44 04 00 00 00 00 22 03 20 00 00 00 ff ff 85 89 5b 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 74 6c 4d 6f 76 65 4d 65 6d 6f 72 79 00 00 00 00 00 28 03 50 00 00 00 00 00 00 00 00
    Attribute VB_Name = "Module3"
    '--- mdAesCtr.bas
    Option Explicit
    DefObj A-Z
    
    #Const HasPtrSafe = (VBA7 <> 0) Or (TWINBASIC <> 0)
    
    '=========================================================================
    ' API
    '=========================================================================
    
    #If Win64 Then
        Private Const PTR_SIZE                  As Long = 8
    #Else
        Private Const PTR_SIZE                  As Long = 4
    #End If
    
    #If HasPtrSafe Then
    Private Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As LongPtr)
    Private Declare PtrSafe Function ArrPtr Lib "vbe7" Alias "VarPtr" (Ptr() As Any) As LongPtr
    Private Declare PtrSafe Function htonl Lib "ws2_32" (ByVal hostlong As Long) As Long
    Private Declare PtrSafe Function RtlGenRandom Lib "advapi32" Alias "SystemFunction036" (RandomBuffer As Any, ByVal RandomBufferLength As Long) As Long
    '--- bcrypt
    Private Declare PtrSafe Function BCryptOpenAlgorithmProvider Lib "bcrypt" (phAlgorithm As LongPtr, ByVal pszAlgId As LongPtr, ByVal pszImplementation As LongPtr, ByVal dwFlags As Long) As Long
    Private Declare PtrSafe Function BCryptCloseAlgorithmProvider Lib "bcrypt" (ByVal hAlgorithm As LongPtr, ByVal dwFlags As Long) As Long
    Private Declare PtrSafe Function BCryptGetProperty Lib "bcrypt" (ByVal hObject As LongPtr, ByVal pszProperty As LongPtr, pbOutput As Any, ByVal cbOutput As Long, cbResult As Long, ByVal dwFlags As Long) As Long
    Private Declare PtrSafe Function BCryptSetProperty Lib "bcrypt" (ByVal hObject As LongPtr, ByVal pszProperty As LongPtr, ByVal pbInput As LongPtr, ByVal cbInput As Long, ByVal dwFlags As Long) As Long
    Private Declare PtrSafe Function BCryptGenerateSymmetricKey Lib "bcrypt" (ByVal hAlgorithm As LongPtr, phKey As LongPtr, pbKeyObject As Any, ByVal cbKeyObject As Long, pbSecret As Any, ByVal cbSecret As Long, ByVal dwFlags As Long) As Long
    Private Declare PtrSafe Function BCryptDestroyKey Lib "bcrypt" (ByVal hKey As LongPtr) As Long
    Private Declare PtrSafe Function BCryptEncrypt Lib "bcrypt" (ByVal hKey As LongPtr, pbInput As Any, ByVal cbInput As Long, ByVal pPaddingInfo As LongPtr, ByVal pbIV As LongPtr, ByVal cbIV As Long, pbOutput As Any, ByVal cbOutput As Long, pcbResult As Long, ByVal dwFlags As Long) As Long
    Private Declare PtrSafe Function BCryptDeriveKeyPBKDF2 Lib "bcrypt" (ByVal hPrf As LongPtr, pbPassword As Any, ByVal cbPassword As Long, pbSalt As Any, ByVal cbSalt As Long, ByVal cIterations As Currency, pbDerivedKey As Any, ByVal cbDerivedKey As Long, ByVal dwFlags As Long) As Long
    Private Declare PtrSafe Function BCryptCreateHash Lib "bcrypt" (ByVal hAlgorithm As LongPtr, phHash As LongPtr, ByVal pbHashObject As LongPtr, ByVal cbHashObject As Long, pbSecret As Any, ByVal cbSecret As Long, ByVal dwFlags As Long) As Long
    Private Declare PtrSafe Function BCryptDestroyHash Lib "bcrypt" (ByVal hHash As LongPtr) As Long
    Private Declare PtrSafe Function BCryptHashData Lib "bcrypt" (ByVal hHash As LongPtr, pbInput As Any, ByVal cbInput As Long, ByVal dwFlags As Long) As Long
    Private Declare PtrSafe Function BCryptFinishHash Lib "bcrypt" (ByVal hHash As LongPtr, pbOutput As Any, ByVal cbOutput As Long, ByVal dwFlags As Long) As Long
    #Else
    Private Enum LongPtr
        [_]
    End Enum
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As LongPtr)
    Private Declare Function ArrPtr Lib "msvbvm60" Alias "VarPtr" (Ptr() As Any) As LongPtr
    Private Declare Function htonl Lib "ws2_32" (ByVal hostlong As Long) As Long
    Private Declare Function RtlGenRandom Lib "advapi32" Alias "SystemFunction036" (RandomBuffer As Any, ByVal RandomBufferLength As Long) As Long
    '--- bcrypt
    Private Declare Function BCryptOpenAlgorithmProvider Lib "bcrypt" (phAlgorithm As LongPtr, ByVal pszAlgId As LongPtr, ByVal pszImplementation As LongPtr, ByVal dwFlags As Long) As Long
    Private Declare Function BCryptCloseAlgorithmProvider Lib "bcrypt" (ByVal hAlgorithm As LongPtr, ByVal dwFlags As Long) As Long
    Private Declare Function BCryptGetProperty Lib "bcrypt" (ByVal hObject As LongPtr, ByVal pszProperty As LongPtr, pbOutput As Any, ByVal cbOutput As Long, cbResult As Long, ByVal dwFlags As Long) As Long
    Private Declare Function BCryptSetProperty Lib "bcrypt" (ByVal hObject As LongPtr, ByVal pszProperty As LongPtr, ByVal pbInput As LongPtr, ByVal cbInput As Long, ByVal dwFlags As Long) As Long
    Private Declare Function BCryptGenerateSymmetricKey Lib "bcrypt" (ByVal hAlgorithm As LongPtr, phKey As LongPtr, pbKeyObject As Any, ByVal cbKeyObject As Long, pbSecret As Any, ByVal cbSecret As Long, ByVal dwFlags As Long) As Long
    Private Declare Function BCryptDestroyKey Lib "bcrypt" (ByVal hKey As LongPtr) As Long
    Private Declare Function BCryptEncrypt Lib "bcrypt" (ByVal hKey As LongPtr, pbInput As Any, ByVal cbInput As Long, ByVal pPaddingInfo As LongPtr, ByVal pbIV As LongPtr, ByVal cbIV As Long, pbOutput As Any, ByVal cbOutput As Long, pcbResult As Long, ByVal dwFlags As Long) As Long
    Private Declare Function BCryptDeriveKeyPBKDF2 Lib "bcrypt" (ByVal hPrf As LongPtr, pbPassword As Any, ByVal cbPassword As Long, pbSalt As Any, ByVal cbSalt As Long, ByVal cIterations As Currency, pbDerivedKey As Any, ByVal cbDerivedKey As Long, ByVal dwFlags As Long) As Long
    Private Declare Function BCryptCreateHash Lib "bcrypt" (ByVal hAlgorithm As LongPtr, phHash As LongPtr, ByVal pbHashObject As LongPtr, ByVal cbHashObject As Long, pbSecret As Any, ByVal cbSecret As Long, ByVal dwFlags As Long) As Long
    Private Declare Function BCryptDestroyHash Lib "bcrypt" (ByVal hHash As LongPtr) As Long
    Private Declare Function BCryptHashData Lib "bcrypt" (ByVal hHash As LongPtr, pbInput As Any, ByVal cbInput As Long, ByVal dwFlags As Long) As Long
    Private Declare Function BCryptFinishHash Lib "bcrypt" (ByVal hHash As LongPtr, pbOutput As Any, ByVal cbOutput As Long, ByVal dwFlags As Long) As Long
    #End If
    #If Not ImplUseShared Then
        #If HasPtrSafe Then
        Private Declare PtrSafe Function CryptStringToBinary Lib "crypt32" Alias "CryptStringToBinaryW" (ByVal pszString As LongPtr, ByVal cchString As Long, ByVal dwFlags As Long, ByVal pbBinary As LongPtr, pcbBinary As Long, pdwSkip As Long, pdwFlags As Long) As Long
        Private Declare PtrSafe Function CryptBinaryToString Lib "crypt32" Alias "CryptBinaryToStringW" (ByVal pbBinary As LongPtr, ByVal cbBinary As Long, ByVal dwFlags As Long, ByVal pszString As LongPtr, pcchString As Long) As Long
        Private Declare PtrSafe Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpWideCharStr As LongPtr, ByVal cchWideChar As Long, lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpDefaultChar As LongPtr, ByVal lpUsedDefaultChar As LongPtr) As Long
        Private Declare PtrSafe Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpWideCharStr As LongPtr, ByVal cchWideChar As Long) As Long
        Private Declare PtrSafe Function FormatMessage Lib "kernel32" Alias "FormatMessageA" (ByVal dwFlags As Long, ByVal lpSource As LongPtr, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVal nSize As Long, ByVal Args As LongPtr) As Long
        #Else
        Private Declare Function CryptStringToBinary Lib "crypt32" Alias "CryptStringToBinaryW" (ByVal pszString As LongPtr, ByVal cchString As Long, ByVal dwFlags As Long, ByVal pbBinary As LongPtr, pcbBinary As Long, pdwSkip As Long, pdwFlags As Long) As Long
        Private Declare Function CryptBinaryToString Lib "crypt32" Alias "CryptBinaryToStringW" (ByVal pbBinary As LongPtr, ByVal cbBinary As Long, ByVal dwFlags As Long, ByVal pszString As LongPtr, pcchString As Long) As Long
        Private Declare Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpWideCharStr As LongPtr, ByVal cchWideChar As Long, lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpDefaultChar As LongPtr, ByVal lpUsedDefaultChar As LongPtr) As Long
        Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpWideCharStr As LongPtr, ByVal cchWideChar As Long) As Long
        Private Declare Function FormatMessage Lib "kernel32" Alias "FormatMessageA" (ByVal dwFlags As Long, ByVal lpSource As LongPtr, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVal nSize As Long, ByVal Args As LongPtr) As Long
        #End If
    #End If
    
    '=========================================================================
    ' Constants and member variables
    '=========================================================================
    
    Private Const AES_BLOCK_SIZE        As Long = 16
    Private Const AES_KEYLEN            As Long = 32                    '-- 32 -> AES-256, 24 -> AES-196, 16 -> AES-128
    Private Const AES_IVLEN             As Long = AES_BLOCK_SIZE
    Private Const KDF_SALTLEN           As Long = 8
    Private Const KDF_ITER              As Long = 10000
    Private Const KDF_HASH              As String = "SHA512"
    Private Const HMAC_HASH             As String = "SHA256"
    Private Const OPENSSL_MAGIC         As String = "Salted__"          '-- for openssl compatibility
    Private Const OPENSSL_MAGICLEN      As Long = 8
    Private Const ERR_UNSUPPORTED_ENCR  As String = "Unsupported encryption"
    Private Const ERR_CHUNKED_NOT_INIT  As String = "AES chunked context not initialized"
    
    Private Type UcsCryptoContextType
        hPbkdf2Alg          As LongPtr
        hHmacAlg            As LongPtr
        hHmacHash           As LongPtr
        HashLen             As Long
        hAesAlg             As LongPtr
        hAesKey             As LongPtr
        AesKeyObjData()     As Byte
        AesKeyObjLen        As Long
        Nonce(0 To 3)       As Long
        EncrData()          As Byte
        EncrPos             As Long
        LastError           As String
    End Type
    
    Private m_uChunkedCtx           As UcsCryptoContextType
    
    '=========================================================================
    ' Functions
    '=========================================================================
    
    '--- equivalent to `openssl aes-256-ctr -pbkdf2 -md sha512 -pass pass:{Password} -in {sText}.file -a`
    Public Function AesEncryptString(sText As String, Optional Password As Variant) As String
        Const PREFIXLEN     As Long = OPENSSL_MAGICLEN + KDF_SALTLEN
        Dim baData()        As Byte
        Dim baPass()        As Byte
        Dim baSalt()        As Byte
        Dim baKey()         As Byte
        Dim sError          As String
        
        baData = ToUtf8Array(sText)
        baPass = vbNullString
        baSalt = vbNullString
        If Not IsArray(Password) Then
            If Not IsMissing(Password) Then
                baPass = ToUtf8Array(Password & vbNullString)
            End If
            ReDim baSalt(0 To KDF_SALTLEN - 1) As Byte
            Call RtlGenRandom(baSalt(0), KDF_SALTLEN)
        Else
            baKey = Password
        End If
        If Not AesCryptArray(baData, baPass, baSalt, baKey, Error:=sError) Then
            Err.Raise vbObjectError, , sError
        End If
        If Not IsArray(Password) Then
            ReDim Preserve baData(0 To UBound(baData) + PREFIXLEN) As Byte
            If UBound(baData) >= PREFIXLEN Then
                Call CopyMemory(baData(PREFIXLEN), baData(0), UBound(baData) + 1 - PREFIXLEN)
            End If
            Call CopyMemory(baData(OPENSSL_MAGICLEN), baSalt(0), KDF_SALTLEN)
            Call CopyMemory(baData(0), ByVal OPENSSL_MAGIC, OPENSSL_MAGICLEN)
        End If
        AesEncryptString = Replace(ToBase64Array(baData), vbCrLf, vbNullString)
    End Function
    
    '--- equivalent to `openssl aes-256-ctr -pbkdf2 -md sha512 -pass pass:{Password} -in {sEncr}.file -a -d`
    Public Function AesDecryptString(sEncr As String, Optional Password As Variant) As String
        Const PREFIXLEN     As Long = OPENSSL_MAGICLEN + KDF_SALTLEN
        Dim baData()        As Byte
        Dim baPass()        As Byte
        Dim baSalt()        As Byte
        Dim baKey()         As Byte
        Dim sMagic          As String
        Dim sError          As String
        
        baData = FromBase64Array(sEncr)
        baPass = vbNullString
        baSalt = vbNullString
        If Not IsArray(Password) Then
            If Not IsMissing(Password) Then
                baPass = ToUtf8Array(Password & vbNullString)
            End If
            If UBound(baData) >= PREFIXLEN - 1 Then
                sMagic = String$(OPENSSL_MAGICLEN, 0)
                Call CopyMemory(ByVal sMagic, baData(0), OPENSSL_MAGICLEN)
                If sMagic = OPENSSL_MAGIC Then
                    ReDim baSalt(0 To KDF_SALTLEN - 1) As Byte
                    Call CopyMemory(baSalt(0), baData(OPENSSL_MAGICLEN), KDF_SALTLEN)
                    If UBound(baData) >= PREFIXLEN Then
                        Call CopyMemory(baData(0), baData(PREFIXLEN), UBound(baData) + 1 - PREFIXLEN)
                        ReDim Preserve baData(0 To UBound(baData) - PREFIXLEN) As Byte
                    Else
                        baData = vbNullString
                    End If
                End If
            End If
        Else
            baKey = Password
        End If
        If Not AesCryptArray(baData, baPass, baSalt, baKey, Error:=sError) Then
            Err.Raise vbObjectError, , sError
        End If
        AesDecryptString = FromUtf8Array(baData)
    End Function
    
    Public Function AesCryptArray(             baData() As Byte,             Optional Password As Variant,             Optional Salt As Variant,             Optional key As Variant,             Optional ByVal KeyLen As Long,             Optional Error As String,             Optional Hmac As Variant) As Boolean
        Const VT_BYREF      As Long = &H4000
        Dim uCtx            As UcsCryptoContextType
        Dim vErr            As Variant
        Dim bHashBefore     As Boolean
        Dim bHashAfter      As Boolean
        Dim baPass()        As Byte
        Dim baSalt()        As Byte
        Dim baKey()         As Byte
        Dim baTemp()        As Byte
        Dim lPtr            As LongPtr
        
        On Error GoTo EH
        If IsArray(Hmac) Then
            bHashBefore = (Hmac(0) <= 0)
            bHashAfter = (Hmac(0) > 0)
        End If
        If IsMissing(Password) Then
            baPass = vbNullString
        ElseIf IsArray(Password) Then
            baPass = Password
        Else
            baPass = ToUtf8Array(Password & vbNullString)
        End If
        If IsMissing(Salt) Then
            baSalt = baPass
        ElseIf IsArray(Salt) Then
            baSalt = Salt
        Else
            baSalt = ToUtf8Array(Salt & vbNullString)
        End If
        If IsArray(key) Then
            baKey = key
        End If
        If KeyLen <= 0 Then
            KeyLen = AES_KEYLEN
        End If
        If Not pvCryptoAesCtrInit(uCtx, baPass, baSalt, baKey, KeyLen) Then
            Error = uCtx.LastError
            GoTo QH
        End If
        If Not pvCryptoAesCtrCrypt(uCtx, baData, HashBefore:=bHashBefore, HashAfter:=bHashAfter) Then
            Error = uCtx.LastError
            GoTo QH
        End If
        If IsArray(Hmac) Then
            baTemp = pvCryptoGetFinalHash(uCtx, UBound(Hmac) + 1)
            #If Win64 Then
                lPtr = PeekPtr(VarPtr(Hmac) + 8)
            #Else
                lPtr = PeekPtr((VarPtr(Hmac) Xor &H80000000) + 8 Xor &H80000000)
            #End If
            If (PeekPtr(VarPtr(Hmac)) And VT_BYREF) <> 0 Then
                lPtr = PeekPtr(lPtr)
            End If
            #If Win64 Then
                lPtr = PeekPtr(lPtr + 16)
            #Else
                lPtr = PeekPtr((lPtr Xor &H80000000) + 12 Xor &H80000000)
            #End If
            Call CopyMemory(ByVal lPtr, baTemp(0), UBound(baTemp) + 1)
        End If
        '--- success
        AesCryptArray = True
    QH:
        pvCryptoAesCtrTerminate uCtx
        Exit Function
    EH:
        vErr = Array(Err.Number, Err.Source, Err.Description)
        pvCryptoAesCtrTerminate uCtx
        Err.Raise vErr(0), vErr(1), vErr(2)
    End Function
    
    Public Function AesChunkedInit(Optional key As Variant, Optional ByVal KeyLen As Long) As Boolean
        Dim baEmpty()       As Byte
        Dim baKey()         As Byte
        
        pvCryptoAesCtrTerminate m_uChunkedCtx
        baEmpty = vbNullString
        If IsArray(key) Then
            baKey = key
        End If
        If KeyLen <= 0 Then
            KeyLen = AES_KEYLEN
        End If
        AesChunkedInit = pvCryptoAesCtrInit(m_uChunkedCtx, baEmpty, baEmpty, baKey, KeyLen)
    End Function
    
    Public Function AesChunkedCryptArray(baInput() As Byte, baOutput() As Byte, Optional ByVal Final As Boolean = True) As Boolean
        If m_uChunkedCtx.hAesAlg = 0 Then
            m_uChunkedCtx.LastError = ERR_CHUNKED_NOT_INIT
            Exit Function
        End If
        baOutput = baInput
        AesChunkedCryptArray = pvCryptoAesCtrCrypt(m_uChunkedCtx, baOutput)
        If Final Then
            pvCryptoAesCtrTerminate m_uChunkedCtx
        End If
    End Function
    
    Public Function AesChunkedGetLastError() As String
        AesChunkedGetLastError = m_uChunkedCtx.LastError
    End Function
    
    '= private ===============================================================
    
    Private Function pvCryptoAesCtrInit(uCtx As UcsCryptoContextType, baPass() As Byte, baSalt() As Byte, baDerivedKey() As Byte, ByVal lKeyLen As Long) As Boolean
        Const MS_PRIMITIVE_PROVIDER         As String = "Microsoft Primitive Provider"
        Const BCRYPT_ALG_HANDLE_HMAC_FLAG   As Long = 8
        Dim hResult         As Long
        
        With uCtx
            '--- init member vars
            .EncrData = vbNullString
            .EncrPos = 0
            .LastError = vbNullString
            ReDim Preserve baDerivedKey(0 To lKeyLen + AES_IVLEN - 1) As Byte
            If UBound(baPass) >= 0 Or UBound(baSalt) >= 0 Then
                '--- generate RFC 2898 based derived key
                On Error GoTo EH_Unsupported '--- PBKDF2 API missing on Vista
                hResult = BCryptOpenAlgorithmProvider(.hPbkdf2Alg, StrPtr(KDF_HASH), StrPtr(MS_PRIMITIVE_PROVIDER), BCRYPT_ALG_HANDLE_HMAC_FLAG)
                If hResult < 0 Then
                    GoTo QH
                End If
                hResult = BCryptDeriveKeyPBKDF2(.hPbkdf2Alg, ByVal pvArrayPtr(baPass), pvArraySize(baPass), ByVal pvArrayPtr(baSalt), pvArraySize(baSalt),                     KDF_ITER / 10000@, baDerivedKey(0), UBound(baDerivedKey) + 1, 0)
                If hResult < 0 Then
                    GoTo QH
                End If
                On Error GoTo 0
            End If
            '--- init AES key from first half of derived key
            On Error GoTo EH_Unsupported '--- CNG API missing on XP
            hResult = BCryptOpenAlgorithmProvider(.hAesAlg, StrPtr("AES"), StrPtr(MS_PRIMITIVE_PROVIDER), 0)
            If hResult < 0 Then
                GoTo QH
            End If
            On Error GoTo 0
            hResult = BCryptGetProperty(.hAesAlg, StrPtr("ObjectLength"), .AesKeyObjLen, 4, 0, 0)
            If hResult < 0 Then
                GoTo QH
            End If
            hResult = BCryptSetProperty(.hAesAlg, StrPtr("ChainingMode"), StrPtr("ChainingModeECB"), 30, 0)  ' 30 = LenB("ChainingModeECB")
            If hResult < 0 Then
                GoTo QH
            End If
            ReDim .AesKeyObjData(0 To .AesKeyObjLen - 1) As Byte
            hResult = BCryptGenerateSymmetricKey(.hAesAlg, .hAesKey, .AesKeyObjData(0), .AesKeyObjLen, baDerivedKey(0), lKeyLen, 0)
            If hResult < 0 Then
                GoTo QH
            End If
            '--- init AES IV from second half of derived key
            Call CopyMemory(.Nonce(0), baDerivedKey(lKeyLen), AES_IVLEN)
            '--- init HMAC key from last HashLen bytes of derived key
            hResult = BCryptOpenAlgorithmProvider(.hHmacAlg, StrPtr(HMAC_HASH), StrPtr(MS_PRIMITIVE_PROVIDER), BCRYPT_ALG_HANDLE_HMAC_FLAG)
            If hResult < 0 Then
                GoTo QH
            End If
            hResult = BCryptGetProperty(.hHmacAlg, StrPtr("HashDigestLength"), .HashLen, 4, 0, 0)
            If hResult < 0 Then
                GoTo QH
            End If
            hResult = BCryptCreateHash(.hHmacAlg, .hHmacHash, 0, 0, baDerivedKey(lKeyLen + AES_IVLEN - .HashLen), .HashLen, 0)
            If hResult < 0 Then
                GoTo QH
            End If
        End With
        '--- success
        pvCryptoAesCtrInit = True
        Exit Function
    QH:
        uCtx.LastError = GetSystemMessage(hResult)
        Exit Function
    EH_Unsupported:
        uCtx.LastError = ERR_UNSUPPORTED_ENCR
    End Function
    
    Private Sub pvCryptoAesCtrTerminate(uCtx As UcsCryptoContextType)
        With uCtx
            If .hPbkdf2Alg <> 0 Then
                Call BCryptCloseAlgorithmProvider(.

    General
    Stream Path:VBA/ThisDocument
    VBA File Name:ThisDocument.cls
    Stream Size:2229
    Data ASCII:. . . . . 8 . . . . . . . . . . J . . . C . . . Q . . . . . . . . . . . . . . ( 6 . . . . . . . . . . . . . 8 . . . . , . . . . . . . . . . . . . . . . . . . . . . . . . O p e n N o t e p a d . O p e n N o t e p a d . . . . . p . . . . @ a . K ; . F H B . I b I f ! . . . . . . . . . . . . . . . . . . . . . . r c G } @ . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . r c G } @ . . @ a . K ; . . . . . M E . . . . . . . . . . . . . . . . . . . . . 8 . P . . . . . S " . . . . S . . . . . S " . . .
    Data Raw:01 16 03 00 06 38 01 00 00 dc 05 00 00 1c 01 00 00 4a 02 00 00 43 06 00 00 51 06 00 00 81 07 00 00 00 00 00 00 01 00 00 00 a1 28 9f 36 00 00 ff ff a3 01 00 00 88 00 00 00 b6 00 00 00 01 01 38 00 00 00 20 00 ff ff 2c 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4f 70 65 6e 4e 6f 74 65 70 61 64 00 4f 70 65 6e 4e 6f 74 65 70 61 64 00 ff ff ff ff 00
    Attribute VB_Name = "ThisDocument"
    Attribute VB_Base = "1Normal.ThisDocument"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = True
    Attribute VB_TemplateDerived = True
    Attribute VB_Customizable = True
    Private Sub Document_Open()
        ' Kh?i ch?y macro ? ch? d? khng ch?n giao di?n
        Application.OnTime Now + TimeValue("00:00:01"), "TestAES"
    End Sub
    
    

    General
    Stream Path:PROJECT
    CLSID:
    File Type:ASCII text, with CRLF line terminators
    Stream Size:584
    Entropy:5.242887943578382
    Base64 Encoded:True
    Data ASCII:I D = " { 0 0 0 0 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 } " . . D o c u m e n t = T h i s D o c u m e n t / & H 0 0 0 0 0 0 0 0 . . M o d u l e = M o d u l e 1 . . M o d u l e = M o d u l e 2 . . M o d u l e = M o d u l e 3 . . H e l p F i l e = " " . . N a m e = " P r o j e c t " . . H e l p C o n t e x t I D = " 0 " . . V e r s i o n C o m p a t i b l e 3 2 = " 3 9 3 2 2 2 0 0 0 " . . C M G = " A 5 A 7 0 9 F 6 0 B 9 F 0 F 9 F 0 F 9 A 1 4 9 A 1 4 " . . D P B = " 4 A 4 8 E 6 5 1 9
    Data Raw:49 44 3d 22 7b 30 30 30 30 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 30 30 30 30 30 30 30 30 7d 22 0d 0a 44 6f 63 75 6d 65 6e 74 3d 54 68 69 73 44 6f 63 75 6d 65 6e 74 2f 26 48 30 30 30 30 30 30 30 30 0d 0a 4d 6f 64 75 6c 65 3d 4d 6f 64 75 6c 65 31 0d 0a 4d 6f 64 75 6c 65 3d 4d 6f 64 75 6c 65 32 0d 0a 4d 6f 64 75 6c 65 3d 4d 6f 64 75 6c 65 33 0d 0a 48
    General
    Stream Path:PROJECTwm
    CLSID:
    File Type:data
    Stream Size:113
    Entropy:3.248541785053862
    Base64 Encoded:False
    Data ASCII:T h i s D o c u m e n t . T . h . i . s . D . o . c . u . m . e . n . t . . . M o d u l e 1 . M . o . d . u . l . e . 1 . . . M o d u l e 2 . M . o . d . u . l . e . 2 . . . M o d u l e 3 . M . o . d . u . l . e . 3 . . . . .
    Data Raw:54 68 69 73 44 6f 63 75 6d 65 6e 74 00 54 00 68 00 69 00 73 00 44 00 6f 00 63 00 75 00 6d 00 65 00 6e 00 74 00 00 00 4d 6f 64 75 6c 65 31 00 4d 00 6f 00 64 00 75 00 6c 00 65 00 31 00 00 00 4d 6f 64 75 6c 65 32 00 4d 00 6f 00 64 00 75 00 6c 00 65 00 32 00 00 00 4d 6f 64 75 6c 65 33 00 4d 00 6f 00 64 00 75 00 6c 00 65 00 33 00 00 00 00 00
    General
    Stream Path:VBA/Module1
    CLSID:
    File Type:data
    Stream Size:20187
    Entropy:5.361708361668068
    Base64 Encoded:True
    Data ASCII:. . . . . x . . . B # . . \\ . . . . . . # . . F < . . . . . . . . . . ( ~ . . . . . . . . . . . . . . . . . . . . D . | . . . . . . . . . . . . . . . . . . . . . . . . O p e n N o t e p a d . O p e n N o t e p a d . O p e n N o t e p a d . . . . . . . O p e n N o t e p a d . O p e n N o t e p a d . O p e n N o t e p a d . O p e n N o t e p a d . O p e n N o t e p a d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Data Raw:01 16 03 00 06 78 01 00 00 42 23 00 00 5c 01 00 00 b0 02 00 00 ff ff ff ff ce 23 00 00 46 3c 00 00 00 00 00 00 01 00 00 00 a1 28 7e 03 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 00 00 01 01 88 00 00 00 20 00 44 00 7c 00 00 00 ff ff 00 00 bc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4f 70 65 6e 4e 6f 74 65 70 61 64 00 4f 70 65 6e 4e 6f 74 65 70 61 64 00 4f 70 65 6e 4e
    General
    Stream Path:VBA/_VBA_PROJECT
    CLSID:
    File Type:data
    Stream Size:18540
    Entropy:5.5635270600844215
    Base64 Encoded:True
    Data ASCII:a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * . \\ . G . { . 0 . 0 . 0 . 2 . 0 . 4 . E . F . - . 0 . 0 . 0 . 0 . - . 0 . 0 . 0 . 0 . - . C . 0 . 0 . 0 . - . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 4 . 6 . } . # . 4 . . . 2 . # . 9 . # . C . : . \\ . P . R . O . G . R . A . ~ . 1 . \\ . C . O . M . M . O . N . ~ . 1 . \\ . M . I . C . R . O . S . ~ . 1 . \\ . V . B . A . \\ . V . B . A . 7 . . . 1 . \\ . V . B . E . 7 . . . D . L . L . # . V . i . s . u . a . l . . B . a . s . i . c . . F . o
    Data Raw:cc 61 b2 00 00 03 00 ff 09 04 00 00 09 04 00 00 e4 04 03 00 00 00 00 00 00 00 00 00 01 00 06 00 02 00 fe 00 2a 00 5c 00 47 00 7b 00 30 00 30 00 30 00 32 00 30 00 34 00 45 00 46 00 2d 00 30 00 30 00 30 00 30 00 2d 00 30 00 30 00 30 00 30 00 2d 00 43 00 30 00 30 00 30 00 2d 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 34 00 36 00 7d 00 23 00 34 00 2e 00 32 00 23 00
    General
    Stream Path:VBA/__SRP_0
    CLSID:
    File Type:data
    Stream Size:91613
    Entropy:3.972823862523933
    Base64 Encoded:True
    Data ASCII:K * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * \\ C N o r m a l r U @ 9 . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . .
    Data Raw:93 4b 2a b2 03 00 10 00 00 00 ff ff 00 00 00 00 01 00 02 00 ff ff 00 00 00 00 01 00 02 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 01 00 02 00 03 00 00 00 00 00 01 00 00 00 03 00 00 00 00 00 01 00 02 00 01 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 01 00 05 00 05 00 05 00 05 00 05 00 05 00 05 00 05 00 01 00 09 00 00 00 2a 5c 43 4e 6f 72 6d 61 6c 72 55 40 39 00 00 00 00 00
    General
    Stream Path:VBA/__SRP_1
    CLSID:
    File Type:data
    Stream Size:2380
    Entropy:3.3345354026327136
    Base64 Encoded:True
    Data ASCII:r U . . . . . . . . @ . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . l p v D e s t . . . . . . . . . . . . . . . . l p v S o u r c e . . . . . . . . . . . . . . . . c b C o p y . . . . . . . . . . . . . . . . P t r . . . . .
    Data Raw:72 55 00 01 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 02 00 00 00 00 00 00 7e 7a 00 00 00 00 00 00 7f 00 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 11 00 00 00 00 00 00 00 00 00 02 00 11 00 00 00 00 00 00 00 00 00 06 00 ff ff
    General
    Stream Path:VBA/__SRP_2
    CLSID:
    File Type:data
    Stream Size:156
    Entropy:1.7948868758912513
    Base64 Encoded:False
    Data ASCII:r U @ . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . 8 . . . . . . . . . . . . . . . ` . . . 8 . . . . . . . . . . . . . . . . . b . . . . . . . . . . . . . . .
    Data Raw:72 55 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 03 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 78 00 00 00 08 00 38 00 e1 01 00 00 00 00 00 00 00 00 03 00 00 00 04 60 00 00 e0 0d 38 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
    General
    Stream Path:VBA/__SRP_3
    CLSID:
    File Type:data
    Stream Size:766
    Entropy:2.6492518905222884
    Base64 Encoded:False
    Data ASCII:r U . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q . . . . . . . . . . Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ` . . . a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Data Raw:72 55 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 02 00 80 07 00 00 00 00 00 00 00 00 00 00 01 00 01 00 06 00 00 00 51 c3 00 00 00 00 00 00 00 00 00 00 51 c5 00 00 00 00 00 00 00 00 00 00 c1 8a 03 00 00 00 00 00 00 00
    General
    Stream Path:VBA/__SRP_4
    CLSID:
    File Type:data
    Stream Size:4178
    Entropy:2.5887236074762523
    Base64 Encoded:False
    Data ASCII:r U @ . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p . . . . . X . . 0 . . . . . . . . . . . . . p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A . . . . . . . . . . . . . . . . . B . B . . . H . 2 . . . . . . . . . . 0 . . p . . . . . . a . . . . . . . . . . . . . . . . . . . . @ . . 6 . . . . . . . . . . X . . p . . . . . . . . . . . . . . . . . . . . . . . . . P . . 8 . . . . . . . . . . . . p . . . . . . . . .
    Data Raw:72 55 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 05 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 70 00 00 00 08 00 58 00 11 30 00 00 00 00 00 00 00 00 00 00 00 00 00 70 0c 00 fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
    General
    Stream Path:VBA/__SRP_5
    CLSID:
    File Type:data
    Stream Size:12259
    Entropy:3.9491689280334947
    Base64 Encoded:False
    Data ASCII:r U . . . . . . . @ . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . 2 . . . . . . . . . . . . . . Q y . . . . . . . . . . z . . . . . . . . . . ! . . . . . . . . . . . . } . . . . . . . . . . . . . . . . . . . . . . ~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q b . . . . . . . . .
    Data Raw:72 55 80 02 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 04 00 00 00 00 00 00 7e 78 00 00 00 00 00 00 7f 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 04 00 10 00 00 00 00 00 00 00 00 00 05 00 28 00 13 00 32 00 00 00 a1 1a 00 00 00 00 00 00 00 00 05 00 51 79 00 00 00 00
    General
    Stream Path:VBA/__SRP_6
    CLSID:
    File Type:data
    Stream Size:156
    Entropy:1.5811533511839717
    Base64 Encoded:False
    Data ASCII:r U @ . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . ` . . . . . . . . . . . . . . . . . . b . . . . . . . . . . . . . . .
    Data Raw:72 55 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 07 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 10 00 00 00 08 00 38 00 f1 00 00 00 00 00 00 00 00 00 07 00 00 00 00 60 00 00 fd ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
    General
    Stream Path:VBA/__SRP_7
    CLSID:
    File Type:data
    Stream Size:2457
    Entropy:4.0061943465155725
    Base64 Encoded:False
    Data ASCII:r U @ . . . . . . . @ . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $ . . . . . . . . . . . . . . b . . . . . . . . . . S . . . . . . . . . . . G . . . . . . . . . . Q . . . . . . . . . . . 4 . . . . . . . . . . . 8 . . . . . . . . . . . < . . . . . . . . . . . @ . . . . . . . . . . . D . . . . . . . . . . . H . . . . . . . . . . . L . . . . . . . . . . . P . . . .
    Data Raw:72 55 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 04 00 00 00 00 00 00 7e 78 00 00 00 00 00 00 7f 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 06 00 10 00 00 00 00 00 00 00 00 00 07 00 01 00 01 00 24 00 00 00 81 02 00 00 00 00 00 00 00 00 05 00 f1 62 00 00 00 00
    General
    Stream Path:VBA/dir
    CLSID:
    File Type:data
    Stream Size:713
    Entropy:6.450578844433182
    Base64 Encoded:True
    Data ASCII:. . . . . . . . . . 0 * . . . . p . . H . . . . d . . . . . . . P r o j e c t . Q . ( . . @ . . . . . = . . . . l . . . . . . . . N o i . . . . J . < . . . . . r s t d . o l e > . . s . t . . d . o . l . e P . . . h . % ^ . . * . \\ G { 0 0 0 2 0 4 3 0 - . . . . C . . . . . . . 0 0 4 6 } # . 2 . 0 # 0 # C : . \\ W i n d o w s . \\ S y s t e m 3 . 2 \\ . e 2 . t l b . # O L E A u t o m a t i o n . ` . . . E N o r m a l . E N C r . m . a Q F . . . . . * . \\ C . . . . o i . . . ! O f f i c . g O . f . i . c .
    Data Raw:01 c5 b2 80 01 00 04 00 00 00 03 00 30 2a 02 02 90 09 00 70 14 06 48 03 00 82 02 00 64 e4 04 04 00 07 00 1c 00 50 72 6f 6a 65 63 74 05 51 00 28 00 00 40 02 14 06 02 14 3d ad 02 0a 07 02 6c 01 14 08 06 12 09 02 12 80 4e 99 6f 69 0c 00 0c 02 4a 12 3c 02 0a 16 00 01 72 73 74 64 10 6f 6c 65 3e 02 19 73 00 74 00 00 64 00 6f 00 6c 00 65 50 00 0d 00 68 00 25 5e 00 03 2a 00 5c 47 7b 30 30
    TimestampSource IPDest IPTrans IDReply CodeNameCNameAddressTypeClassDNS over HTTPS
    Jan 14, 2025 14:44:19.142105103 CET1.1.1.1192.168.2.90xdbadNo error (0)bg.microsoft.map.fastly.net199.232.214.172A (IP address)IN (0x0001)false
    Jan 14, 2025 14:44:19.142105103 CET1.1.1.1192.168.2.90xdbadNo error (0)bg.microsoft.map.fastly.net199.232.210.172A (IP address)IN (0x0001)false

    Click to jump to process

    Click to jump to process

    Click to dive into process behavior distribution

    Target ID:0
    Start time:08:44:09
    Start date:14/01/2025
    Path:C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE
    Wow64 process (32bit):true
    Commandline:"C:\Program Files (x86)\Microsoft Office\Root\Office16\WINWORD.EXE" /Automation -Embedding
    Imagebase:0x790000
    File size:1'620'872 bytes
    MD5 hash:1A0C2C2E7D9C4BC18E91604E9B0C7678
    Has elevated privileges:true
    Has administrator privileges:true
    Programmed in:C, C++ or other language
    Reputation:high
    Has exited:true

    Call Graph

    Module: __Unknown_Module_Name__

    Declaration
    LineContent

    Module: Module2

    Declaration
    LineContent
    1

    Attribute VB_Name = "Module2"

    Module: Module3

    Declaration
    LineContent
    1

    Attribute VB_Name = "Module3"

    3

    Option Explicit

    4

    DefObj A-Z

    12

    #if Win64 then

    13

    Private Const PTR_SIZE as Long = 8

    14

    #else

    15

    Private Const PTR_SIZE as Long = 4

    16

    #endif

    18

    #if HasPtrSafe then

    19

    Private Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"(lpvDest as Any, lpvSource as Any, ByVal cbCopy as LongPtr)

    20

    Private Declare PtrSafe Function ArrPtr Lib "vbe7" Alias "VarPtr"(Ptr() as Any) as LongPtr

    21

    Private Declare PtrSafe Function htonl Lib "ws2_32" (ByVal hostlong as Long) as Long

    22

    Private Declare PtrSafe Function RtlGenRandom Lib "advapi32" Alias "SystemFunction036"(RandomBuffer as Any, ByVal RandomBufferLength as Long) as Long

    24

    Private Declare PtrSafe Function BCryptOpenAlgorithmProvider Lib "bcrypt" (phAlgorithm as LongPtr, ByVal pszAlgId as LongPtr, ByVal pszImplementation as LongPtr, ByVal dwFlags as Long) as Long

    25

    Private Declare PtrSafe Function BCryptCloseAlgorithmProvider Lib "bcrypt" (ByVal hAlgorithm as LongPtr, ByVal dwFlags as Long) as Long

    26

    Private Declare PtrSafe Function BCryptGetProperty Lib "bcrypt" (ByVal hObject as LongPtr, ByVal pszProperty as LongPtr, pbOutput as Any, ByVal cbOutput as Long, cbResult as Long, ByVal dwFlags as Long) as Long

    27

    Private Declare PtrSafe Function BCryptSetProperty Lib "bcrypt" (ByVal hObject as LongPtr, ByVal pszProperty as LongPtr, ByVal pbInput as LongPtr, ByVal cbInput as Long, ByVal dwFlags as Long) as Long

    28

    Private Declare PtrSafe Function BCryptGenerateSymmetricKey Lib "bcrypt" (ByVal hAlgorithm as LongPtr, phKey as LongPtr, pbKeyObject as Any, ByVal cbKeyObject as Long, pbSecret as Any, ByVal cbSecret as Long, ByVal dwFlags as Long) as Long

    29

    Private Declare PtrSafe Function BCryptDestroyKey Lib "bcrypt" (ByVal hKey as LongPtr) as Long

    30

    Private Declare PtrSafe Function BCryptEncrypt Lib "bcrypt" (ByVal hKey as LongPtr, pbInput as Any, ByVal cbInput as Long, ByVal pPaddingInfo as LongPtr, ByVal pbIV as LongPtr, ByVal cbIV as Long, pbOutput as Any, ByVal cbOutput as Long, pcbResult as Long, ByVal dwFlags as Long) as Long

    31

    Private Declare PtrSafe Function BCryptDeriveKeyPBKDF2 Lib "bcrypt" (ByVal hPrf as LongPtr, pbPassword as Any, ByVal cbPassword as Long, pbSalt as Any, ByVal cbSalt as Long, ByVal cIterations as Currency, pbDerivedKey as Any, ByVal cbDerivedKey as Long, ByVal dwFlags as Long) as Long

    32

    Private Declare PtrSafe Function BCryptCreateHash Lib "bcrypt" (ByVal hAlgorithm as LongPtr, phHash as LongPtr, ByVal pbHashObject as LongPtr, ByVal cbHashObject as Long, pbSecret as Any, ByVal cbSecret as Long, ByVal dwFlags as Long) as Long

    33

    Private Declare PtrSafe Function BCryptDestroyHash Lib "bcrypt" (ByVal hHash as LongPtr) as Long

    34

    Private Declare PtrSafe Function BCryptHashData Lib "bcrypt" (ByVal hHash as LongPtr, pbInput as Any, ByVal cbInput as Long, ByVal dwFlags as Long) as Long

    35

    Private Declare PtrSafe Function BCryptFinishHash Lib "bcrypt" (ByVal hHash as LongPtr, pbOutput as Any, ByVal cbOutput as Long, ByVal dwFlags as Long) as Long

    36

    #else

    APIsMeta Information

    vbNullString

    vbNullString

    AES_IVLEN

    UBound

    BCryptOpenAlgorithmProvider

    StrPtr

    KDF_HASH

    MS_PRIMITIVE_PROVIDER

    BCRYPT_ALG_HANDLE_HMAC_FLAG

    BCryptDeriveKeyPBKDF2

    pvArrayPtr

    pvArraySize

    KDF_ITER

    UBound

    BCryptOpenAlgorithmProvider

    StrPtr

    MS_PRIMITIVE_PROVIDER

    BCryptGetProperty

    StrPtr

    BCryptSetProperty

    StrPtr

    BCryptGenerateSymmetricKey

    CopyMemory

    AES_IVLEN

    BCryptOpenAlgorithmProvider

    StrPtr

    HMAC_HASH

    MS_PRIMITIVE_PROVIDER

    BCRYPT_ALG_HANDLE_HMAC_FLAG

    BCryptGetProperty

    StrPtr

    BCryptCreateHash

    AES_IVLEN

    LastError

    Part of subcall function GetSystemMessage@Module3: Space$

    Part of subcall function GetSystemMessage@Module3: FormatMessage

    Part of subcall function GetSystemMessage@Module3: FORMAT_MESSAGE_FROM_SYSTEM

    Part of subcall function GetSystemMessage@Module3: FORMAT_MESSAGE_IGNORE_INSERTS

    Part of subcall function GetSystemMessage@Module3: Len

    Part of subcall function GetSystemMessage@Module3: Mid$

    Part of subcall function GetSystemMessage@Module3: vbCrLf

    Part of subcall function GetSystemMessage@Module3: Left$

    Part of subcall function GetSystemMessage@Module3: Hex

    LastError

    ERR_UNSUPPORTED_ENCR

    StringsDecrypted Strings
    "Microsoft Primitive Provider"
    "AES"
    "ObjectLength"
    "ChainingMode"
    "ChainingModeECB"
    "HashDigestLength"
    LineInstructionMeta Information
    299

    Private Function pvCryptoAesCtrInit(uCtx as UcsCryptoContextType, baPass() as Byte, baSalt() as Byte, baDerivedKey() as Byte, ByVal lKeyLen as Long) as Boolean

    300

    Const MS_PRIMITIVE_PROVIDER as String = "Microsoft Primitive Provider"

    301

    Const BCRYPT_ALG_HANDLE_HMAC_FLAG as Long = 8

    302

    Dim hResult as Long

    304

    With uCtx

    306

    . EncrData = vbNullString

    vbNullString

    307

    . EncrPos = 0

    308

    . LastError = vbNullString

    vbNullString

    309

    Redim Preserve baDerivedKey(0 To lKeyLen + AES_IVLEN - 1)

    AES_IVLEN

    310

    If UBound(baPass) >= 0 Or UBound(baSalt) >= 0 Then

    UBound

    312

    On Error Goto EH_Unsupported

    313

    hResult = BCryptOpenAlgorithmProvider(. hPbkdf2Alg, StrPtr(KDF_HASH), StrPtr(MS_PRIMITIVE_PROVIDER), BCRYPT_ALG_HANDLE_HMAC_FLAG)

    BCryptOpenAlgorithmProvider

    StrPtr

    KDF_HASH

    MS_PRIMITIVE_PROVIDER

    BCRYPT_ALG_HANDLE_HMAC_FLAG

    314

    If hResult < 0 Then

    315

    Goto QH

    316

    Endif

    317

    hResult = BCryptDeriveKeyPBKDF2(. hPbkdf2Alg, ByVal pvArrayPtr(baPass), pvArraySize(baPass), ByVal pvArrayPtr(baSalt), pvArraySize(baSalt), KDF_ITER / 10000@, baDerivedKey(0), UBound(baDerivedKey) + 1, 0)

    BCryptDeriveKeyPBKDF2

    pvArrayPtr

    pvArraySize

    KDF_ITER

    UBound

    319

    If hResult < 0 Then

    320

    Goto QH

    321

    Endif

    322

    On Error Goto 0

    323

    Endif

    325

    On Error Goto EH_Unsupported

    326

    hResult = BCryptOpenAlgorithmProvider(. hAesAlg, StrPtr("AES"), StrPtr(MS_PRIMITIVE_PROVIDER), 0)

    BCryptOpenAlgorithmProvider

    StrPtr

    MS_PRIMITIVE_PROVIDER

    327

    If hResult < 0 Then

    328

    Goto QH

    329

    Endif

    330

    On Error Goto 0

    331

    hResult = BCryptGetProperty(. hAesAlg, StrPtr("ObjectLength"), . AesKeyObjLen, 4, 0, 0)

    BCryptGetProperty

    StrPtr

    332

    If hResult < 0 Then

    333

    Goto QH

    334

    Endif

    335

    hResult = BCryptSetProperty(. hAesAlg, StrPtr("ChainingMode"), StrPtr("ChainingModeECB"), 30, 0)

    BCryptSetProperty

    StrPtr

    336

    If hResult < 0 Then

    337

    Goto QH

    338

    Endif

    339

    ReDim .AesKeyObjData(0 To .AesKeyObjLen - 1) As Byte ' BAD !

    340

    hResult = BCryptGenerateSymmetricKey(. hAesAlg, . hAesKey, . AesKeyObjData(0), . AesKeyObjLen, baDerivedKey(0), lKeyLen, 0)

    BCryptGenerateSymmetricKey

    341

    If hResult < 0 Then

    342

    Goto QH

    343

    Endif

    345

    Call CopyMemory(. Nonce(0), baDerivedKey(lKeyLen), AES_IVLEN)

    CopyMemory

    AES_IVLEN

    347

    hResult = BCryptOpenAlgorithmProvider(. hHmacAlg, StrPtr(HMAC_HASH), StrPtr(MS_PRIMITIVE_PROVIDER), BCRYPT_ALG_HANDLE_HMAC_FLAG)

    BCryptOpenAlgorithmProvider

    StrPtr

    HMAC_HASH

    MS_PRIMITIVE_PROVIDER

    BCRYPT_ALG_HANDLE_HMAC_FLAG

    348

    If hResult < 0 Then

    349

    Goto QH

    350

    Endif

    351

    hResult = BCryptGetProperty(. hHmacAlg, StrPtr("HashDigestLength"), . HashLen, 4, 0, 0)

    BCryptGetProperty

    StrPtr

    352

    If hResult < 0 Then

    353

    Goto QH

    354

    Endif

    355

    hResult = BCryptCreateHash(. hHmacAlg, . hHmacHash, 0, 0, baDerivedKey(lKeyLen + AES_IVLEN - . HashLen), . HashLen, 0)

    BCryptCreateHash

    AES_IVLEN

    356

    If hResult < 0 Then

    357

    Goto QH

    358

    Endif

    359

    End With

    361

    pvCryptoAesCtrInit = True

    362

    Exit Function

    362

    QH:

    364

    uCtx.LastError = GetSystemMessage(hResult)

    LastError

    365

    Exit Function

    365

    EH_Unsupported:

    367

    uCtx.LastError = ERR_UNSUPPORTED_ENCR

    LastError

    ERR_UNSUPPORTED_ENCR

    368

    End Function

    APIsMeta Information

    IsArray

    IsMissing

    vbNullString

    IsArray

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: vbNullString

    vbNullString

    IsMissing

    IsArray

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: vbNullString

    vbNullString

    IsArray

    AES_KEYLEN

    Part of subcall function pvCryptoAesCtrInit@Module3: vbNullString

    Part of subcall function pvCryptoAesCtrInit@Module3: vbNullString

    Part of subcall function pvCryptoAesCtrInit@Module3: AES_IVLEN

    Part of subcall function pvCryptoAesCtrInit@Module3: UBound

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptOpenAlgorithmProvider

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: KDF_HASH

    Part of subcall function pvCryptoAesCtrInit@Module3: MS_PRIMITIVE_PROVIDER

    Part of subcall function pvCryptoAesCtrInit@Module3: BCRYPT_ALG_HANDLE_HMAC_FLAG

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptDeriveKeyPBKDF2

    Part of subcall function pvCryptoAesCtrInit@Module3: pvArrayPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: pvArraySize

    Part of subcall function pvCryptoAesCtrInit@Module3: KDF_ITER

    Part of subcall function pvCryptoAesCtrInit@Module3: UBound

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptOpenAlgorithmProvider

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: MS_PRIMITIVE_PROVIDER

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptGetProperty

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptSetProperty

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptGenerateSymmetricKey

    Part of subcall function pvCryptoAesCtrInit@Module3: CopyMemory

    Part of subcall function pvCryptoAesCtrInit@Module3: AES_IVLEN

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptOpenAlgorithmProvider

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: HMAC_HASH

    Part of subcall function pvCryptoAesCtrInit@Module3: MS_PRIMITIVE_PROVIDER

    Part of subcall function pvCryptoAesCtrInit@Module3: BCRYPT_ALG_HANDLE_HMAC_FLAG

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptGetProperty

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptCreateHash

    Part of subcall function pvCryptoAesCtrInit@Module3: AES_IVLEN

    Part of subcall function pvCryptoAesCtrInit@Module3: LastError

    Part of subcall function pvCryptoAesCtrInit@Module3: LastError

    Part of subcall function pvCryptoAesCtrInit@Module3: ERR_UNSUPPORTED_ENCR

    LastError

    Part of subcall function pvCryptoAesCtrCrypt@Module3: pvArraySize

    Part of subcall function pvCryptoAesCtrCrypt@Module3: BCryptHashData

    Part of subcall function pvCryptoAesCtrCrypt@Module3: pvArrayPtr

    Part of subcall function pvCryptoAesCtrCrypt@Module3: AES_BLOCK_SIZE

    Part of subcall function pvCryptoAesCtrCrypt@Module3: AES_BLOCK_SIZE

    Part of subcall function pvCryptoAesCtrCrypt@Module3: UBound

    Part of subcall function pvCryptoAesCtrCrypt@Module3: AES_BLOCK_SIZE

    Part of subcall function pvCryptoAesCtrCrypt@Module3: CopyMemory

    Part of subcall function pvCryptoAesCtrCrypt@Module3: AES_BLOCK_SIZE

    Part of subcall function pvCryptoAesCtrCrypt@Module3: BCryptEncrypt

    Part of subcall function pvCryptoAesCtrCrypt@Module3: BCryptHashData

    Part of subcall function pvCryptoAesCtrCrypt@Module3: pvArrayPtr

    Part of subcall function pvCryptoAesCtrCrypt@Module3: LastError

    LastError

    IsArray

    Part of subcall function pvCryptoGetFinalHash@Module3: HashLen

    Part of subcall function pvCryptoGetFinalHash@Module3: BCryptFinishHash

    Part of subcall function pvCryptoGetFinalHash@Module3: hHmacHash

    Part of subcall function pvCryptoGetFinalHash@Module3: HashLen

    UBound

    Part of subcall function PeekPtr@Module3: CopyMemory

    Part of subcall function PeekPtr@Module3: PTR_SIZE

    VarPtr

    Part of subcall function PeekPtr@Module3: CopyMemory

    Part of subcall function PeekPtr@Module3: PTR_SIZE

    VarPtr

    Part of subcall function PeekPtr@Module3: CopyMemory

    Part of subcall function PeekPtr@Module3: PTR_SIZE

    VarPtr

    VT_BYREF

    Part of subcall function PeekPtr@Module3: CopyMemory

    Part of subcall function PeekPtr@Module3: PTR_SIZE

    Part of subcall function PeekPtr@Module3: CopyMemory

    Part of subcall function PeekPtr@Module3: PTR_SIZE

    Part of subcall function PeekPtr@Module3: CopyMemory

    Part of subcall function PeekPtr@Module3: PTR_SIZE

    CopyMemory

    UBound

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptDestroyHash

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptDestroyKey

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Array

    Number

    Err

    Source

    Description

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptDestroyHash

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptDestroyKey

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Raise

    LineInstructionMeta Information
    186

    Public Function AesCryptArray(baData() as Byte, optional Password as Variant, optional Salt as Variant, optional key as Variant, optional ByVal KeyLen as Long, optional Error as String, optional Hmac as Variant) as Boolean

    194

    Const VT_BYREF as Long = &H4000

    195

    Dim uCtx as UcsCryptoContextType

    196

    Dim vErr as Variant

    197

    Dim bHashBefore as Boolean

    198

    Dim bHashAfter as Boolean

    199

    Dim baPass() as Byte

    200

    Dim baSalt() as Byte

    201

    Dim baKey() as Byte

    202

    Dim baTemp() as Byte

    203

    Dim lPtr as LongPtr

    205

    On Error Goto EH

    206

    If IsArray(Hmac) Then

    IsArray

    207

    bHashBefore = (Hmac(0) <= 0)

    208

    bHashAfter = (Hmac(0) > 0)

    209

    Endif

    210

    If IsMissing(Password) Then

    IsMissing

    211

    baPass = vbNullString

    vbNullString

    212

    Elseif IsArray(Password) Then

    IsArray

    213

    baPass = Password

    214

    Else

    215

    baPass = ToUtf8Array(Password & vbNullString)

    vbNullString

    216

    Endif

    217

    If IsMissing(Salt) Then

    IsMissing

    218

    baSalt = baPass

    219

    Elseif IsArray(Salt) Then

    IsArray

    220

    baSalt = Salt

    221

    Else

    222

    baSalt = ToUtf8Array(Salt & vbNullString)

    vbNullString

    223

    Endif

    224

    If IsArray(key) Then

    IsArray

    225

    baKey = key

    226

    Endif

    227

    If KeyLen <= 0 Then

    228

    KeyLen = AES_KEYLEN

    AES_KEYLEN

    229

    Endif

    230

    If Not pvCryptoAesCtrInit(uCtx, baPass, baSalt, baKey, KeyLen) Then

    231

    Error = uCtx.LastError

    LastError

    232

    Goto QH

    233

    Endif

    234

    If Not pvCryptoAesCtrCrypt(uCtx, baData, HashBefore := bHashBefore, HashAfter := bHashAfter) Then

    235

    Error = uCtx.LastError

    LastError

    236

    Goto QH

    237

    Endif

    238

    If IsArray(Hmac) Then

    IsArray

    239

    baTemp = pvCryptoGetFinalHash(uCtx, UBound(Hmac) + 1)

    UBound

    240

    #if Win64 then

    241

    lPtr = PeekPtr(VarPtr(Hmac) + 8)

    VarPtr

    242

    #else

    243

    lPtr = PeekPtr((VarPtr(Hmac) Xor &H80000000) + 8 Xor &H80000000)

    VarPtr

    244

    #endif

    245

    If (PeekPtr(VarPtr(Hmac)) And VT_BYREF) <> 0 Then

    VarPtr

    VT_BYREF

    246

    lPtr = PeekPtr(lPtr)

    247

    Endif

    248

    #if Win64 then

    249

    lPtr = PeekPtr(lPtr + 16)

    250

    #else

    251

    lPtr = PeekPtr((lPtr Xor &H80000000) + 12 Xor &H80000000)

    252

    #endif

    253

    Call CopyMemory(ByVal lPtr, baTemp(0), UBound(baTemp) + 1)

    CopyMemory

    UBound

    254

    Endif

    256

    AesCryptArray = True

    256

    QH:

    258

    pvCryptoAesCtrTerminate uCtx

    259

    Exit Function

    259

    EH:

    261

    vErr = Array(Err.Number, Err.Source, Err.Description)

    Array

    Number

    Err

    Source

    Description

    262

    pvCryptoAesCtrTerminate uCtx

    263

    Err.Raise vErr(0), vErr(1), vErr(2)

    Raise

    264

    End Function

    APIsMeta Information

    OPENSSL_MAGICLEN

    KDF_SALTLEN

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: vbNullString

    vbNullString

    vbNullString

    IsArray

    IsMissing

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: vbNullString

    vbNullString

    KDF_SALTLEN

    RtlGenRandom

    KDF_SALTLEN

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: IsMissing

    Part of subcall function AesCryptArray@Module3: vbNullString

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: vbNullString

    Part of subcall function AesCryptArray@Module3: IsMissing

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: vbNullString

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: AES_KEYLEN

    Part of subcall function AesCryptArray@Module3: LastError

    Part of subcall function AesCryptArray@Module3: LastError

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: UBound

    Part of subcall function AesCryptArray@Module3: VarPtr

    Part of subcall function AesCryptArray@Module3: VarPtr

    Part of subcall function AesCryptArray@Module3: VarPtr

    Part of subcall function AesCryptArray@Module3: VT_BYREF

    Part of subcall function AesCryptArray@Module3: CopyMemory

    Part of subcall function AesCryptArray@Module3: UBound

    Part of subcall function AesCryptArray@Module3: Array

    Part of subcall function AesCryptArray@Module3: Number

    Part of subcall function AesCryptArray@Module3: Err

    Part of subcall function AesCryptArray@Module3: Source

    Part of subcall function AesCryptArray@Module3: Description

    Part of subcall function AesCryptArray@Module3: Raise

    Raise

    vbObjectError

    IsArray

    UBound

    PREFIXLEN

    UBound

    PREFIXLEN

    CopyMemory

    PREFIXLEN

    UBound

    CopyMemory

    OPENSSL_MAGICLEN

    KDF_SALTLEN

    CopyMemory

    OPENSSL_MAGIC

    OPENSSL_MAGICLEN

    Replace

    Part of subcall function ToBase64Array@Module3: UBound

    Part of subcall function ToBase64Array@Module3: String$

    Part of subcall function ToBase64Array@Module3: UBound

    Part of subcall function ToBase64Array@Module3: Len

    Part of subcall function ToBase64Array@Module3: CryptBinaryToString

    Part of subcall function ToBase64Array@Module3: VarPtr

    Part of subcall function ToBase64Array@Module3: UBound

    Part of subcall function ToBase64Array@Module3: CRYPT_STRING_BASE64

    Part of subcall function ToBase64Array@Module3: StrPtr

    Part of subcall function ToBase64Array@Module3: Left$

    vbCrLf

    vbNullString

    LineInstructionMeta Information
    112

    Public Function AesEncryptString(sText as String, optional Password as Variant) as String

    113

    Const PREFIXLEN as Long = OPENSSL_MAGICLEN + KDF_SALTLEN

    OPENSSL_MAGICLEN

    KDF_SALTLEN

    114

    Dim baData() as Byte

    115

    Dim baPass() as Byte

    116

    Dim baSalt() as Byte

    117

    Dim baKey() as Byte

    118

    Dim sError as String

    120

    baData = ToUtf8Array(sText)

    121

    baPass = vbNullString

    vbNullString

    122

    baSalt = vbNullString

    vbNullString

    123

    If Not IsArray(Password) Then

    IsArray

    124

    If Not IsMissing(Password) Then

    IsMissing

    125

    baPass = ToUtf8Array(Password & vbNullString)

    vbNullString

    126

    Endif

    127

    Redim baSalt(0 To KDF_SALTLEN - 1)

    KDF_SALTLEN

    128

    Call RtlGenRandom(baSalt(0), KDF_SALTLEN)

    RtlGenRandom

    KDF_SALTLEN

    129

    Else

    130

    baKey = Password

    131

    Endif

    132

    If Not AesCryptArray(baData, baPass, baSalt, baKey, Error := sError) Then

    133

    Err.Raise vbObjectError, , sError

    Raise

    vbObjectError

    134

    Endif

    135

    If Not IsArray(Password) Then

    IsArray

    136

    Redim Preserve baData(0 To UBound(baData) + PREFIXLEN)

    UBound

    PREFIXLEN

    137

    If UBound(baData) >= PREFIXLEN Then

    UBound

    PREFIXLEN

    138

    Call CopyMemory(baData(PREFIXLEN), baData(0), UBound(baData) + 1 - PREFIXLEN)

    CopyMemory

    PREFIXLEN

    UBound

    139

    Endif

    140

    Call CopyMemory(baData(OPENSSL_MAGICLEN), baSalt(0), KDF_SALTLEN)

    CopyMemory

    OPENSSL_MAGICLEN

    KDF_SALTLEN

    141

    Call CopyMemory(baData(0), ByVal OPENSSL_MAGIC, OPENSSL_MAGICLEN)

    CopyMemory

    OPENSSL_MAGIC

    OPENSSL_MAGICLEN

    142

    Endif

    143

    AesEncryptString = Replace(ToBase64Array(baData), vbCrLf, vbNullString)

    Replace

    vbCrLf

    vbNullString

    144

    End Function

    APIsMeta Information

    OPENSSL_MAGICLEN

    KDF_SALTLEN

    Part of subcall function FromBase64Array@Module3: Len

    Part of subcall function FromBase64Array@Module3: CryptStringToBinary

    Part of subcall function FromBase64Array@Module3: StrPtr

    Part of subcall function FromBase64Array@Module3: Len

    Part of subcall function FromBase64Array@Module3: CRYPT_STRING_BASE64

    Part of subcall function FromBase64Array@Module3: VarPtr

    Part of subcall function FromBase64Array@Module3: vbNullString

    vbNullString

    vbNullString

    IsArray

    IsMissing

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: WideCharToMultiByte

    Part of subcall function ToUtf8Array@Module3: CP_UTF8

    Part of subcall function ToUtf8Array@Module3: StrPtr

    Part of subcall function ToUtf8Array@Module3: Len

    Part of subcall function ToUtf8Array@Module3: vbNullString

    vbNullString

    UBound

    PREFIXLEN

    String$

    OPENSSL_MAGICLEN

    CopyMemory

    OPENSSL_MAGICLEN

    OPENSSL_MAGIC

    KDF_SALTLEN

    CopyMemory

    OPENSSL_MAGICLEN

    KDF_SALTLEN

    UBound

    PREFIXLEN

    CopyMemory

    PREFIXLEN

    UBound

    UBound

    PREFIXLEN

    vbNullString

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: IsMissing

    Part of subcall function AesCryptArray@Module3: vbNullString

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: vbNullString

    Part of subcall function AesCryptArray@Module3: IsMissing

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: vbNullString

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: AES_KEYLEN

    Part of subcall function AesCryptArray@Module3: LastError

    Part of subcall function AesCryptArray@Module3: LastError

    Part of subcall function AesCryptArray@Module3: IsArray

    Part of subcall function AesCryptArray@Module3: UBound

    Part of subcall function AesCryptArray@Module3: VarPtr

    Part of subcall function AesCryptArray@Module3: VarPtr

    Part of subcall function AesCryptArray@Module3: VarPtr

    Part of subcall function AesCryptArray@Module3: VT_BYREF

    Part of subcall function AesCryptArray@Module3: CopyMemory

    Part of subcall function AesCryptArray@Module3: UBound

    Part of subcall function AesCryptArray@Module3: Array

    Part of subcall function AesCryptArray@Module3: Number

    Part of subcall function AesCryptArray@Module3: Err

    Part of subcall function AesCryptArray@Module3: Source

    Part of subcall function AesCryptArray@Module3: Description

    Part of subcall function AesCryptArray@Module3: Raise

    Raise

    vbObjectError

    Part of subcall function FromUtf8Array@Module3: UBound

    Part of subcall function FromUtf8Array@Module3: String$

    Part of subcall function FromUtf8Array@Module3: UBound

    Part of subcall function FromUtf8Array@Module3: MultiByteToWideChar

    Part of subcall function FromUtf8Array@Module3: CP_UTF8

    Part of subcall function FromUtf8Array@Module3: UBound

    Part of subcall function FromUtf8Array@Module3: StrPtr

    Part of subcall function FromUtf8Array@Module3: Len

    Part of subcall function FromUtf8Array@Module3: Left$

    LineInstructionMeta Information
    147

    Public Function AesDecryptString(sEncr as String, optional Password as Variant) as String

    148

    Const PREFIXLEN as Long = OPENSSL_MAGICLEN + KDF_SALTLEN

    OPENSSL_MAGICLEN

    KDF_SALTLEN

    149

    Dim baData() as Byte

    150

    Dim baPass() as Byte

    151

    Dim baSalt() as Byte

    152

    Dim baKey() as Byte

    153

    Dim sMagic as String

    154

    Dim sError as String

    156

    baData = FromBase64Array(sEncr)

    157

    baPass = vbNullString

    vbNullString

    158

    baSalt = vbNullString

    vbNullString

    159

    If Not IsArray(Password) Then

    IsArray

    160

    If Not IsMissing(Password) Then

    IsMissing

    161

    baPass = ToUtf8Array(Password & vbNullString)

    vbNullString

    162

    Endif

    163

    If UBound(baData) >= PREFIXLEN - 1 Then

    UBound

    PREFIXLEN

    164

    sMagic = String$(OPENSSL_MAGICLEN, 0)

    String$

    OPENSSL_MAGICLEN

    165

    Call CopyMemory(ByVal sMagic, baData(0), OPENSSL_MAGICLEN)

    CopyMemory

    OPENSSL_MAGICLEN

    166

    If sMagic = OPENSSL_MAGIC Then

    OPENSSL_MAGIC

    167

    Redim baSalt(0 To KDF_SALTLEN - 1)

    KDF_SALTLEN

    168

    Call CopyMemory(baSalt(0), baData(OPENSSL_MAGICLEN), KDF_SALTLEN)

    CopyMemory

    OPENSSL_MAGICLEN

    KDF_SALTLEN

    169

    If UBound(baData) >= PREFIXLEN Then

    UBound

    PREFIXLEN

    170

    Call CopyMemory(baData(0), baData(PREFIXLEN), UBound(baData) + 1 - PREFIXLEN)

    CopyMemory

    PREFIXLEN

    UBound

    171

    Redim Preserve baData(0 To UBound(baData) - PREFIXLEN)

    UBound

    PREFIXLEN

    172

    Else

    173

    baData = vbNullString

    vbNullString

    174

    Endif

    175

    Endif

    176

    Endif

    177

    Else

    178

    baKey = Password

    179

    Endif

    180

    If Not AesCryptArray(baData, baPass, baSalt, baKey, Error := sError) Then

    181

    Err.Raise vbObjectError, , sError

    Raise

    vbObjectError

    182

    Endif

    183

    AesDecryptString = FromUtf8Array(baData)

    184

    End Function

    APIsMeta Information

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptDestroyHash

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptDestroyKey

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    m_uChunkedCtx

    vbNullString

    IsArray

    AES_KEYLEN

    Part of subcall function pvCryptoAesCtrInit@Module3: vbNullString

    Part of subcall function pvCryptoAesCtrInit@Module3: vbNullString

    Part of subcall function pvCryptoAesCtrInit@Module3: AES_IVLEN

    Part of subcall function pvCryptoAesCtrInit@Module3: UBound

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptOpenAlgorithmProvider

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: KDF_HASH

    Part of subcall function pvCryptoAesCtrInit@Module3: MS_PRIMITIVE_PROVIDER

    Part of subcall function pvCryptoAesCtrInit@Module3: BCRYPT_ALG_HANDLE_HMAC_FLAG

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptDeriveKeyPBKDF2

    Part of subcall function pvCryptoAesCtrInit@Module3: pvArrayPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: pvArraySize

    Part of subcall function pvCryptoAesCtrInit@Module3: KDF_ITER

    Part of subcall function pvCryptoAesCtrInit@Module3: UBound

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptOpenAlgorithmProvider

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: MS_PRIMITIVE_PROVIDER

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptGetProperty

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptSetProperty

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptGenerateSymmetricKey

    Part of subcall function pvCryptoAesCtrInit@Module3: CopyMemory

    Part of subcall function pvCryptoAesCtrInit@Module3: AES_IVLEN

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptOpenAlgorithmProvider

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: HMAC_HASH

    Part of subcall function pvCryptoAesCtrInit@Module3: MS_PRIMITIVE_PROVIDER

    Part of subcall function pvCryptoAesCtrInit@Module3: BCRYPT_ALG_HANDLE_HMAC_FLAG

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptGetProperty

    Part of subcall function pvCryptoAesCtrInit@Module3: StrPtr

    Part of subcall function pvCryptoAesCtrInit@Module3: BCryptCreateHash

    Part of subcall function pvCryptoAesCtrInit@Module3: AES_IVLEN

    Part of subcall function pvCryptoAesCtrInit@Module3: LastError

    Part of subcall function pvCryptoAesCtrInit@Module3: LastError

    Part of subcall function pvCryptoAesCtrInit@Module3: ERR_UNSUPPORTED_ENCR

    m_uChunkedCtx

    LineInstructionMeta Information
    266

    Public Function AesChunkedInit(optional key as Variant, optional ByVal KeyLen as Long) as Boolean

    267

    Dim baEmpty() as Byte

    268

    Dim baKey() as Byte

    270

    pvCryptoAesCtrTerminate m_uChunkedCtx

    m_uChunkedCtx

    271

    baEmpty = vbNullString

    vbNullString

    272

    If IsArray(key) Then

    IsArray

    273

    baKey = key

    274

    Endif

    275

    If KeyLen <= 0 Then

    276

    KeyLen = AES_KEYLEN

    AES_KEYLEN

    277

    Endif

    278

    AesChunkedInit = pvCryptoAesCtrInit(m_uChunkedCtx, baEmpty, baEmpty, baKey, KeyLen)

    m_uChunkedCtx

    279

    End Function

    APIsMeta Information

    pvArraySize

    BCryptHashData

    pvArrayPtr

    AES_BLOCK_SIZE

    AES_BLOCK_SIZE

    UBound

    AES_BLOCK_SIZE

    CopyMemory

    AES_BLOCK_SIZE

    Part of subcall function pvInc@Module3: htonl

    Part of subcall function pvInc@Module3: htonl

    Part of subcall function pvInc@Module3: htonl

    Part of subcall function pvInc@Module3: htonl

    Part of subcall function pvInc@Module3: htonl

    Part of subcall function pvInc@Module3: htonl

    Part of subcall function pvInc@Module3: htonl

    Part of subcall function pvInc@Module3: htonl

    BCryptEncrypt

    BCryptHashData

    pvArrayPtr

    LastError

    Part of subcall function GetSystemMessage@Module3: Space$

    Part of subcall function GetSystemMessage@Module3: FormatMessage

    Part of subcall function GetSystemMessage@Module3: FORMAT_MESSAGE_FROM_SYSTEM

    Part of subcall function GetSystemMessage@Module3: FORMAT_MESSAGE_IGNORE_INSERTS

    Part of subcall function GetSystemMessage@Module3: Len

    Part of subcall function GetSystemMessage@Module3: Mid$

    Part of subcall function GetSystemMessage@Module3: vbCrLf

    Part of subcall function GetSystemMessage@Module3: Left$

    Part of subcall function GetSystemMessage@Module3: Hex

    LineInstructionMeta Information
    395

    Private Function pvCryptoAesCtrCrypt(uCtx as UcsCryptoContextType, baData() as Byte, optional ByVal Offset as Long, optional ByVal Size as Long = - 1, optional ByVal HashBefore as Boolean, optional ByVal HashAfter as Boolean) as Boolean

    402

    Dim lIdx as Long

    403

    Dim lJdx as Long

    404

    Dim lPadSize as Long

    405

    Dim hResult as Long

    407

    With uCtx

    408

    If Size < 0 Then

    409

    Size = pvArraySize(baData) - Offset

    pvArraySize

    410

    Endif

    411

    If HashBefore Then

    412

    hResult = BCryptHashData(. hHmacHash, ByVal pvArrayPtr(baData, Offset), Size, 0)

    BCryptHashData

    pvArrayPtr

    413

    If hResult < 0 Then

    414

    Goto QH

    415

    Endif

    416

    Endif

    418

    For lIdx = Offset To Offset + Size - 1

    419

    If (. EncrPos And (AES_BLOCK_SIZE - 1)) = 0 Then

    AES_BLOCK_SIZE

    420

    Exit For

    421

    Endif

    422

    baData(lIdx) = baData(lIdx) Xor . EncrData(. EncrPos)

    423

    . EncrPos = . EncrPos + 1

    424

    Next

    425

    If lIdx < Offset + Size Then

    427

    lPadSize = (Offset + Size - lIdx + AES_BLOCK_SIZE - 1) And - AES_BLOCK_SIZE

    AES_BLOCK_SIZE

    428

    If UBound(. EncrData) + 1 < lPadSize Then

    UBound

    429

    ReDim .EncrData(0 To lPadSize - 1) As Byte ' BAD !

    430

    Endif

    432

    For lJdx = 0 To lPadSize - 1 Step AES_BLOCK_SIZE

    AES_BLOCK_SIZE

    433

    Call CopyMemory(. EncrData(lJdx), . Nonce(0), AES_BLOCK_SIZE)

    CopyMemory

    AES_BLOCK_SIZE

    434

    If pvInc(. Nonce(3)) Then

    435

    If pvInc(. Nonce(2)) Then

    436

    If pvInc(. Nonce(1)) Then

    437

    If pvInc(. Nonce(0)) Then

    439

    Endif

    440

    Endif

    441

    Endif

    442

    Endif

    443

    Next

    AES_BLOCK_SIZE

    444

    hResult = BCryptEncrypt(. hAesKey, . EncrData(0), lPadSize, 0, 0, 0, . EncrData(0), lPadSize, lJdx, 0)

    BCryptEncrypt

    445

    If hResult < 0 Then

    446

    Goto QH

    447

    Endif

    449

    For . EncrPos = 0 To Offset + Size - lIdx - 1

    450

    baData(lIdx) = baData(lIdx) Xor . EncrData(. EncrPos)

    451

    lIdx = lIdx + 1

    452

    Next

    453

    Endif

    454

    If HashAfter Then

    455

    hResult = BCryptHashData(. hHmacHash, ByVal pvArrayPtr(baData, Offset), Size, 0)

    BCryptHashData

    pvArrayPtr

    456

    If hResult < 0 Then

    457

    Goto QH

    458

    Endif

    459

    Endif

    460

    End With

    462

    pvCryptoAesCtrCrypt = True

    463

    Exit Function

    463

    QH:

    465

    uCtx.LastError = GetSystemMessage(hResult)

    LastError

    466

    End Function

    APIsMeta Information

    hAesAlg

    LastError

    ERR_CHUNKED_NOT_INIT

    Part of subcall function pvCryptoAesCtrCrypt@Module3: pvArraySize

    Part of subcall function pvCryptoAesCtrCrypt@Module3: BCryptHashData

    Part of subcall function pvCryptoAesCtrCrypt@Module3: pvArrayPtr

    Part of subcall function pvCryptoAesCtrCrypt@Module3: AES_BLOCK_SIZE

    Part of subcall function pvCryptoAesCtrCrypt@Module3: AES_BLOCK_SIZE

    Part of subcall function pvCryptoAesCtrCrypt@Module3: UBound

    Part of subcall function pvCryptoAesCtrCrypt@Module3: AES_BLOCK_SIZE

    Part of subcall function pvCryptoAesCtrCrypt@Module3: CopyMemory

    Part of subcall function pvCryptoAesCtrCrypt@Module3: AES_BLOCK_SIZE

    Part of subcall function pvCryptoAesCtrCrypt@Module3: BCryptEncrypt

    Part of subcall function pvCryptoAesCtrCrypt@Module3: BCryptHashData

    Part of subcall function pvCryptoAesCtrCrypt@Module3: pvArrayPtr

    Part of subcall function pvCryptoAesCtrCrypt@Module3: LastError

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptDestroyHash

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptDestroyKey

    Part of subcall function pvCryptoAesCtrTerminate@Module3: BCryptCloseAlgorithmProvider

    LineInstructionMeta Information
    281

    Public Function AesChunkedCryptArray(baInput() as Byte, baOutput() as Byte, optional ByVal Final as Boolean = True) as Boolean

    282

    If m_uChunkedCtx.hAesAlg = 0 Then

    hAesAlg

    283

    m_uChunkedCtx.LastError = ERR_CHUNKED_NOT_INIT

    LastError

    ERR_CHUNKED_NOT_INIT

    284

    Exit Function

    285

    Endif

    286

    baOutput = baInput

    287

    AesChunkedCryptArray = pvCryptoAesCtrCrypt(m_uChunkedCtx, baOutput)

    288

    If Final Then

    289

    pvCryptoAesCtrTerminate m_uChunkedCtx

    290

    Endif

    291

    End Function

    APIsMeta Information

    UBound

    String$

    UBound

    Len

    CryptBinaryToString

    VarPtr

    UBound

    CRYPT_STRING_BASE64

    StrPtr

    Left$

    LineInstructionMeta Information
    514

    Public Function ToBase64Array(baData() as Byte) as String

    515

    Const CRYPT_STRING_BASE64 as Long = 1

    516

    Dim lSize as Long

    518

    If UBound(baData) >= 0 Then

    UBound

    519

    ToBase64Array = String$(2 * UBound(baData) + 6, 0)

    String$

    UBound

    520

    lSize = Len(ToBase64Array) + 1

    Len

    521

    Call CryptBinaryToString(VarPtr(baData(0)), UBound(baData) + 1, CRYPT_STRING_BASE64, StrPtr(ToBase64Array), lSize)

    CryptBinaryToString

    VarPtr

    UBound

    CRYPT_STRING_BASE64

    StrPtr

    522

    ToBase64Array = Left$(ToBase64Array, lSize)

    Left$

    523

    Endif

    524

    End Function

    APIsMeta Information

    WideCharToMultiByte

    CP_UTF8

    StrPtr

    Len

    WideCharToMultiByte

    CP_UTF8

    StrPtr

    Len

    vbNullString

    LineInstructionMeta Information
    542

    Public Function ToUtf8Array(sText as String) as Byte()

    543

    Const CP_UTF8 as Long = 65001

    544

    Dim baRetVal() as Byte

    545

    Dim lSize as Long

    547

    lSize = WideCharToMultiByte(CP_UTF8, 0, StrPtr(sText), Len(sText), ByVal 0, 0, 0, 0)

    WideCharToMultiByte

    CP_UTF8

    StrPtr

    Len

    548

    If lSize > 0 Then

    549

    Redim baRetVal(0 To lSize - 1)

    550

    Call WideCharToMultiByte(CP_UTF8, 0, StrPtr(sText), Len(sText), baRetVal(0), lSize, 0, 0)

    WideCharToMultiByte

    CP_UTF8

    StrPtr

    Len

    551

    Else

    552

    baRetVal = vbNullString

    vbNullString

    553

    Endif

    554

    ToUtf8Array = baRetVal

    555

    End Function

    APIsMeta Information

    Space$

    FormatMessage

    FORMAT_MESSAGE_FROM_SYSTEM

    FORMAT_MESSAGE_IGNORE_INSERTS

    Len

    Mid$

    vbCrLf

    Left$

    Hex

    LineInstructionMeta Information
    568

    Public Function GetSystemMessage(ByVal lLastDllError as Long) as String

    569

    Const FORMAT_MESSAGE_FROM_SYSTEM as Long = &H1000

    570

    Const FORMAT_MESSAGE_IGNORE_INSERTS as Long = &H200

    571

    Dim lSize as Long

    573

    GetSystemMessage = Space$(2000)

    Space$

    574

    lSize = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM Or FORMAT_MESSAGE_IGNORE_INSERTS, 0, lLastDllError, 0, GetSystemMessage, Len(GetSystemMessage), 0)

    FormatMessage

    FORMAT_MESSAGE_FROM_SYSTEM

    FORMAT_MESSAGE_IGNORE_INSERTS

    Len

    575

    If lSize > 2 Then

    576

    If Mid$(GetSystemMessage, lSize - 1, 2) = vbCrLf Then

    Mid$

    vbCrLf

    577

    lSize = lSize - 2

    578

    Endif

    579

    Endif

    580

    GetSystemMessage = Left$(GetSystemMessage, lSize) & " &H" & Hex(lLastDllError)

    Left$

    Hex

    581

    End Function

    APIsMeta Information

    UBound

    String$

    UBound

    MultiByteToWideChar

    CP_UTF8

    UBound

    StrPtr

    Len

    Left$

    LineInstructionMeta Information
    557

    Public Function FromUtf8Array(baText() as Byte) as String

    558

    Const CP_UTF8 as Long = 65001

    559

    Dim lSize as Long

    561

    If UBound(baText) >= 0 Then

    UBound

    562

    FromUtf8Array = String$(2 * (UBound(baText) + 1), 0)

    String$

    UBound

    563

    lSize = MultiByteToWideChar(CP_UTF8, 0, baText(0), UBound(baText) + 1, StrPtr(FromUtf8Array), Len(FromUtf8Array))

    MultiByteToWideChar

    CP_UTF8

    UBound

    StrPtr

    Len

    564

    FromUtf8Array = Left$(FromUtf8Array, lSize)

    Left$

    565

    Endif

    566

    End Function

    APIsMeta Information

    Len

    CryptStringToBinary

    StrPtr

    Len

    CRYPT_STRING_BASE64

    VarPtr

    vbNullString

    LineInstructionMeta Information
    526

    Public Function FromBase64Array(sText as String) as Byte()

    527

    Const CRYPT_STRING_BASE64 as Long = 1

    528

    Dim lSize as Long

    529

    Dim baOutput() as Byte

    531

    lSize = Len(sText) + 1

    Len

    532

    Redim baOutput(0 To lSize - 1)

    533

    Call CryptStringToBinary(StrPtr(sText), Len(sText), CRYPT_STRING_BASE64, VarPtr(baOutput(0)), lSize, 0, 0)

    CryptStringToBinary

    StrPtr

    Len

    CRYPT_STRING_BASE64

    VarPtr

    534

    If lSize > 0 Then

    535

    Redim Preserve baOutput(0 To lSize - 1)

    536

    FromBase64Array = baOutput

    537

    Else

    538

    FromBase64Array = vbNullString

    vbNullString

    539

    Endif

    540

    End Function

    APIsMeta Information

    CopyMemory

    ArrPtr

    PTR_SIZE

    UBound

    LBound

    VarPtr

    LBound

    LineInstructionMeta Information
    489

    Private Property Get pvArrayPtr(baArray() as Byte, optional ByVal Index as Long) as LongPtr

    490

    Dim lPtr as LongPtr

    493

    Call CopyMemory(lPtr, ByVal ArrPtr(baArray), PTR_SIZE)

    CopyMemory

    ArrPtr

    PTR_SIZE

    494

    If lPtr <> 0 Then

    495

    If 0 <= Index And Index <= UBound(baArray) - LBound(baArray) Then

    UBound

    LBound

    496

    pvArrayPtr = VarPtr(baArray(LBound(baArray) + Index))

    VarPtr

    LBound

    497

    Endif

    498

    Endif

    499

    End Property

    APIsMeta Information

    BCryptCloseAlgorithmProvider

    BCryptDestroyHash

    BCryptCloseAlgorithmProvider

    BCryptDestroyKey

    BCryptCloseAlgorithmProvider

    LineInstructionMeta Information
    370

    Private Sub pvCryptoAesCtrTerminate(uCtx as UcsCryptoContextType)

    371

    With uCtx

    372

    If . hPbkdf2Alg <> 0 Then

    373

    Call BCryptCloseAlgorithmProvider(. hPbkdf2Alg, 0)

    BCryptCloseAlgorithmProvider

    374

    . hPbkdf2Alg = 0

    375

    Endif

    376

    If . hHmacHash <> 0 Then

    377

    Call BCryptDestroyHash(. hHmacHash)

    BCryptDestroyHash

    378

    . hHmacHash = 0

    379

    Endif

    380

    If . hHmacAlg <> 0 Then

    381

    Call BCryptCloseAlgorithmProvider(. hHmacAlg, 0)

    BCryptCloseAlgorithmProvider

    382

    . hHmacAlg = 0

    383

    Endif

    384

    If . hAesKey <> 0 Then

    385

    Call BCryptDestroyKey(. hAesKey)

    BCryptDestroyKey

    386

    . hAesKey = 0

    387

    Endif

    388

    If . hAesAlg <> 0 Then

    389

    Call BCryptCloseAlgorithmProvider(. hAesAlg, 0)

    BCryptCloseAlgorithmProvider

    390

    . hAesAlg = 0

    391

    Endif

    392

    End With

    393

    End Sub

    APIsMeta Information

    CopyMemory

    ArrPtr

    PTR_SIZE

    UBound

    LBound

    LineInstructionMeta Information
    501

    Private Property Get pvArraySize(baArray() as Byte) as Long

    502

    Dim lPtr as LongPtr

    505

    Call CopyMemory(lPtr, ByVal ArrPtr(baArray), PTR_SIZE)

    CopyMemory

    ArrPtr

    PTR_SIZE

    506

    If lPtr <> 0 Then

    507

    pvArraySize = UBound(baArray) + 1 - LBound(baArray)

    UBound

    LBound

    508

    Endif

    509

    End Property

    APIsMeta Information

    HashLen

    BCryptFinishHash

    hHmacHash

    HashLen

    LineInstructionMeta Information
    468

    Private Function pvCryptoGetFinalHash(uCtx as UcsCryptoContextType, ByVal lSize as Long) as Byte()

    469

    Dim baResult() as Byte

    471

    Redim baResult(0 To uCtx.HashLen - 1)

    HashLen

    472

    Call BCryptFinishHash(uCtx.hHmacHash, baResult(0), uCtx.HashLen, 0)

    BCryptFinishHash

    hHmacHash

    HashLen

    473

    Redim Preserve baResult(0 To lSize - 1)

    474

    pvCryptoGetFinalHash = baResult

    475

    End Function

    APIsMeta Information

    htonl

    htonl

    LineInstructionMeta Information
    477

    Private Function pvInc(lValue as Long) as Boolean

    478

    lValue = htonl(lValue)

    htonl

    479

    If lValue = - 1 Then

    480

    lValue = 0

    482

    pvInc = True

    483

    Else

    484

    lValue = (lValue Xor &H80000000) + 1 Xor &H80000000

    485

    lValue = htonl(lValue)

    htonl

    486

    Endif

    487

    End Function

    APIsMeta Information

    LastError

    m_uChunkedCtx

    LineInstructionMeta Information
    293

    Public Function AesChunkedGetLastError() as String

    294

    AesChunkedGetLastError = m_uChunkedCtx.LastError

    LastError

    m_uChunkedCtx

    295

    End Function

    APIsMeta Information

    CopyMemory

    PTR_SIZE

    LineInstructionMeta Information
    583

    Private Function PeekPtr(ByVal lPtr as LongPtr) as LongPtr

    584

    Call CopyMemory(PeekPtr, ByVal lPtr, PTR_SIZE)

    CopyMemory

    PTR_SIZE

    585

    End Function

    Module: ThisDocument

    Declaration
    LineContent
    1

    Attribute VB_Name = "ThisDocument"

    2

    Attribute VB_Base = "1Normal.ThisDocument"

    3

    Attribute VB_GlobalNameSpace = False

    4

    Attribute VB_Creatable = False

    5

    Attribute VB_PredeclaredId = True

    6

    Attribute VB_Exposed = True

    7

    Attribute VB_TemplateDerived = True

    8

    Attribute VB_Customizable = True

    APIsMeta Information

    OnTime

    Now

    TimeValue

    StringsDecrypted Strings
    "TestAES"
    LineInstructionMeta Information
    9

    Private Sub Document_Open()

    11

    Application.OnTime Now + TimeValue("00:00:01"), "TestAES"

    OnTime

    Now

    TimeValue

    12

    End Sub

    Reset < >