Function at 0x402a90
Capabilities:
Connect pipe
Create pipe
Get session user name
Impersonate user
Read file on windows
Write file on windows
Write pipe

Disassembly:
sub esp, 0xa74
push ebx
push ebp
push edi
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x15c]
rep stosd dword es:[edi], eax
mov ecx, 0x41
lea edi, [esp + 0x260]
rep stosd dword es:[edi], eax
xor ecx, ecx
mov edx, dword [esp + 0xa88]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x40], eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x44], eax
mov dword [esp + 0x34], ecx
mov dword [esp + 0x48], eax
mov dword [esp + 0x38], ecx
mov ecx, 0x41
lea edi, [esp + 0x364]
xor ebp, ebp
rep stosd dword es:[edi], eax
push edx
mov ecx, 0x82
lea edi, [esp + 0x46c]
push ebp
push 0x1000
push 0x1000
rep stosd dword es:[edi], eax
push 0xff
mov ecx, 0x82
lea edi, [esp + 0x88c]
push ebp
push 1
push 0x40e7c8
rep stosd dword es:[edi], eax
mov dword [esp + 0x38], ebp
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x34], ebp
mov dword [esp + 0x40], ebp
mov dword [esp + 0x30], ebp
mov dword [esp + 0x44], ebp
mov dword [esp + 0x6c], eax
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x1c], ebx
jne 0x402b62
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0xa74
ret
push esi
push str.Main_Pipe___Waiting_for_connection...__n
call fcn.004057a0
add esp, 4
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
cmp dword [0x411b88], ebp
jne 0x40301d
push str.Main_Pipe___Client_attempting_to_connected__n
call fcn.004057a0
mov esi, dword [sym.imp.KERNEL32.dll_SetLastError]
add esp, 4
push ebp
call esi
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x5c]
push ebp
rep stosd dword es:[edi], eax
lea eax, [esp + 0x58]
lea ecx, [esp + 0x60]
push eax
push 0x104
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x402bd4
push str.Main_Pipe___Unknown_Client__n
call fcn.004057a0
add esp, 4
jmp 0x40301d
mov edx, dword [esp + 0x54]
lea eax, [esp + 0x5c]
push 0x40e9a4
push eax
mov byte [esp + edx + 0x64], 0
call fcn.00405720
add esp, 8
test eax, eax
je 0x402c09
mov ecx, dword [esp + 0xa88]
mov dword [ecx + 0x690], 1
jmp 0x402dfc
lea edx, [esp + 0x5c]
push str.Console
push edx
call fcn.00405720
add esp, 8
test eax, eax
je 0x402e6c
mov eax, dword [esp + 0xa88]
mov cl, byte [esp + 0x5c]
xor edx, edx
mov dword [eax + 0x690], ebp
lea eax, [esp + 0x5c]
test cl, cl
je 0x402c55
cmp cl, 0x3a
je 0x402c55
inc edx
cmp edx, 0xa
jg 0x40301d
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x402c3e
mov cl, byte [eax + 1]
inc eax
xor esi, esi
lea edx, [esp + 0x160]
test cl, cl
je 0x402c83
cmp cl, 0x3a
je 0x402c83
inc esi
cmp esi, 0x103
jg 0x40301d
mov byte [edx], cl
mov cl, byte [eax + 1]
inc edx
inc eax
test cl, cl
jne 0x402c66
mov cl, byte [eax + 1]
inc eax
xor esi, esi
mov byte [edx], 0
test cl, cl
lea edx, [esp + 0x264]
je 0x402cb4
cmp cl, 0x3a
je 0x402cb4
inc esi
cmp esi, 0x103
jg 0x40301d
mov byte [edx], cl
mov cl, byte [eax + 1]
inc edx
inc eax
test cl, cl
jne 0x402c97
mov cl, byte [eax + 1]
inc eax
xor esi, esi
mov byte [edx], 0
test cl, cl
lea edx, [esp + 0x40]
je 0x402cdf
cmp cl, 0x3a
je 0x402cdf
inc esi
cmp esi, 0x13
jg 0x40301d
mov byte [edx], cl
mov cl, byte [eax + 1]
inc edx
inc eax
test cl, cl
jne 0x402cc5
mov cl, byte [eax + 1]
inc eax
xor esi, esi
mov byte [edx], 0
test cl, cl
lea edx, [esp + 0x2c]
je 0x402d0a
cmp cl, 0x3a
je 0x402d0a
inc esi
cmp esi, 0x13
jg 0x40301d
mov byte [edx], cl
mov cl, byte [eax + 1]
inc edx
inc eax
test cl, cl
jne 0x402cf0
mov cl, byte [eax + 1]
inc eax
xor esi, esi
mov byte [edx], 0
test cl, cl
lea edx, [esp + 0x674]
je 0x402d3b
cmp cl, 0x3a
je 0x402d3b
inc esi
cmp esi, 0x103
jg 0x40301d
mov byte [edx], cl
mov cl, byte [eax + 1]
inc edx
inc eax
test cl, cl
jne 0x402d1e
mov cl, byte [eax + 1]
inc eax
xor esi, esi
mov byte [edx], 0
test cl, cl
lea edx, [esp + 0x368]
je 0x402d6c
cmp cl, 0x3a
je 0x402d6c
inc esi
cmp esi, 0x103
jg 0x40301d
mov byte [edx], cl
mov cl, byte [eax + 1]
inc edx
inc eax
test cl, cl
jne 0x402d4f
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ecx, [esp + 0x40]
push ecx
mov byte [edx], 0
call esi
test eax, eax
mov bl, 0x59
jle 0x402d90
cmp byte [esp + 0x40], bl
jne 0x402d90
mov dword [esp + 0x10], 1
lea edx, [esp + 0x2c]
push edx
call esi
test eax, eax
jle 0x402db2
cmp byte [esp + 0x2c], bl
jne 0x402db2
mov eax, dword [esp + 0xa88]
mov dword [eax + 0x694], 1
lea ecx, [esp + 0x160]
push ecx
call esi
test eax, eax
jle 0x402df2
mov edx, dword [esp + 0xa88]
lea eax, [esp + 0x160]
push 0x202
push eax
lea esi, [edx + 0x698]
push esi
call fcn.0040561b
add esp, 0xc
lea ecx, [esp + 0x46c]
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov esi, dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [esp + 0x20]
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x5c]
rep stosd dword es:[edi], eax
cmp dword [esp + 0x10], ebp
je 0x402e82
lea eax, [esp + 0x24]
lea ecx, [esp + 0x264]
push eax
push ebp
push 2
push ecx
lea edx, [esp + 0x170]
push ebp
push edx
call dword [sym.imp.ADVAPI32.dll_LogonUserA]
test eax, eax
je 0x402e41
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
jne 0x402e5a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x2c], eax
call esi
mov dword [esp + 0x18], 1
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x264]
rep stosd dword es:[edi], eax
jmp 0x402ebf
mov edx, dword [esp + 0xa88]
mov dword [edx + 0x690], 1
jmp 0x402dfc
push ebx
call dword [sym.imp.ADVAPI32.dll_ImpersonateNamedPipeClient]
test eax, eax
jne 0x402ea4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esp + 0x18], eax
call esi
mov dword [esp + 0x18], 1
jmp 0x402ebf
lea ecx, [esp + 0x10]
lea edx, [esp + 0x46c]
push ecx
push edx
mov dword [esp + 0x18], 0x208
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
lea eax, [esp + 0x368]
push 0x208
lea ecx, [esp + 0x880]
push eax
push ecx
call fcn.0040561b
mov ebx, dword [esp + 0x24]
add esp, 0xc
cmp ebx, ebp
jne 0x402f16
lea edx, [esp + 0x87c]
lea eax, [esp + 0x46c]
push edx
push eax
lea ecx, [esp + 0x67c]
push str._r_nThe_following_user_has_connected_via_remote_console._r_nUser:__s_r_nFrom:__s
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
lea edx, [esp + 0x684]
push edx
call fcn.00403bd0
jmp 0x402f46
lea eax, [esp + 0x87c]
lea ecx, [esp + 0x46c]
push eax
push ecx
lea edx, [esp + 0x67c]
push str._r_nThe_following_user_attempted_to_connected_via_remote_console._r_nUser:__s_r_nFrom:__s
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [esp + 0x684]
push eax
call fcn.00403b40
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x174]
add esp, 0x14
rep stosd dword es:[edi], eax
mov ecx, 0x41
lea edi, [esp + 0x264]
rep stosd dword es:[edi], eax
xor ecx, ecx
lea edi, [esp + 0x368]
mov dword [esp + 0x40], ecx
xor edx, edx
mov dword [esp + 0x44], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x30], edx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x34], edx
mov dword [esp + 0x50], ecx
mov ecx, 0x41
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0xa90]
mov dword [esp + 0x38], edx
push eax
push ebp
push 0x1000
push 0x1000
push 0xff
push ebp
push 2
push str..pipeDNTU26Out
mov dword [esp + 0x5c], edx
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x1c], esi
jne 0x402fd8
mov dword [esp + 0x1c], ebp
jmp 0x40301d
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
push str.Client_connected__n
call fcn.004057a0
mov ecx, dword [esp + 0xa98]
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0xa9c]
add esp, 4
mov dword [ecx], edx
mov ecx, dword [esp + 0xa9c]
mov edx, dword [esp + 0x24]
mov dword [eax], esi
cmp ebx, ebp
mov dword [ecx], edx
mov eax, 1
je 0x4030f8
mov eax, dword [esp + 0x1c]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, 0xffffffff
mov dword [esp + 0x10], ebp
je 0x4030e7
push 0x208
call fcn.004054ad
push 0x208
mov esi, eax
call fcn.004054ad
mov ebp, eax
mov ecx, 0x82
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, 0x82
mov edi, ebp
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x20]
add esp, 8
test eax, eax
je 0x403072
mov eax, dword [esp + 0x28]
push eax
jmp 0x403077
mov ecx, dword [esp + 0x14]
push ecx
push 4
push ebp
call fcn.00403220
mov edx, dword [esp + 0x20]
add esp, 0xc
push ebp
push edx
push str._nError:__d_n_s_n
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edx, dword [esp + 0xa88]
lea ecx, [esp + 0x58]
push 0
push ecx
push eax
mov eax, dword [edx + 0x660]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0xfa
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0x1c]
push ecx
call ebx
test esi, esi
je 0x4030da
push esi
call fcn.00405444
add esp, 4
test ebp, ebp
je 0x4030e7
push ebp
call fcn.00405444
add esp, 4
mov edx, dword [esp + 0x20]
push edx
call ebx
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov eax, dword [esp + 0x10]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0xa74
ret