Function at 0x4042f1
Capabilities:
Get socket status
Read and send data from client to server
Read file on windows
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0x3e8
lea eax, [ebp - 0x48]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov dword [esp], 1
call sub.msvcrt.dll__isatty
test eax, eax
jne 0x404337
mov dword [esp + 4], 0x8000
mov dword [esp], 1
call sub.msvcrt.dll__setmode
mov dword [esp], 0
call sub.msvcrt.dll__isatty
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jne 0x404360
mov dword [esp + 4], 0x8000
mov dword [esp], 0
call sub.msvcrt.dll__setmode
mov dword [ebp - 0x28], 0
jmp 0x40437e
mov eax, dword [0x40a14c]
mov edx, dword [ebp - 0x28]
mov eax, dword [eax + edx*4 + 4]
cmp eax, dword [ebp + 8]
je 0x40438a
add dword [ebp - 0x28], 1
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x28]
ja 0x404369
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x28]
jne 0x4043bd
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, 0x3f
ja 0x4043bd
mov eax, dword [0x40a14c]
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp + 8]
mov dword [eax + edx*4 + 4], ecx
mov eax, dword [0x40a14c]
mov edx, dword [eax]
add edx, 1
mov dword [eax], edx
mov word [ebp - 0x36], 2
mov word [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x40a030]
test eax, eax
je 0x404485
mov eax, dword [0x40a030]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x40a148]
mov dword [ebp - 0x5c], eax
mov word [ebp - 0x24], 1
movzx eax, word [0x407024]
test ax, ax
je 0x404411
mov dword [0x40a030], 0
jmp 0x404485
mov dword [ebp - 0x2c], 0
jmp 0x40446d
mov eax, dword [0x40a14c]
mov edx, dword [ebp - 0x2c]
mov eax, dword [eax + edx*4 + 4]
test eax, eax
jne 0x404469
jmp 0x40444c
mov eax, dword [0x40a14c]
mov edx, dword [0x40a14c]
mov ecx, dword [ebp - 0x2c]
add ecx, 1
mov ecx, dword [edx + ecx*4 + 4]
mov edx, dword [ebp - 0x2c]
mov dword [eax + edx*4 + 4], ecx
add dword [ebp - 0x2c], 1
mov eax, dword [0x40a14c]
mov eax, dword [eax]
sub eax, 1
cmp eax, dword [ebp - 0x2c]
ja 0x40442c
mov eax, dword [0x40a14c]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x404479
add dword [ebp - 0x2c], 1
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x2c]
ja 0x40441a
mov dword [esp], 0
call sub.msvcrt.dll__close
mov eax, dword [0x40a060]
test eax, eax
je 0x40449b
mov eax, dword [0x40a060]
mov dword [esp], eax
call sub.msvcrt.dll__sleep
call sub.msvcrt.dll__errno
mov dword [eax], 0
mov dword [esp], 0
call sub.WSOCK32.DLL_WSASetLastError
sub esp, 4
jmp 0x4049a5
mov word [ebp - 0x22], 0x2008
cmp word [ebp - 0x24], 0
je 0x4044d2
mov word [ebp - 0x24], 0
jmp 0x40483d
mov edx, dword [0x40a154]
mov eax, dword [0x40a14c]
mov ebx, eax
mov eax, 0x41
mov edi, edx
mov esi, ebx
mov ecx, eax
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x40a03c]
test eax, eax
je 0x404514
mov edx, dword [0x40a03c]
mov eax, dword [0x40a040]
mov dword [esp + 8], 8
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [0x40a154]
lea edx, [ebp - 0x44]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], 0x10
call sub.WSOCK32.DLL_select
sub esp, 0x14
mov ebx, eax
test ebx, ebx
jns 0x404597
call sub.WSOCK32.DLL_WSAGetLastError
cmp eax, 0x2714
je 0x404597
call sub.WSOCK32.DLL_WSAGetLastError
mov dword [ebp - 0x3c], eax
mov dword [esp], str.select_fuxored
call fcn.00402ddc
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_shutdown
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_closesocket
sub esp, 4
mov eax, 1
jmp 0x4049ed
test ebx, ebx
jne 0x404627
lea eax, [ebp - 0x4c]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov eax, dword [0x40a070]
test eax, eax
je 0x404627
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x48]
sub edx, eax
mov eax, dword [0x40a03c]
mov eax, dword [eax]
cmp edx, eax
jle 0x404627
movzx eax, word [0x40a06e]
cmp ax, 1
jbe 0x4045df
mov dword [esp], str.net_timeout
call fcn.00402ddc
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_shutdown
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_closesocket
sub esp, 4
mov eax, dword [0x40a14c]
mov dword [eax], 0
mov dword [esp], 0
call sub.WSOCK32.DLL_WSASetLastError
sub esp, 4
mov eax, 0
jmp 0x4049ed
mov eax, dword [0x40a154]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x404716
lea eax, [ebp - 0x48]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov eax, dword [0x40a140]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x2000
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_recv
sub esp, 0x10
mov ebx, eax
test ebx, ebx
jg 0x4046f0
mov dword [ebp - 0x30], 0
jmp 0x4046db
mov eax, dword [0x40a14c]
mov edx, dword [ebp - 0x30]
mov eax, dword [eax + edx*4 + 4]
cmp eax, dword [ebp + 8]
jne 0x4046d7
jmp 0x4046ba
mov eax, dword [0x40a14c]
mov edx, dword [0x40a14c]
mov ecx, dword [ebp - 0x30]
add ecx, 1
mov ecx, dword [edx + ecx*4 + 4]
mov edx, dword [ebp - 0x30]
mov dword [eax + edx*4 + 4], ecx
add dword [ebp - 0x30], 1
mov eax, dword [0x40a14c]
mov eax, dword [eax]
sub eax, 1
cmp eax, dword [ebp - 0x30]
ja 0x40469a
mov eax, dword [0x40a14c]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x4046e7
add dword [ebp - 0x30], 1
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x30]
ja 0x404687
mov dword [ebp - 0x1c], 0
jmp 0x404716
mov dword [ebp - 0x20], ebx
mov eax, dword [0x40a140]
mov dword [ebp - 0x60], eax
movzx eax, word [0x40a07c]
test ax, ax
je 0x404716
mov dword [esp + 4], ebx
mov ecx, dword [ebp - 0x60]
mov dword [esp], ecx
call fcn.00404239
cmp dword [ebp - 0x1c], 0
jne 0x40483c
cmp dword [ebp - 0x34], 0
je 0x4047de
call sub.msvcrt.dll__kbhit
test eax, eax
je 0x40483d
mov eax, dword [0x40a148]
mov dword [esp], eax
call sub.msvcrt.dll_gets
movzx eax, word [0x40a076]
test ax, ax
je 0x404779
mov ebx, dword [0x40a148]
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
lea eax, [ebx + eax]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x408958
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov ebx, dword [0x40a148]
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
lea eax, [ebx + eax]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x40895a
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [0x40a148]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov dword [ebp - 0x1c], ebx
mov esi, dword [0x40a148]
mov dword [ebp - 0x5c], esi
movzx eax, word [0x407024]
test ax, ax
jne 0x40483d
mov eax, ebx
mov dword [0x40a030], eax
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x40483d
mov eax, dword [0x40a148]
mov dword [esp + 8], 0x2000
mov dword [esp + 4], eax
mov dword [esp], 0
call sub.msvcrt.dll__read
mov ebx, eax
test ebx, ebx
jg 0x40480f
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x40483d
mov dword [ebp - 0x1c], ebx
mov edi, dword [0x40a148]
mov dword [ebp - 0x5c], edi
movzx eax, word [0x407024]
test ax, ax
jne 0x40483d
mov eax, ebx
mov dword [0x40a030], eax
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x40483d
nop
cmp dword [ebp - 0x1c], 0x2008
ja 0x40484f
cmp dword [ebp - 0x20], 0x2008
jbe 0x404876
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov dword [esp], str.Preposterous_Pointers:__d___d
call fcn.00402ddc
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
cmp word [ebp - 0x22], 0
jne 0x404893
mov dword [esp], str.too_many_output_retries
call fcn.00402ddc
mov eax, 1
jmp 0x4049ed
cmp dword [ebp - 0x20], 0
je 0x404903
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x60]
mov dword [esp + 4], eax
mov dword [esp], 1
call sub.msvcrt.dll__write
mov ebx, eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
test ebx, ebx
jle 0x404903
movzx eax, word [0x40a068]
test ax, ax
je 0x4048e9
mov dword [esp + 8], ebx
mov ecx, dword [ebp - 0x60]
mov dword [esp + 4], ecx
mov dword [esp], 1
call fcn.00404078
mov eax, ebx
add dword [ebp - 0x60], eax
mov eax, ebx
sub dword [ebp - 0x20], eax
mov edx, dword [0x40a034]
mov eax, ebx
lea eax, [edx + eax]
mov dword [0x40a034], eax
cmp dword [ebp - 0x1c], 0
je 0x40496c
mov eax, dword [0x40a060]
test eax, eax
je 0x404928
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov esi, dword [ebp - 0x5c]
mov dword [esp], esi
call fcn.00403005
mov ebx, eax
jmp 0x40492b
mov ebx, dword [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov edi, dword [ebp - 0x5c]
mov dword [esp + 4], edi
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_send
sub esp, 0x10
mov ebx, eax
test ebx, ebx
jle 0x40496c
mov eax, ebx
add dword [ebp - 0x5c], eax
mov eax, ebx
sub dword [ebp - 0x1c], eax
mov edx, dword [0x40a038]
mov eax, ebx
lea eax, [edx + eax]
mov dword [0x40a038], eax
mov eax, dword [0x40a060]
test eax, eax
je 0x40498f
mov eax, dword [0x40a060]
mov dword [esp], eax
call sub.msvcrt.dll__sleep
call sub.msvcrt.dll__errno
mov dword [eax], 0
jmp 0x4049a5
cmp dword [ebp - 0x1c], 0
jne 0x40499b
cmp dword [ebp - 0x20], 0
je 0x4049a5
sub word [ebp - 0x22], 1
jmp 0x40483d
mov eax, dword [0x40a14c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
jne 0x4044ba
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_shutdown
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_closesocket
sub esp, 4
mov eax, 0
lea esp, [ebp - 0xc]
add esp, 0
pop ebx
pop esi
pop edi
pop ebp
ret