Function at 0x40f6f6
Capabilities:
Check for time delay via gettickcount
Enumerate files on windows
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
lea ebp, [esp - 0x70]
sub esp, 0x178
push ebx
push esi
push edi
mov edi, dword [ebp + 0x7c]
mov esi, eax
mov al, byte [esi + 0x1d]
xor ecx, ecx
add edi, 0x2800
mov dword [ebp + 0x6c], ecx
lea ebx, [esi + 0x168]
cmp al, 0x12
jb 0x40fd84
cmp al, 0x13
jbe 0x40faab
cmp al, 0x14
je 0x40f8cd
mov dl, al
sub dl, 0x15
cmp dl, 1
ja 0x40fd84
cmp al, 0x15
jne 0x40f750
cmp byte [esi + 0x1c], 4
je 0x40f750
push ecx
jmp 0x40f770
push 2
push ebx
call dword [sym.imp.KERNEL32.dll__lopen]
mov dword [ebp + 0x64], eax
cmp eax, 0xffffffff
je 0x40f76e
push 2
push 0
push eax
call dword [sym.imp.KERNEL32.dll__llseek]
jmp 0x40f77a
push 0
push ebx
call dword [sym.imp.KERNEL32.dll__lcreat]
mov dword [ebp + 0x64], eax
cmp dword [ebp + 0x64], 0xffffffff
jne 0x40f78c
mov dword [ebp + 0x6c], 2
jmp 0x40fcf4
push dword [ebp + 0x7c]
push dword [ebp + 0x64]
call fcn.0040f693
test eax, eax
je 0x40fd84
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
mov edi, eax
push 0x21
push edi
push dword [ebp + 0x78]
mov dword [ebp + 0x68], edi
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov eax, dword [0x44600c]
mov dword [ebp + 0x48], edi
mov dword [ebp + 0x4c], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp + 0x58], eax
mov edi, 0x2710
jmp 0x40f85f
push dword [ebp + 0x68]
push dword [ebp + 0x78]
call fcn.004098f4
mov dword [ebp + 0x60], eax
test al, 1
jne 0x40f7ee
test al, 0x20
jne 0x40f8a8
push 0
push 0x2800
push dword [ebp + 0x7c]
push dword [ebp + 0x78]
call dword [sym.imp.WS2_32.dll_recv]
mov ebx, eax
test ebx, ebx
jg 0x40f81d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp + 0x6c], eax
cmp eax, 0x2733
jne 0x40f885
and dword [ebp + 0x6c], 0
jmp 0x40f85f
mov eax, ebx
cdq
add dword [esi + 0x28], eax
adc dword [esi + 0x2c], edx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp + 0x58]
test eax, eax
jle 0x40f848
cdq
push edx
push eax
push 0
push 0x64
push dword [esi + 0x2c]
push dword [esi + 0x28]
call fcn.004016b0
mov dword [esi + 0x34], eax
push ebx
push dword [ebp + 0x7c]
push dword [ebp + 0x64]
call dword [sym.imp.KERNEL32.dll__lwrite]
cmp eax, ebx
jne 0x40f89a
test byte [ebp + 0x60], 0x20
jne 0x40f8a8
push 0
push edi
push 0
lea eax, [ebp + 0x48]
push eax
push 2
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
test eax, eax
je 0x40f7d4
dec eax
neg eax
sbb eax, eax
add eax, 7
mov dword [ebp + 0x6c], eax
jmp 0x40f8a8
push 0x2a7
push eax
push str.FTPs_recv___error__d__line__d_r_n
call fcn.00406c4e
add esp, 0xc
jmp 0x40f8a8
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
add ecx, 4
mov dword [ebp + 0x6c], ecx
push dword [ebp + 0x64]
call dword [sym.imp.KERNEL32.dll__lclose]
push 0
push dword [ebp + 0x68]
push dword [ebp + 0x78]
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
push dword [ebp + 0x68]
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
jmp 0x40fcea
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll__lopen]
mov ebx, eax
mov dword [ebp + 0x64], ebx
cmp ebx, 0xffffffff
jne 0x40f8eb
mov dword [ebp + 0x6c], 1
jmp 0x40fcf4
push ebx
call fcn.00404008
push dword [ebp + 0x7c]
mov dword [ebp + 0x40], eax
push ebx
mov dword [ebp + 0x44], edx
call fcn.0040f693
test eax, eax
je 0x40fd84
push 1
xor edi, edi
push edi
push edi
push ebx
call fcn.00403fd9
mov dword [ebp + 0x50], eax
mov dword [ebp + 0x54], edx
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
mov ebx, eax
push 2
push ebx
push dword [ebp + 0x78]
mov dword [ebp + 0x68], ebx
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov eax, dword [0x44600c]
mov dword [ebp + 0x48], ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp + 0x4c], eax
call ebx
mov dword [ebp + 0x5c], edi
mov dword [ebp + 0x58], eax
mov edi, 0x2710
cmp dword [ebp + 0x5c], 0
jg 0x40f987
mov eax, dword [ebp + 0x7c]
push 0x2800
push eax
push dword [ebp + 0x64]
mov dword [ebp + 0x60], eax
call dword [sym.imp.KERNEL32.dll__lread]
mov dword [ebp + 0x5c], eax
test eax, eax
je 0x40fa68
cmp eax, 0xffffffff
je 0x40fa54
push dword [ebp + 0x68]
call dword [sym.imp.WS2_32.dll_WSASetEvent]
push 0
push edi
push 0
lea eax, [ebp + 0x48]
push eax
push 2
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
test eax, eax
jne 0x40fa5d
push dword [ebp + 0x68]
call dword [sym.imp.WS2_32.dll_WSAResetEvent]
push 0
push dword [ebp + 0x5c]
push dword [ebp + 0x60]
push dword [ebp + 0x78]
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jg 0x40f9db
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp + 0x6c], eax
cmp eax, 0x2733
jne 0x40fa68
and dword [ebp + 0x6c], 0
jmp 0x40f94f
add dword [ebp + 0x60], eax
sub dword [ebp + 0x5c], eax
push dword [ebp + 0x44]
cdq
add dword [esi + 0x28], eax
push dword [ebp + 0x40]
adc dword [esi + 0x2c], edx
add dword [ebp + 0x50], eax
push 0
push edi
adc dword [ebp + 0x54], edx
push dword [ebp + 0x54]
push dword [ebp + 0x50]
call fcn.004016b0
mov dword [esi + 0x3c], eax
call ebx
sub eax, dword [ebp + 0x58]
test eax, eax
jle 0x40f94f
cdq
push edx
push eax
push 0
push 0x64
push dword [esi + 0x2c]
push dword [esi + 0x28]
call fcn.004016b0
mov dword [esi + 0x34], eax
test eax, eax
jle 0x40f94f
mov ecx, dword [ebp + 0x44]
imul eax, eax, 0xa
cdq
push edx
push eax
mov eax, dword [ebp + 0x40]
sub eax, dword [ebp + 0x50]
push 0
sbb ecx, dword [ebp + 0x54]
push 1
push ecx
push eax
call fcn.004016b0
mov dword [esi + 0x38], eax
jmp 0x40f94f
mov dword [ebp + 0x6c], 3
jmp 0x40fa68
dec eax
neg eax
sbb eax, eax
add eax, 7
mov dword [ebp + 0x6c], eax
push dword [ebp + 0x64]
call dword [sym.imp.KERNEL32.dll__lclose]
push 0
push dword [ebp + 0x68]
push dword [ebp + 0x78]
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
push dword [ebp + 0x68]
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
cmp dword [ebp + 0x6c], 0
jne 0x40fcea
lea eax, [esi + 0x168]
push eax
lea eax, [esi + 0x50]
push eax
lea eax, [esi + 0x40]
push eax
call fcn.0042564c
jmp 0x40fcea
mov dword [ebp + 0x60], ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp byte [ebx], 0
mov dword [ebp + 0x58], eax
je 0x40faf0
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push edi
call fcn.00402cde
push 0x4445b4
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x108]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov dword [ebp + 0x5c], eax
cmp eax, 0xffffffff
je 0x40fcf4
mov eax, dword [ebp + 0x7c]
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
mov byte [eax], 0
cmp byte [esi + 0x168], 0
jne 0x40fb20
lea eax, [ebp - 0x108]
push eax
push dword [ebp + 0x60]
lea eax, [esi + 0x40]
push eax
call fcn.00424fd3
test eax, eax
je 0x40fc9b
cmp byte [esi + 0x1d], 0x12
jne 0x40fb4a
mov ebx, dword [ebp + 0x7c]
lea eax, [ebp - 0xdc]
push eax
add ebx, 0x2800
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0xa
push ebx
call fcn.00401255
jmp 0x40fc1a
test byte [ebp - 0x108], 6
jne 0x40fc72
lea eax, [ebp + 0x38]
push eax
lea eax, [ebp - 0xf4]
push eax
call fcn.004054c8
movzx eax, word [ebp + 0x40]
push 0xc
pop ecx
cmp eax, ecx
jl 0x40fb74
sub eax, ecx
test eax, eax
jne 0x40fb7a
mov eax, ecx
cmp word [ebp + 0x40], cx
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
sbb ecx, ecx
and ecx, 0xfffffff1
add ecx, 0x50
push ecx
movzx ecx, word [ebp + 0x42]
push ecx
push eax
movzx eax, word [ebp + 0x38]
push 0x64
cdq
pop ecx
idiv ecx
movzx eax, word [ebp + 0x3e]
push edx
push eax
movzx eax, word [ebp + 0x3a]
push eax
mov eax, dword [ebp + 0x7c]
add eax, 0x2800
push str._02d__02d__02d___02d:_02d_cM
push eax
mov dword [ebp + 0x68], eax
call ebx
add esp, 0x20
test byte [ebp - 0x108], 0x10
lea eax, [ebp - 0xdc]
push eax
je 0x40fbe8
push str._DIR_
push str.__14s__s_n
push dword [ebp + 0x68]
call fcn.004019bf
push eax
call ebx
add esp, 0x10
jmp 0x40fc1a
mov ecx, dword [ebp - 0xec]
mov edx, dword [ebp - 0xe8]
xor eax, eax
xor ebx, ebx
or eax, edx
or ecx, ebx
push ecx
push eax
mov eax, dword [ebp + 0x7c]
push str._14lld__s_n
add eax, 0x2800
push eax
call fcn.004019bf
push eax
call fcn.004061e5
add esp, 0x14
mov eax, dword [ebp + 0x7c]
add eax, 0x2800
push eax
call edi
push dword [ebp + 0x7c]
mov dword [ebp + 0x68], eax
call edi
mov ecx, dword [ebp + 0x68]
add ecx, eax
mov ebx, 0x2800
cmp ecx, ebx
jl 0x40fc61
push dword [ebp + 0x7c]
push dword [ebp + 0x78]
call fcn.00409b75
mov dword [ebp + 0x6c], eax
test eax, eax
jne 0x40fc9b
push dword [ebp + 0x7c]
call edi
cdq
add dword [esi + 0x28], eax
mov eax, dword [ebp + 0x7c]
adc dword [esi + 0x2c], edx
mov byte [eax], 0
jmp 0x40fc64
mov eax, dword [ebp + 0x7c]
push ebx
lea ecx, [eax + 0x2800]
push ecx
push eax
call fcn.00401284
cmp byte [esi + 0x168], 0
jne 0x40fc83
inc dword [ebp + 0x60]
jmp 0x40fafc
lea eax, [ebp - 0x108]
push eax
push dword [ebp + 0x5c]
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x40fafc
cmp byte [esi + 0x168], 0
je 0x40fcad
push dword [ebp + 0x5c]
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp dword [ebp + 0x6c], 0
jne 0x40fcce
mov ebx, dword [ebp + 0x7c]
cmp byte [ebx], 0
je 0x40fcce
push ebx
push dword [ebp + 0x78]
call fcn.00409b75
push ebx
call edi
cdq
add dword [esi + 0x28], eax
adc dword [esi + 0x2c], edx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp + 0x58]
test eax, eax
jle 0x40fcea
push eax
push 0x64
push dword [esi + 0x28]
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov dword [esi + 0x34], eax
cmp dword [ebp + 0x6c], 7
ja case.default.0x40fcf7
mov eax, dword [ebp + 0x6c]
jmp dword [eax*4 + 0x40fd8e]
push dword [0x443a30]
jmp 0x40fd7c
lea eax, [esi + 0x168]
push eax
push str.551_Open_error__s._n
jmp 0x40fd20
lea eax, [esi + 0x168]
push eax
push str.551_Create_error__s._n
push dword [ebp + 0x7c]
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
jmp 0x40fd5f
lea eax, [esi + 0x168]
push eax
push str.551_Read_error__s._n
jmp 0x40fd20
lea eax, [esi + 0x168]
push eax
push str.551_Write_error__s._n
jmp 0x40fd20
push str.551_Network_Action_Timeout._n
jmp 0x40fd56
push str.551_Aborted._n
push dword [ebp + 0x7c]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [ebp + 0x7c]
push 0x18
push dword [esi + 4]
call fcn.0040f664
jmp 0x40fd84
push dword [0x443a74]
jmp 0x40fd7c
push dword [0x443a54]
push dword [esi + 4]
call fcn.00409b75
pop edi
pop esi
pop ebx
add ebp, 0x70
leave
ret 8