Function at 0x4059d0
Capabilities:
Print debug messages
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x4333aa
push eax
mov eax, 0x2b30
mov dword fs:[0], esp
call fcn.00415e60
push ebx
push ebp
push esi
push edi
mov esi, ecx
mov ecx, dword [esp + 0x2b54]
xor ebx, ebx
push 0x442df8
mov dword [esp + 0x2b4c], ebx
call fcn.0042be02
mov ebp, dword [esp + 0x2b58]
push 0x442df8
mov ecx, ebp
call fcn.0042be02
push 0x442df8
lea ecx, [esp + 0x18]
call fcn.0042bce7
lea ecx, [esp + 0x10]
mov byte [esp + 0x2b48], 1
call fcn.00404a10
mov al, byte [esi + 4]
mov byte [esp + 0x2b48], 2
cmp al, bl
jne 0x405a81
push 0x440778
mov ecx, ebp
call fcn.0042be02
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push str.EcpComm
call fcn.0042bce7
push ecx
mov byte [esp + 0x2b50], 3
mov ecx, esp
mov dword [esp + 0x20], esp
jmp 0x405c25
mov eax, dword [esp + 0x2b50]
lea ecx, [esp + 0x14]
push eax
push str.D_ECP__send:_s
push ecx
call fcn.00426e17
mov edx, dword [esp + 0x20]
add esp, 0xc
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov ecx, 0xfa
xor eax, eax
lea edi, [esp + 0x48]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x2b50]
mov ecx, dword [eax - 8]
push ecx
lea ecx, [esp + 0x4c]
push ecx
push eax
mov ecx, esi
call fcn.00405d50
mov edx, dword [esp + 0x2b50]
lea ecx, [esp + 0x2c]
mov eax, dword [edx - 8]
cdq
sub eax, edx
mov edx, dword [esi]
sar eax, 1
mov dword [esp + 0x24], eax
lea eax, [esp + 0x3c]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x24]
push ebx
push eax
mov eax, dword [esi]
lea edx, [esp + 0x50]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, ebx
jne 0x405b3f
push 0x440754
mov ecx, ebp
call fcn.0042be02
push ecx
mov ecx, esp
mov dword [esp + 0x1c], esp
push str.EcpComm
call fcn.0042bce7
push ecx
mov byte [esp + 0x2b50], 4
mov ecx, esp
mov dword [esp + 0x24], esp
jmp 0x405c25
xor edi, edi
push 0xc8
call dword [sym.imp.KERNEL32.dll_Sleep]
inc edi
cmp edi, 0x32
jg 0x405b82
mov eax, dword [esi]
lea ecx, [esp + 0x30]
lea edx, [esp + 0x28]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x405b6f
cmp dword [esp + 0x28], ebx
ja 0x405b77
cmp dword [esp + 0x34], ebx
jne 0x405bb0
jmp 0x405b41
mov ecx, dword [esi]
push 0xa
push ecx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
push 0x440740
mov ecx, ebp
call fcn.0042be02
push ecx
mov ecx, esp
mov dword [esp + 0x1c], esp
push str.EcpComm
call fcn.0042bce7
push ecx
mov byte [esp + 0x2b50], 5
mov ecx, esp
mov dword [esp + 0x24], esp
jmp 0x405c25
mov ecx, 0x4e2
xor eax, eax
lea edi, [esp + 0x17b8]
lea edx, [esp + 0x20]
rep stosd dword es:[edi], eax
mov ecx, dword [esi]
push ebx
push edx
lea eax, [esp + 0x17c0]
push 0x1388
push eax
push ecx
mov dword [esp + 0x34], 0x1388
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [esi]
push 0xf
push edx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
cmp edi, ebx
jne 0x405c7c
push 0x44072c
mov ecx, ebp
call fcn.0042be02
push ecx
mov ecx, esp
mov dword [esp + 0x1c], esp
push str.EcpComm
call fcn.0042bce7
push ecx
mov byte [esp + 0x2b50], 6
mov ecx, esp
mov dword [esp + 0x24], esp
push ebp
call fcn.0042b9ee
lea ecx, [esp + 0x18]
mov byte [esp + 0x2b50], 2
call fcn.00404a30
lea ecx, [esp + 0x10]
mov byte [esp + 0x2b48], 1
call fcn.00404a20
lea ecx, [esp + 0x14]
mov byte [esp + 0x2b48], bl
call fcn.0042bc79
lea ecx, [esp + 0x2b50]
mov dword [esp + 0x2b48], 0xffffffff
call fcn.0042bc79
or eax, 0xffffffff
jmp 0x405d2e
mov ecx, 0x4e1
xor eax, eax
lea edi, [esp + 0x431]
mov byte [esp + 0x430], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x17b8]
push eax
lea edx, [esp + 0x434]
push ecx
push edx
mov ecx, esi
call fcn.00405dc0
lea eax, [esp + 0x430]
lea ecx, [esp + 0x14]
push eax
push str.D_ECP_resp:_s
push ecx
call fcn.00426e17
mov edx, dword [esp + 0x20]
add esp, 0xc
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov ecx, dword [esp + 0x2b54]
lea eax, [esp + 0x430]
push eax
push 0x4401cc
push ecx
call fcn.00426e17
add esp, 0xc
lea ecx, [esp + 0x10]
mov byte [esp + 0x2b48], 1
call fcn.00404a20
lea ecx, [esp + 0x14]
mov byte [esp + 0x2b48], bl
call fcn.0042bc79
lea ecx, [esp + 0x2b50]
mov dword [esp + 0x2b48], 0xffffffff
call fcn.0042bc79
xor eax, eax
mov ecx, dword [esp + 0x2b40]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x2b3c
ret 0xc