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

Disassembly:
mov eax, 0x26a0
call fcn.00492490
mov eax, dword [0x4ba700]
xor eax, esp
mov dword [esp + 0x269c], eax
mov eax, dword [esp + 0x26a8]
push ebx
push ebp
push esi
push edi
lea edi, [esp + 0x22a0]
mov dword [esp + 0x18], eax
mov dword [esp + 0x20], ecx
call fcn.0040b1b0
push 0x44
xor ebx, ebx
lea edx, [esp + 0x54]
push ebx
push edx
call fcn.004858b0
push 0x206
lea edx, [esp + 0x20aa]
mov eax, 5
xor ecx, ecx
push ebx
push edx
mov word [esp + 0x98], ax
mov dword [esp + 0x70], 0x4a9aec
mov dword [esp + 0x68], 0x44
xor edi, edi
mov word [esp + 0x20b0], cx
call fcn.004858b0
add esp, 0x18
push 0x104
lea ecx, [esp + 0x24a4]
lea eax, [esp + 0x130]
push ecx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x18], ebx
mov ebp, 0x94
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x4a9b14
lea edx, [esp + 0x24a4]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [esp + 0x24a0]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
cmp esi, ebx
je 0x40b33e
push str.WinStationQueryInformationW
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
je 0x40b329
lea ecx, [esp + 0x4c]
push ecx
mov ecx, dword [esp + 0x26b8]
push 0x208
lea edx, [esp + 0x20a0]
push edx
push 0x21
push ecx
push ebx
call eax
movzx edi, al
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp edi, ebx
je 0x40b33e
cmp word [esp + 0x2098], bx
jne 0x40b35a
mov edx, dword [esp + 0x26b4]
push edx
push str..PipeTerminalServerSystemExecSrvr_d
lea edx, [esp + 0x20a0]
call fcn.0040b190
add esp, 8
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
push ebx
push 3
push ebx
push ebx
push 0xc0000000
lea eax, [esp + 0x20b0]
push eax
call esi
mov dword [esp + 0x24], eax
cmp eax, 0xffffffff
jne 0x40b3ab
call edi
cmp eax, 0xe7
jne 0x40b3a4
push 0x7530
lea ecx, [esp + 0x209c]
push ecx
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeW]
test eax, eax
jne 0x40b366
xor eax, eax
jmp 0x40b6a6
push 0x94
lea edx, [esp + 0x9c]
push ebx
push edx
call fcn.004858b0
mov eax, dword [esp + 0x26c8]
add esp, 0xc
mov dword [esp + 0xc8], ebx
mov dword [esp + 0xa0], 1
mov dword [esp + 0xcc], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x9c], eax
lea eax, [esp + 0x22a0]
mov dword [esp + 0xa4], ecx
mov dword [esp + 0xa8], ebx
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40b410
sub eax, edx
sar eax, 1
lea esi, [eax + eax + 2]
lea edi, [esi + 0x94]
cmp edi, 0x2000
jbe 0x40b435
xor eax, eax
jmp 0x40b460
push esi
lea edx, [esp + 0x22a4]
push edx
lea eax, [esp + 0x134]
push eax
call fcn.0047d270
lea ecx, [esp + esi + 0x138]
add esp, 0xc
mov ebp, edi
mov dword [esp + 0x14], ecx
mov eax, 0x94
mov dword [esp + 0xac], eax
mov ecx, 0x11
lea esi, [esp + 0x50]
lea edi, [esp + 0xd8]
mov eax, 0x4a9aec
rep movsd dword es:[edi], dword [esi]
mov ebx, ebp
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40b483
sub eax, edx
sar eax, 1
lea esi, [eax + eax + 2]
lea edi, [esi + ebp]
cmp edi, 0x2000
jbe 0x40b4a5
xor eax, eax
jmp 0x40b4c0
mov edx, dword [esp + 0x14]
push esi
push 0x4a9aec
push edx
call fcn.0047d270
add esp, 0xc
add dword [esp + 0x14], esi
mov ebp, edi
mov eax, ebx
mov edx, dword [esp + 0xe4]
mov dword [esp + 0xe0], eax
mov dword [esp + 0x18], ebp
test edx, edx
jne 0x40b4da
xor eax, eax
jmp 0x40b51d
mov eax, edx
lea esi, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40b4e0
sub eax, esi
sar eax, 1
lea esi, [eax + eax + 2]
lea edi, [esi + ebp]
cmp edi, 0x2000
jbe 0x40b502
xor eax, eax
jmp 0x40b51d
mov ebx, dword [esp + 0x14]
push esi
push edx
push ebx
call fcn.0047d270
mov eax, dword [esp + 0x24]
add esp, 0xc
add ebx, esi
mov ebp, edi
mov dword [esp + 0x14], ebx
mov edx, dword [esp + 0x20]
xor edi, edi
mov dword [esp + 0xe4], eax
cmp edx, edi
je 0x40b5d1
test dword [esp + 0x26bc], 0x400
je 0x40b576
cmp ebp, 0x2000
ja 0x40b5a8
mov ecx, dword [esp + 0x10]
mov eax, ecx
shr eax, 1
cmp word [edx + eax*2], di
lea eax, [edx + eax*2]
jne 0x40b55e
cmp word [eax + 2], di
je 0x40b571
add ecx, 2
lea eax, [ecx + ebp]
mov dword [esp + 0x10], ecx
cmp eax, 0x2000
jbe 0x40b547
jmp 0x40b5ac
add ecx, 4
jmp 0x40b5ac
cmp ebp, 0x2000
ja 0x40b5a8
mov ecx, edx
mov eax, ebp
sub ecx, ebp
cmp byte [ecx + eax], 0
jne 0x40b595
mov esi, dword [esp + 0x10]
cmp byte [edx + esi + 1], 0
je 0x40b5a3
inc dword [esp + 0x10]
inc eax
cmp eax, 0x2000
jbe 0x40b584
jmp 0x40b5a8
add dword [esp + 0x10], 2
mov ecx, dword [esp + 0x10]
lea esi, [ecx + ebp]
cmp esi, 0x2000
ja 0x40b5d1
push ecx
mov ecx, dword [esp + 0x18]
push edx
push ecx
call fcn.0047d270
mov dword [esp + 0xdc], ebp
add esp, 0xc
mov ebp, esi
jmp 0x40b5d8
mov dword [esp + 0xd0], edi
push edi
mov edi, dword [esp + 0x28]
lea edx, [esp + 0x48]
push edx
push ebp
lea eax, [esp + 0xa4]
push eax
push edi
mov dword [esp + 0xac], ebp
xor esi, esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
test eax, eax
je 0x40b679
push 0xfa
call ebx
push esi
lea ecx, [esp + 0x4c]
push ecx
push 0x1c
lea edx, [esp + 0x34]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40b681
mov eax, dword [esp + 0x3c]
push eax
push esi
push 0x1f0fff
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x1c], eax
test eax, eax
je 0x40b66c
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x3c]
mov dword [0x4d9b14], ecx
mov ecx, dword [esp + 0x40]
mov dword [0x4d9b18], edx
mov dword [0x4d9b1c], eax
mov dword [0x4d9b20], ecx
jmp 0x40b681
mov edx, dword [esp + 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40b681
mov dword [esp + 0x1c], 0
cmp dword [0x4d9b14], 0
jne 0x40b69b
mov dword [0x4d9b14], esi
test esi, esi
jne 0x40b69b
push 0x1388
call ebx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x26ac]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0047c3ff
add esp, 0x26a0
ret