Function at 0x406bce
Capabilities:
Connect pipe
Create thread
Read file on windows
Read pipe
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push 0x401176
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x70
push ebx
push esi
push edi
mov dword [ebp - 0xc], esp
mov dword [ebp - 8], sym.imp.MSVBVM60.DLL___vbaGenerateBoundsError
mov edx, dword [ebp + 8]
mov edi, dword [sym.imp.MSVBVM60.DLL___vbaFreeVar]
xor esi, esi
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x58], esi
mov dword [ebp - 0x5c], esi
mov dword [ebp - 0x6c], esi
call edi
mov edx, dword [ebp + 0xc]
lea ecx, [ebp - 0x30]
call edi
mov edx, 0x401704
lea ecx, [ebp - 0x1c]
call edi
mov eax, dword [ebp - 0x24]
push 0x401754
push eax
call dword [sym.imp.ADVAPI32.DLL_SetSecurityDescriptorDacl]
mov ebx, dword [sym.imp.MSVBVM60.DLL___vbaRaiseEvent]
mov edx, eax
lea ecx, [ebp - 0x44]
call ebx
push eax
push esi
call dword [sym.imp.KERNEL32.DLL_WriteFile]
mov edx, eax
lea ecx, [ebp - 0x48]
call ebx
push eax
call dword [sym.imp.ADVAPI32.DLL_SetSecurityDescriptorDacl]
mov edx, eax
lea ecx, [ebp - 0x34]
call ebx
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x44]
push ecx
push edx
push 2
call dword [sym.imp.MSVBVM60.DLL___vbaAryMove]
mov eax, dword [ebp - 0x30]
add esp, 0xc
push eax
push 0x401704
call dword [sym.imp.KERNEL32.DLL_CreateEventW]
test eax, eax
je 0x406e73
push esi
lea edx, [ebp - 0x6c]
push 0x80
lea eax, [ebp - 0x58]
lea ecx, [ebp - 0x30]
push edx
push eax
mov dword [ebp - 0x64], ecx
mov dword [ebp - 0x6c], 0x4008
call dword [sym.imp.KERNEL32.DLL_CreateThread]
lea ecx, [ebp - 0x58]
lea edx, [ebp - 0x5c]
push ecx
push edx
call dword [sym.imp.MSVBVM60.DLL_EVENT_SINK_GetIDsOfNames]
lea eax, [ebp - 0x5c]
lea ecx, [ebp - 0x18]
push eax
push ecx
call dword [sym.imp.ADVAPI32.DLL_SetServiceStatus]
lea ecx, [ebp - 0x58]
call dword [sym.imp.ADVAPI32.DLL_RegOpenKeyExW]
push esi
push 0x3ff
push 1
lea edx, [ebp - 0x20]
push 0x11
push edx
push 1
push 0x80
call dword [sym.imp.KERNEL32.DLL_WTSGetActiveConsoleSessionId]
mov eax, dword [ebp - 0x20]
add esp, 0x1c
lea ecx, [ebp - 0x40]
mov dword [ebp - 0x28], esi
push eax
push ecx
call dword [sym.imp.MSVBVM60.DLL___vbaFreeVarList]
mov eax, dword [ebp - 0x40]
cmp eax, esi
je 0x406d41
cmp word [eax], 1
jne 0x406d41
mov edi, dword [eax + 0x14]
mov ecx, dword [eax + 0x10]
neg edi
cmp edi, ecx
jb 0x406d3d
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
mov ebx, edi
jmp 0x406d49
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
mov ebx, eax
mov edx, dword [ebp - 0x18]
lea eax, [ebp - 0x3c]
push edx
push eax
call dword [sym.imp.MSVBVM60.DLL___vbaFreeVarList]
mov eax, dword [ebp - 0x3c]
cmp eax, esi
je 0x406d78
cmp word [eax], 1
jne 0x406d78
mov edi, dword [eax + 0x14]
mov ecx, dword [eax + 0x10]
neg edi
cmp edi, ecx
jb 0x406d80
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
jmp 0x406d80
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
mov edi, eax
mov edx, dword [ebp - 0x40]
lea ecx, [ebp - 0x28]
push esi
push ecx
mov eax, dword [edx + 0xc]
mov ecx, dword [ebp - 0x18]
add eax, ebx
push 0x400
push eax
push ecx
push 1
call dword [sym.imp.KERNEL32.DLL_ReadFile]
mov edx, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x34]
add eax, 1
jo 0x406f13
push eax
mov eax, dword [edx + 0xc]
add eax, edi
lea edx, [ebp - 0x44]
push eax
push ecx
push edx
call dword [sym.imp.MSVBVM60.DLL___vbaEnd]
push eax
call dword [sym.imp.USER32.DLL_GetProcessWindowStation]
mov edi, eax
mov eax, dword [ebp - 0x44]
lea ecx, [ebp - 0x34]
push eax
push ecx
call dword [sym.imp.KERNEL32.DLL_ConnectNamedPipe]
mov ebx, dword [sym.imp.MSVBVM60.DLL___vbaCopyBytes]
lea edx, [ebp - 0x3c]
push edx
call ebx
lea eax, [ebp - 0x40]
push eax
call ebx
xor ecx, ecx
mov ebx, dword [sym.imp.MSVBVM60.DLL___vbaLsetFixstr]
cmp edi, esi
setne cl
neg ecx
mov edi, ecx
lea ecx, [ebp - 0x44]
call ebx
cmp di, si
je 0x406e59
cmp dword [ebp - 0x28], esi
jle 0x406e59
push esi
lea eax, [ebp - 0x6c]
push 0x40
lea ecx, [ebp - 0x58]
lea edx, [ebp - 0x20]
push eax
push ecx
mov dword [ebp - 0x64], edx
mov dword [ebp - 0x6c], 0x6011
call dword [sym.imp.KERNEL32.DLL_CreateThread]
mov edx, dword [ebp - 0x28]
lea eax, [ebp - 0x58]
push edx
lea ecx, [ebp - 0x44]
push eax
push ecx
call dword [sym.imp.KERNEL32.DLL_CallNamedPipeA]
push eax
call dword [sym.imp.MSVBVM60.DLL__adj_fdiv_m64]
mov edx, eax
lea ecx, [ebp - 0x1c]
call dword [sym.imp.MSVBVM60.DLL___vbaRaiseEvent]
lea ecx, [ebp - 0x44]
call ebx
lea ecx, [ebp - 0x58]
call dword [sym.imp.ADVAPI32.DLL_RegOpenKeyExW]
mov edi, dword [sym.imp.KERNEL32.DLL_RtlMoveMemory]
lea edx, [ebp - 0x18]
push edx
push esi
call edi
lea eax, [ebp - 0x20]
push eax
push esi
call edi
mov edi, dword [sym.imp.MSVBVM60.DLL___vbaFreeVar]
mov edx, dword [ebp - 0x1c]
lea ecx, [ebp - 0x38]
call edi
push 0x4020cf
jmp 0x406ecc
mov ebx, dword [sym.imp.ADVAPI32.DLL_RegisterServiceCtrlHandlerExW]
lea eax, [ebp - 0x18]
xor esi, esi
push eax
push esi
call ebx
mov edi, dword [sym.imp.MSVBVM60.DLL___vbaLsetFixstr]
lea ecx, [ebp - 0x1c]
call edi
lea ecx, [ebp - 0x20]
push ecx
push esi
call ebx
lea ecx, [ebp - 0x24]
call edi
lea ecx, [ebp - 0x30]
call edi
lea ecx, [ebp - 0x34]
call edi
ret
call dword [0x4010b0]
nop
nop
nop
nop
nop
sahf
sahf
sahf
sahf
xor byte [ecx], ah
add byte [eax], al