Function at 0x40c367
Capabilities:
Get common file path
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x45ebc4
call fcn.0045d320
sub esp, 0x4dc
mov ax, word [0x47a19c]
push esi
push edi
mov word [ebp - 0x2e0], ax
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x2de]
push 0x104
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x4e8]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [ebp - 0x4e8]
push str.winsta.dll
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [ebp - 0x4e8]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
xor esi, esi
cmp edi, esi
je 0x40c40a
push str.WinStationQueryInformationW
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, esi
je 0x40c403
lea ecx, [ebp - 0x28]
push ecx
lea ecx, [ebp - 0x2e0]
push 0x208
push ecx
push 0x21
push dword [ebp + 8]
push esi
call eax
test al, al
jne 0x40c403
mov word [ebp - 0x2e0], si
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp word [ebp - 0x2e0], si
jne 0x40c42b
push dword [ebp + 8]
lea eax, [ebp - 0x2e0]
push str..PipeTerminalServerSystemExecSrvr_d
push eax
call dword [sym.imp.MSVCRT.dll_swprintf]
add esp, 0xc
push esi
push esi
push 3
push esi
push esi
lea eax, [ebp - 0x2e0]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
jne 0x40c475
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe7
jne 0x40c46e
lea eax, [ebp - 0x2e0]
push 0x7530
push eax
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeW]
test eax, eax
jne 0x40c42b
xor eax, eax
jmp 0x40c5cd
push ebx
push 0x400
lea ecx, [ebp - 0x20]
call fcn.00411c93
mov ebx, 0x94
lea ecx, [ebp - 0x20]
push ebx
push esi
mov dword [ebp - 4], esi
call fcn.00411cce
push ebx
lea eax, [ebp - 0xd8]
push esi
push eax
call sub.MSVCRT.dll_memset
mov eax, dword [ebp + 0x24]
add esp, 0xc
mov dword [ebp - 0xa8], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xd0], eax
mov eax, dword [ebp + 0x28]
mov dword [ebp - 0xa4], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [ebp - 0xd4], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xcc], eax
lea eax, [ebp - 0x20]
push eax
push dword [ebp + 0x14]
call fcn.0040c334
mov dword [ebp - 0xc8], eax
lea eax, [ebp - 0x20]
push eax
push dword [ebp + 0x18]
call fcn.0040c334
mov esi, dword [ebp + 0x34]
push 0x11
mov dword [ebp - 0xc4], eax
pop ecx
lea eax, [ebp - 0x20]
lea edi, [ebp - 0x98]
push eax
rep movsd dword es:[edi], dword [esi]
push dword [ebp - 0x90]
call fcn.0040c334
mov dword [ebp - 0x90], eax
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x8c]
call fcn.0040c334
mov dword [ebp - 0x8c], eax
mov eax, dword [ebp - 0x14]
add esp, 0x20
mov dword [ebp - 0xd8], eax
lea eax, [ebp - 0xd8]
xor esi, esi
push ebx
push eax
lea ecx, [ebp - 0x20]
mov dword [ebp - 0xa0], esi
call fcn.00412465
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
lea eax, [ebp - 0x24]
lea ecx, [ebp - 0x20]
push esi
push eax
push dword [ebp - 0x14]
call fcn.00412465
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c5b3
lea eax, [ebp - 0x24]
push esi
push eax
lea eax, [ebp - 0x44]
push 0x1c
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40c5b3
mov ebx, dword [ebp - 0x40]
cmp ebx, esi
je 0x40c5a8
mov edi, dword [ebp + 0x38]
lea esi, [ebp - 0x38]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
jmp 0x40c5b5
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40c5b5
xor ebx, ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x20]
call fcn.00411cb9
mov eax, ebx
pop ebx
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
leave
ret