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

Disassembly:
mov eax, 0x1038
call fcn.0040e3a0
mov eax, dword [0x421e94]
xor eax, esp
mov dword [esp + 0x1034], eax
mov eax, dword [esp + 0x1044]
push ebx
push ebp
mov ebp, dword [esp + 0x1044]
push esi
push edi
mov edi, dword [esp + 0x1050]
mov dword [esp + 0x40], eax
xor eax, eax
cmp byte [0x423d1b], 1
mov ebx, ecx
mov esi, edx
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
jb 0x405b39
mov ecx, dword [ebp]
push ecx
push str.HeciSendAndReceiveWin
push str.Func:__s___is_going_to_send___d__bytes_of_request:_n_n
call fcn.0040efe0
xor edi, edi
add esp, 0xc
cmp dword [ebp], edi
jbe 0x405b28
lea ecx, [ecx]
movzx edx, byte [esi + edi]
push edx
push str._02x
call fcn.0040efe0
inc edi
add esp, 8
cmp edi, dword [ebp]
jb 0x405b10
push 0x41dc58
call fcn.0040efe0
mov edi, dword [esp + 0x14]
add esp, 4
test edi, edi
je 0x405b98
push 0
push 0
push 0
push 0
mov dword [esp + 0x20], 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esp + 0x28], eax
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x14]
push ecx
push 0x1000
lea edx, [esp + 0x50]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405b98
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x405b98
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0x20000000
jmp 0x405d7a
xor eax, eax
push eax
push eax
push eax
push eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x18]
push edx
mov dword [esp + 0x44], eax
mov eax, dword [ebp]
push eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x405be3
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x405bfd
mov eax, dword [esp + 0x3c]
push 0x1388
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x405c1b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
mov edx, dword [esp + 0x3c]
push edx
call esi
mov eax, 0x20000006
jmp 0x405d7a
mov esi, dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
push 1
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x34]
push ecx
push ebx
call esi
test eax, eax
jne 0x405c58
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call esi
mov eax, dword [esp + 0x3c]
push eax
call esi
mov eax, 0x20000006
jmp 0x405d7a
mov ecx, dword [esp + 0x14]
mov dword [ebp], ecx
test edi, edi
je 0x405d64
mov edx, dword [esp + 0x28]
push 0x1388
push edx
mov dword [esp + 0x18], 0
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x405ca7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
mov ecx, dword [esp + 0x3c]
push ecx
call esi
mov eax, 0x20000005
jmp 0x405d7a
push 1
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x20]
push eax
push ebx
call esi
test eax, eax
jne 0x405cde
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
mov edx, dword [esp + 0x3c]
push edx
call esi
mov eax, 0x20000005
jmp 0x405d7a
mov esi, dword [esp + 0x10]
mov ebx, dword [esp + 0x40]
cmp esi, dword [ebx]
jbe 0x405d05
mov eax, dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
mov ecx, dword [esp + 0x3c]
push ecx
call esi
mov eax, 0x20000004
jmp 0x405d7a
push esi
lea edx, [esp + 0x48]
push edx
push edi
call fcn.00411790
add esp, 0xc
cmp byte [0x423d1b], 1
mov dword [ebx], esi
jb 0x405d64
push esi
push str.HeciSendAndReceiveWin
push str.Func:__s___received___d__bytes_of_response:_n_n
call fcn.0040efe0
xor esi, esi
add esp, 0xc
cmp dword [ebx], esi
jbe 0x405d57
jmp 0x405d40
movzx eax, byte [edi + esi]
push eax
push str._02x
call fcn.0040efe0
inc esi
add esp, 8
cmp esi, dword [ebx]
jb 0x405d40
push 0x41dc58
call fcn.0040efe0
add esp, 4
mov ecx, dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
mov edx, dword [esp + 0x3c]
push edx
call esi
xor eax, eax
mov ecx, dword [esp + 0x1044]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040dd76
add esp, 0x1038
ret