Function at 0x4040c0
Capabilities:
Connect pipe
Create pipe
Get common file path
Read file on windows
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x407548
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x544
push ebx
push esi
push edi
xor edi, edi
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x38], edi
call sub.MFC42.DLL_CString::CString_2
push edi
push str._NT_
mov dword [ebp - 4], edi
call fcn.00406af0
push 0x1d4c0
push edi
push 2
call fcn.00403520
add esp, 0x14
test eax, eax
jne 0x404134
push 1
push 0x40b9ec
call fcn.00406af0
add esp, 8
jmp 0x404634
call fcn.00404810
test eax, eax
push edi
jne 0x404178
push 0x40b9d8
call fcn.00406af0
push 0xbb8
push 0x42a
push 0x20
call fcn.00403520
add esp, 0x14
test eax, eax
jne 0x404634
push 1
push 0x40b998
call fcn.00406af0
add esp, 8
jmp 0x404634
push 0x40b984
call fcn.00406af0
push 0xbb8
push edi
push 2
call fcn.00403520
add esp, 0x14
test eax, eax
jne 0x4041aa
push 1
push 0x40b954
call fcn.00406af0
add esp, 8
jmp 0x404634
call fcn.00403da0
test eax, eax
push edi
jne 0x4041ee
push 0x40b940
call fcn.00406af0
push 0xbb8
push 0x42a
push 0x20
call fcn.00403520
add esp, 0x14
test eax, eax
jne 0x404634
push 1
push 0x40b900
call fcn.00406af0
add esp, 8
jmp 0x404634
push 0x40b8f0
call fcn.00406af0
push 0xbb8
push edi
push 2
call fcn.00403520
add esp, 0x14
test eax, eax
jne 0x404220
push 1
push 0x40b8c0
call fcn.00406af0
add esp, 8
jmp 0x404634
push edi
push 0x40b8a0
call fcn.00406af0
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventA]
add esp, 8
push edi
push edi
push 1
push edi
call esi
cmp eax, edi
mov dword [0x40ca58], eax
jne 0x404258
push 1
push 0x40b88c
call fcn.00406af0
add esp, 8
jmp 0x404634
push eax
lea eax, [ebp - 0x20]
push 0x40b868
push eax
call sub.MFC42.DLL_CString::Format
mov ecx, dword [ebp - 0x20]
push edi
push ecx
call fcn.00406af0
mov edx, dword [0x40ca58]
push 0xbb8
push edi
push 2
mov dword [ebp - 0x18], edx
call fcn.00403520
add esp, 0x20
test eax, eax
jne 0x4042a2
push 1
push 0x40b838
call fcn.00406af0
add esp, 8
jmp 0x404634
push edi
push 0x40b824
call fcn.00406af0
add esp, 8
push edi
push edi
push 1
push edi
call esi
cmp eax, edi
mov dword [ebp - 0x14], eax
jne 0x4042d2
push 1
push 0x40b88c
call fcn.00406af0
add esp, 8
jmp 0x404634
push eax
lea eax, [ebp - 0x20]
push 0x40b868
push eax
call sub.MFC42.DLL_CString::Format
mov ecx, dword [ebp - 0x20]
push edi
push ecx
call fcn.00406af0
push 0xbb8
push edi
push 2
call fcn.00403520
add esp, 0x20
test eax, eax
jne 0x404313
push 1
push 0x40b7f4
call fcn.00406af0
add esp, 8
jmp 0x404634
push 0x14
push edi
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
push 1
cmp esi, edi
mov dword [ebp - 0x38], esi
jne 0x404339
push 0x40b7cc
call fcn.00406af0
add esp, 8
jmp 0x404634
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x404358
push 1
push 0x40b7b0
call fcn.00406af0
add esp, 8
jmp 0x404634
push edi
push edi
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
jne 0x40437b
push 1
push 0x40b798
call fcn.00406af0
add esp, 8
jmp 0x404634
push 0xbb8
push edi
push 2
mov dword [ebp - 0x48], 0xc
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x40], 1
call fcn.00403520
add esp, 0xc
test eax, eax
jne 0x4043b4
push 1
push 0x40b768
call fcn.00406af0
add esp, 8
jmp 0x404634
push edi
push 0x40b750
call fcn.00406af0
add esp, 8
lea edx, [ebp - 0x48]
push edx
push 0x3e8
push edi
push edi
push 1
push 6
push 0x40000003
push str..pipeUFNet
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeA]
cmp eax, 0xffffffff
mov dword [ebp - 0x1c], eax
push edi
jne 0x4043fc
push 0x40b728
call fcn.00406af0
add esp, 8
jmp 0x404634
push 0x40b710
call fcn.00406af0
push edi
push edi
push 4
call fcn.00403520
add esp, 0x14
test eax, eax
jne 0x40442a
push 1
push 0x40b6e8
call fcn.00406af0
add esp, 8
jmp 0x404634
push edi
push str._NT_U8
call fcn.00406af0
add esp, 8
call fcn.00406040
mov ecx, 0x40c9d8
call fcn.00402eb0
mov ecx, 0x41
xor eax, eax
lea edi, [ebp - 0x150]
push 0x104
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x150]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea ecx, [ebp - 0x150]
push str.U8Service.ini
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea edx, [ebp - 0x150]
mov ecx, 0x40c9d8
push edx
call fcn.00402a10
push 1
mov ecx, 0x40c9d8
call fcn.00402a80
mov esi, dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
xor eax, eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x14]
push eax
mov dword [ebp - 0x24], eax
call esi
mov edi, dword [ebp - 0x1c]
lea ecx, [ebp - 0x34]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x4044ed
push 0xffffffffffffffff
lea edx, [ebp - 0x18]
push 0
push edx
push 2
call ebx
cmp eax, 1
jne 0x404632
xor eax, eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x14]
push eax
mov dword [ebp - 0x24], eax
call esi
push 0
push 0x40b6b4
call fcn.00406af0
add esp, 8
lea ecx, [ebp - 0x34]
lea edx, [ebp - 0x4c]
lea eax, [ebp - 0x550]
push ecx
push edx
push 0x200
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x404557
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x404557
push 0xffffffffffffffff
lea ecx, [ebp - 0x18]
push 0
push ecx
push 2
call ebx
cmp eax, 1
jne 0x404632
mov ecx, 0x80
xor eax, eax
lea edi, [ebp - 0x350]
lea edx, [ebp - 0x350]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x550]
push edx
push eax
mov byte [ebp - 0x550], 0
call fcn.00405460
xor ecx, ecx
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x34], ecx
add esp, 8
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x2c], ecx
push eax
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x24], eax
call esi
lea edi, [ebp - 0x350]
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp - 0x34]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [ebp - 0x3c]
push edx
mov dword [ebp - 0x3c], ecx
push eax
lea edi, [ebp - 0x350]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov edx, dword [ebp - 0x1c]
not ecx
dec ecx
push ecx
lea ecx, [ebp - 0x350]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4045fc
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x4045fc
push 0xffffffffffffffff
lea eax, [ebp - 0x18]
push 0
push eax
push 2
call ebx
cmp eax, 1
jne 0x404632
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
test eax, eax
je 0x40461e
push 0
push 0x40b6a0
call fcn.00406af0
add esp, 8
jmp 0x4044a3
push 1
push 0x40b68c
call fcn.00406af0
add esp, 8
jmp 0x4044a3
xor edi, edi
mov byte [ebp - 4], 1
call fcn.00403fe0
call fcn.00404d10
call fcn.004049a0
push edi
push 0x457
push 0x20
call fcn.00403520
add esp, 0xc
jmp 0x404670
mov esi, dword [ebp - 0x1c]
mov dword [ebp - 4], edi
cmp esi, 0xffffffff
je 0x404694
push edi
push 0x40b670
call fcn.00406af0
add esp, 8
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
jmp 0x40469a
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x40ca58], edi
je 0x4046b9
push edi
push 0x40b654
call fcn.00406af0
mov edx, dword [0x40ca58]
add esp, 8
push edx
call esi
cmp dword [ebp - 0x14], edi
je 0x4046d2
push edi
push 0x40b640
call fcn.00406af0
mov eax, dword [ebp - 0x14]
add esp, 8
push eax
call esi
mov eax, dword [ebp - 0x38]
cmp eax, edi
je 0x4046e0
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
lea ecx, [ebp - 0x20]
mov dword [ebp - 4], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret