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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x430c6c
mov eax, dword fs:[0]
push eax
sub esp, 0x1c0
mov eax, dword [0x43efc0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x14]
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0x10]
mov esi, ecx
mov ecx, dword [esi + 4]
mov dword [ebp - 0x44], eax
xor eax, eax
mov dword [ebp - 0x4c], eax
cmp ecx, 0xffffffff
jne 0x4156f1
lea ecx, [ebp - 0x44]
push ecx
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x44], str.HECI_not_connected
call fcn.0041b882
push 0x43b85c
lea edx, [ebp - 0x6c]
push edx
mov dword [ebp - 0x6c], vtable.std::logic_error.0
call fcn.0041bd40
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x54], eax
mov eax, dword [esi + 0x10]
lea edx, [ebp - 0x60]
push edx
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x50], eax
lea eax, [ebp - 0x4c]
push eax
push edx
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x41574d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x41574d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x434148
lea ecx, [ebp - 0x40]
call fcn.00407d30
push 0x43a84c
lea eax, [ebp - 0x40]
push eax
call fcn.0041bd40
mov ecx, dword [ebp + 0x18]
mov edx, dword [esi + 0x10]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x41578a
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x44], str.HECI_send_timeout
call fcn.0041b882
push 0x439858
lea ecx, [ebp - 0x6c]
push ecx
mov dword [ebp - 0x6c], vtable.std::runtime_error.0
call fcn.0041bd40
test eax, eax
je 0x4157b0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WaitForSingleObject_after_WriteFile
lea ecx, [ebp - 0x40]
call fcn.00407d30
push 0x43a84c
lea edx, [ebp - 0x40]
push edx
call fcn.0041bd40
mov edx, dword [esi + 4]
push 1
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x60]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x4157d9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetOverlappedResult_from_WriteFile
jmp 0x415737
push 1
lea ecx, [ebp - 0x11c]
call fcn.004061b0
mov dword [eax + 0x60], 0x64
mov ecx, dword [ebp - 0x4c]
push ecx
add eax, 0x10
push str.Heci::SendMsg_WriteFile_bytesWritten
push eax
mov dword [ebp - 4], 0
call fcn.00404180
add esp, 8
mov ecx, eax
call fcn.004049c0
push eax
call fcn.004055a0
add esp, 4
lea ecx, [ebp - 0xb4]
mov dword [ebp - 4], 0xffffffff
call fcn.0040c330
lea edx, [ebp - 0xb4]
push edx
mov dword [ebp - 0xb4], vtable.std::ios_base.0
call fcn.0041b040
add esp, 4
push 1
lea ecx, [ebp - 0x11c]
call fcn.004061b0
mov ecx, dword [ebp + 0xc]
push ecx
mov dword [eax + 0x60], 0x64
add eax, 0x10
push edi
push eax
mov dword [ebp - 4], 1
call fcn.0040b700
or edi, 0xffffffff
add esp, 0xc
lea ecx, [ebp - 0xb4]
mov dword [ebp - 4], edi
call fcn.0040c330
lea edx, [ebp - 0xb4]
push edx
mov dword [ebp - 0xb4], vtable.std::ios_base.0
call fcn.0041b040
xor eax, eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x54], eax
mov eax, dword [esi + 0x10]
add esp, 4
mov dword [ebp - 0x50], eax
mov eax, dword [esi + 8]
mov dword [ebp - 0x48], 0
test ebx, ebx
je 0x415a2d
cmp dword [ebp - 0x44], 0
je 0x415a2d
lea ecx, [ebp - 0x60]
push ecx
lea edx, [ebp - 0x48]
push edx
push eax
mov eax, dword [esi + 4]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x415914
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x415914
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4340b8
lea ecx, [ebp - 0x40]
call fcn.00407d30
push 0x43a84c
lea ecx, [ebp - 0x40]
push ecx
jmp 0x415748
mov edx, dword [ebp + 0x1c]
mov eax, dword [esi + 0x10]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x415951
lea ecx, [ebp - 0x44]
push ecx
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x44], str.HECI_recv_timeout
call fcn.0041b882
push 0x439858
lea edx, [ebp - 0x6c]
mov dword [ebp - 0x6c], vtable.std::runtime_error.0
push edx
jmp 0x415748
test eax, eax
je 0x415966
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WaitForSingleObject_after_ReadFile
jmp 0x415737
mov eax, dword [esi + 4]
push 1
lea ecx, [ebp - 0x48]
push ecx
lea edx, [ebp - 0x60]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x4159a0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetOverlappedResult_from_ReadFile
lea ecx, [ebp - 0x40]
call fcn.00407d30
push 0x43a84c
lea ecx, [ebp - 0x40]
push ecx
jmp 0x415748
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x44]
push 1
lea ecx, [ebp - 0x11c]
mov dword [eax], edx
call fcn.004061b0
mov esi, 0x64
mov dword [eax + 0x60], esi
mov ecx, dword [ebp - 0x48]
push ecx
add eax, 0x10
push str.Heci::SendMsg_ReadFile_bytesRead
push eax
mov dword [ebp - 4], 2
call fcn.00404180
add esp, 8
mov ecx, eax
call fcn.004049c0
push eax
call fcn.004055a0
add esp, 4
lea ecx, [ebp - 0x11c]
mov dword [ebp - 4], edi
call fcn.00401a10
push 1
lea ecx, [ebp - 0x1cc]
call fcn.004061b0
mov dword [eax + 0x60], esi
mov edx, dword [ebp - 0x48]
push edx
add eax, 0x10
push ebx
push eax
mov dword [ebp - 4], 3
call fcn.0040b700
add esp, 0xc
lea ecx, [ebp - 0x1cc]
mov dword [ebp - 4], edi
call fcn.00401a10
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0041bd31
mov esp, ebp
pop ebp
ret 0x18