Function at 0x4a6e40
Capabilities:
Check if file exists
Read file via mapping
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4f0330
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x541100]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push ecx
mov ecx, dword [ebp + 0xc]
mov eax, esp
mov dword [ebp - 4], 1
mov edx, dword [ebp + 8]
mov dword [ebp - 0x38], esp
push 0xffffffffffffffff
push ecx
push edx
push str.PipeIpcClient__s___d_:_hPipe0x_x
push eax
call fcn.004777e0
add esp, 0x14
call fcn.004a6dd0
mov eax, dword [ebp + 0x18]
push 0x50206c
mov dword [eax], 0xffffffff
call fcn.004ccd1a
mov ecx, dword [ebp + 0x1c]
add esp, 8
push eax
push 0x50206c
call fcn.00423404
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x1c]
push str..pipe_s
push edx
call fcn.004777e0
add esp, 0xc
xor ebx, ebx
push ebx
push ebx
push 3
push ebx
push ebx
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x1c]
push 0x40000000
push eax
xor esi, esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4a6fbb
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
lea esp, [esp]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x4a6f3a
push ecx
mov ecx, esp
mov dword [ebp - 0x38], esp
inc esi
push esi
push str.PipeIpcClient:_CreateFile.NotFoundRetry__d
push ecx
call fcn.004777e0
add esp, 0xc
call fcn.004a6dd0
add esp, 4
push 0x64
call ebx
cmp esi, 6
jl 0x4a6f95
cmp edi, 0xe7
jne 0x4a743b
mov edx, dword [ebp - 0x1c]
push 0xbb8
push edx
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeW]
test eax, eax
jne 0x4a6f95
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 2
jne 0x4a7452
push ecx
mov eax, esp
mov dword [ebp - 0x38], esp
inc esi
push esi
push str.PipeIpcClient:_WaitNamedPipe.NotFoundRetry__d
push eax
call fcn.004777e0
add esp, 0xc
call fcn.004a6dd0
add esp, 4
push 0x64
call ebx
cmp esi, 6
jge 0x4a7452
mov ecx, dword [ebp - 0x1c]
push 0
push 0
push 3
push 0
push 0
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x4a6f00
xor ebx, ebx
push ebx
push ebx
lea edx, [ebp - 0x2c]
push edx
push edi
mov dword [ebp - 0x2c], 2
call dword [sym.imp.KERNEL32.dll_SetNamedPipeHandleState]
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x30], ebx
call fcn.004bdbe3
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x4a6fef
push 0x80004005
call fcn.00420000
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x18], eax
mov ecx, 0x50206c
mov byte [ebp - 4], 3
test ecx, 0xffff0000
jne 0x4a702a
mov edx, ecx
movzx esi, dx
push esi
call fcn.004c5d7f
cmp eax, ebx
je 0x4a7045
push esi
push eax
lea ecx, [ebp - 0x18]
call fcn.00422eb3
jmp 0x4a7045
push 0x50206c
call fcn.004ccd1a
add esp, 4
push eax
push 0x50206c
lea ecx, [ebp - 0x18]
call fcn.00423404
mov byte [ebp - 4], 4
mov dword [ebp - 0x20], ebx
cmp dword [ebp + 0x14], ebx
je 0x4a70ba
call fcn.004d0c1f
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
mov eax, dword [ebp + 8]
push eax
lea ecx, [ebp - 0x28]
push str._s._d._d._x
push ecx
call fcn.004777e0
add esp, 0x18
push eax
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 5
call fcn.00422f41
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x28]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4a70aa
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0x18]
push ecx
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x20], eax
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp + 0xc]
push edx
push eax
push ecx
lea edx, [ebp - 0x14]
push str._d_s_s
push edx
call fcn.004777e0
add esp, 0x14
mov byte [ebp - 4], 6
mov eax, dword [ebp - 0x14]
cmp dword [eax - 4], 1
mov esi, dword [eax - 0xc]
jle 0x4a70f5
mov eax, esi
push eax
lea ecx, [ebp - 0x14]
call fcn.004205a0
mov eax, dword [ebp - 0x14]
push ebx
lea ecx, [ebp - 0x30]
push ecx
lea edx, [esi + esi + 2]
push edx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.004cccfb
add esp, 8
cmp eax, ebx
jl 0x4a7431
mov ecx, dword [ebp - 0x14]
cmp eax, dword [ecx - 8]
jg 0x4a7431
mov dword [ecx - 0xc], eax
mov edx, dword [ebp - 0x14]
xor ecx, ecx
mov word [edx + eax*2], cx
cmp esi, ebx
jne 0x4a71da
mov eax, dword [ebp - 0x20]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, ebx
je 0x4a7151
push eax
call esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov ecx, esp
mov dword [ebp + 0x18], esp
push eax
push str.PipeIpcClient:_WriteFile_hPipe__failed__LE_d
push ecx
call fcn.004777e0
add esp, 0xc
call fcn.004a6dd0
add esp, 4
push 0xffffffffffffffff
call esi
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4a719b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4a71be
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x4a748d
mov esi, dword [ebp - 0x20]
push ecx
mov ecx, esp
cmp esi, ebx
je 0x4a7342
mov dword [ebp - 0x38], esp
push str.PipeIpcClient:_waiting_for_reply
push ecx
call fcn.004777e0
add esp, 8
call fcn.004a6dd0
mov edx, dword [ebp + 0x20]
add esp, 4
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x4a7339
push ecx
mov eax, esp
mov dword [ebp - 0x38], esp
push str.PipeIpcClient:_reply_received
push eax
call fcn.004777e0
add esp, 8
call fcn.004a6dd0
push str..ReplyMap
lea ecx, [ebp - 0x18]
push ecx
lea edx, [ebp - 0x34]
push edx
call fcn.00422a76
mov eax, dword [eax]
add esp, 0x10
push eax
push ebx
push 5
call dword [sym.imp.KERNEL32.dll_OpenFileMappingW]
mov edi, eax
mov eax, dword [ebp - 0x34]
add eax, 0xfffffff0
mov dword [ebp - 0x28], edi
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4a7272
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp edi, ebx
je 0x4a7339
xor eax, eax
push str.NtQuerySection
push str.ntdll.dll
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
lea ecx, [ebp - 0x38]
push ecx
push 0x10
lea edx, [ebp - 0x4c]
push edx
push ebx
push edi
mov dword [ebp - 0x38], ebx
call eax
push ebx
push ebx
push ebx
push 4
push edi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov esi, eax
cmp esi, ebx
je 0x4a732f
push 0x7c
push esi
call fcn.004cdc18
mov edi, eax
sub eax, esi
add esp, 8
sar eax, 1
push eax
push esi
lea ecx, [ebp - 0x24]
call fcn.00456071
mov byte [ebp - 4], 7
mov ebx, dword [ebp - 0x24]
push ebx
call fcn.004cf5e1
mov ecx, dword [ebp + 0x18]
add esp, 4
mov dword [ecx], eax
mov ecx, dword [ebp + 0x1c]
add edi, 2
push edi
call fcn.00424248
push esi
mov dword [ebp - 0x24], 1
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
lea eax, [ebx - 0x10]
mov byte [ebp - 4], 6
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4a732c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [ebp - 0x28]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x20]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4a7362
mov dword [ebp + 0x18], esp
push str._PipeIpcClient:_FAILED_waiting_for_reply
push ecx
call fcn.004777e0
add esp, 8
call fcn.004a6dd0
add esp, 4
mov dword [ebp - 0x24], 1
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4a738d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4a73b0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4a73d3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4a73f6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4a741c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.00420000
push ecx
mov ecx, esp
mov dword [ebp + 0x18], esp
push edi
push str.PipeIpcClient:_error_opening_pipe__Err_d
push ecx
call fcn.004777e0
add esp, 0xc
jmp 0x4a746e
call edi
push ecx
mov ecx, esp
mov dword [ebp + 0x18], esp
push eax
push 0xe7
push str.PipeIpcClient:_failed_waiting_for_pipe__Err_d__WaitNamedPipe.LE_d
push ecx
call fcn.004777e0
add esp, 0x10
call fcn.004a6dd0
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
or ecx, 0xffffffff
lea edx, [eax + 0xc]
add esp, 4
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4a7499
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4a74bc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4a74e2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret