Function at 0x4f9a20
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, edx
push ebx
sub esp, 0x58
mov dword [ebp - 0x40], eax
mov eax, dword [0x57fce8]
cmp eax, 1
jle 0x4f9a53
mov eax, 0x55b
call fcn.004f6080
mov dword [esp], str.exerciseServer_starting_n
call fcn.004f61b0
mov eax, dword [0x57fce8]
mov dword [ebp - 0x44], 8
lea edi, [ebp - 0x2c]
mov dword [ebp - 0x48], esi
mov ecx, dword fs:[0x18]
xor esi, esi
mov dword [ebp - 0x38], ecx
cmp eax, 1
jle 0x4f9a8f
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x566
mov dword [esp], str.Client_connecting..._n
call fcn.004f61b0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0xc0000000
mov eax, dword [ebp - 0x40]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileA]
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
jne 0x4f9df8
mov eax, dword [ebp - 0x38]
mov edx, dword [eax + 0x34]
mov dword [ebp - 0x3c], edx
test esi, esi
je 0x4f9b80
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x570
xor eax, eax
mov dword [esp + 4], str.connecting_to_pipe_n
mov edx, dword [ebp - 0x3c]
cmp edx, 0xe7
sete al
mov dword [esp], eax
call fcn.004f6800
cmp dword [0x57fce8], 1
jg 0x4f9b58
mov dword [esp], 0xc8
add esi, 1
call dword [sym.imp.kernel32.dll_Sleep]
sub esp, 4
cmp esi, 3
je 0x4f9be0
mov eax, dword [0x57fce8]
cmp eax, 1
jle 0x4f9a8f
jmp 0x4f9a71
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x571
mov dword [esp], str.connect_failed__retrying_n
call fcn.004f61b0
jmp 0x4f9b23
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x56e
mov dword [esp + 4], str.connecting_to_pipe_n
mov edx, dword [ebp - 0x3c]
cmp edx, 0xe7
sete al
cmp edx, 2
sete dl
or eax, edx
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
cmp dword [0x57fce8], 1
jg 0x4f9b58
mov dword [esp], 0xc8
mov esi, 1
call dword [sym.imp.kernel32.dll_Sleep]
sub esp, 4
jmp 0x4f9b3f
xor esi, esi
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x574
mov dword [esp + 4], str.client_opening_named_pipe_n
mov dword [esp], esi
call fcn.004f6800
xor eax, eax
mov dword [edi + eax], 0
add eax, 4
cmp eax, 0x20
jb 0x4f9c06
cmp dword [0x57fce8], 1
jle 0x4f9c3c
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x578
mov dword [esp], str.Client_writing..._n
call fcn.004f61b0
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x579
lea eax, [ebp - 0x34]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0xb
mov dword [esp + 4], 0x5ee740
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
mov dword [esp], eax
mov dword [esp + 4], str.WriteFile_to_client_end_of_pipe_n
call fcn.004f6800
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x57a
xor eax, eax
mov dword [esp + 4], str.write_file_len_n
cmp dword [ebp - 0x34], 0xb
sete al
mov dword [esp], eax
call fcn.004f6800
cmp dword [0x57fce8], 1
jle 0x4f9cdb
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x57b
mov dword [esp], str.Client_reading..._n
call fcn.004f61b0
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x57c
lea eax, [ebp - 0x30]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0xb
mov dword [esp + 4], edi
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
mov dword [esp], eax
mov dword [esp + 4], str.ReadFile_from_client_end_of_pipe_n
call fcn.004f6800
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x57d
xor eax, eax
mov dword [esp + 4], str.read_file_len_n
cmp dword [ebp - 0x30], 0xb
sete al
mov dword [esp], eax
call fcn.004f6800
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x57e
mov eax, dword [ebp - 0x34]
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov dword [esp], 0x5ee740
call sub.msvcrt.dll_memcmp
mov dword [esp + 4], str.content_check_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
cmp dword [0x57fce8], 1
jle 0x4f9db7
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x580
mov dword [esp], str.Client_closing..._n
call fcn.004f61b0
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x581
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp + 4], str.CloseHandle_n
mov dword [esp], eax
call fcn.004f6800
sub dword [ebp - 0x44], 1
je 0x4f9e08
mov eax, dword [0x57fce8]
jmp 0x4f9a60
mov esi, 1
jmp 0x4f9be2
mov esi, dword [ebp - 0x48]
mov eax, 0x584
call fcn.004f6080
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
sub esp, 8
test eax, eax
sete al
mov dword [esp + 4], str.WaitForSingleObject_n
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, dword [0x57f344]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
cmp dword [0x57fce8], 1
jle 0x4f9e71
mov eax, 0x586
call fcn.004f6080
mov dword [esp], str.exerciseServer_returning_n
call fcn.004f61b0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret