Function at 0x1005da5
Capabilities:
Connect socket
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x32c
push ebx
push esi
push edi
lea eax, [ebp - 0x32c]
xor ebx, ebx
push 0x200
push eax
push ebx
push ebx
push ebx
push 0xfc
mov dword [ebp - 4], ebx
push dword [0x100e19c]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0xc], ebx
push dword [ebp + 0xc]
push ebx
call fcn.01008dcf
mov esi, eax
cmp esi, ebx
jge 0x1005e04
test byte [0x1010250], 2
je 0x10061ec
push 0xcf
push 2
call fcn.0100d1e5
pop ecx
jmp 0x1005e63
xor eax, eax
lea edi, [ebp - 0x2c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov ax, word [0x10101c4]
mov word [ebp - 0x2c], 2
push eax
call sub.WSOCK32.dll_htons
mov word [ebp - 0x2a], ax
mov eax, dword [0x101171c]
mov ecx, dword [eax + 8]
cmp ecx, ebx
je 0x1005e33
mov eax, dword [ecx]
jmp 0x1005e3d
mov eax, dword [eax + 0x14]
mov eax, dword [eax]
mov eax, dword [eax + 8]
mov eax, dword [eax]
mov eax, dword [eax]
push ebx
push 1
push 2
mov dword [ebp - 0x28], eax
call sub.WSOCK32.dll_socket
or edi, 0xffffffff
mov dword [0x100ff20], eax
cmp eax, edi
jne 0x1005e69
push 0x1001bd4
call dword [sym.imp.MSVCRT.dll_perror]
pop ecx
jmp 0x10061ec
lea ecx, [ebp - 0x2c]
push 0x10
push ecx
push eax
call sub.WSOCK32.dll_connect
cmp eax, edi
jne 0x1005eb2
call dword [sym.imp.MSVCRT.dll__errno]
cmp dword [eax], 0x274d
jne 0x1005e8b
push 0xfffffffffffffffb
jmp 0x1005e99
push 0x1001bc8
call dword [sym.imp.MSVCRT.dll_perror]
pop ecx
push 0xfffffffffffffffd
pop esi
push dword [0x100ff20]
call sub.WSOCK32.dll_closesocket
mov dword [0x100ff20], edi
mov eax, esi
jmp 0x10061ef
push esi
call sub.WSOCK32.dll_htons
mov dword [ebp - 8], eax
push ebx
lea eax, [ebp - 8]
push 2
push eax
push dword [0x100ff20]
call sub.WSOCK32.dll_send
cmp eax, edi
je 0x10061cf
push ebx
lea eax, [ebp - 0x32c]
push esi
push eax
push dword [0x100ff20]
call sub.WSOCK32.dll_send
cmp eax, edi
je 0x10061cf
mov eax, dword [0x101171c]
cmp dword [eax + 8], ebx
jne 0x1005f00
mov eax, dword [eax + 0x14]
mov eax, dword [eax]
mov eax, dword [eax]
mov edi, dword [sym.imp.MSVCRT.dll_fprintf]
push eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
mov esi, 0x1001bc0
add eax, 0x20
push esi
push eax
call edi
add esp, 0xc
cmp dword [ebp + 0x10], ebx
jne 0x1005f31
mov eax, dword [sym.imp.MSVCRT.dll__iob]
add eax, 0x20
mov dword [0x1037fb8], eax
jmp 0x1005f9f
lea eax, [ebp - 0x12c]
push eax
push dword [ebp + 0x10]
call fcn.01006d70
cmp eax, ebx
mov dword [0x1037fb8], eax
jne 0x1005f73
lea eax, [ebp - 0x12c]
push eax
push 0xc
push 2
call fcn.0100d1e5
add esp, 0xc
push dword [0x100ff20]
call sub.WSOCK32.dll_closesocket
or dword [0x100ff20], 0xffffffff
jmp 0x10061ec
push dword [ebp + 0x10]
push 0x1001254
push eax
call edi
mov eax, dword [0x101171c]
add esp, 0xc
cmp dword [eax + 8], ebx
jne 0x1005f90
mov eax, dword [eax + 0x14]
mov eax, dword [eax]
mov eax, dword [eax]
push eax
push esi
push dword [0x1037fb8]
call edi
add esp, 0xc
cmp dword [0x1011720], ebx
jne 0x10060bf
push 2
lea esi, [ebp - 0x1c]
pop ebx
push 0
push ebx
push esi
push dword [0x100ff20]
call sub.WSOCK32.dll_recv
mov edi, eax
test edi, edi
je 0x1005fce
sub ebx, edi
add esi, edi
test ebx, ebx
jg 0x1005fb1
cmp edi, 0xffffffff
je 0x10060d3
push dword [ebp - 0x1c]
call sub.WSOCK32.dll_htons
test ax, ax
mov dword [ebp - 8], eax
je 0x10060ec
movzx ecx, ax
mov eax, dword [0x1011728]
cmp ecx, eax
jle 0x100601e
test eax, eax
je 0x1006008
push dword [0x1011724]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
movzx eax, word [ebp - 8]
push eax
mov dword [0x1011728], eax
call dword [sym.imp.MSVCRT.dll_malloc]
pop ecx
mov dword [0x1011724], eax
movzx esi, word [ebp - 8]
mov ebx, dword [0x1011724]
test esi, esi
jle 0x1006047
push 0
push esi
push ebx
push dword [0x100ff20]
call sub.WSOCK32.dll_recv
mov edi, eax
test edi, edi
jle 0x1006047
add ebx, edi
sub esi, edi
jmp 0x1006028
cmp edi, 0xffffffff
je 0x10060dc
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 4]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
push ebx
push dword [0x1011724]
push dword [0x1037fb8]
call fcn.010061f6
test eax, eax
mov dword [ebp - 0x18], eax
jne 0x10060e5
cmp dword [ebp + 0x10], eax
je 0x10060b2
mov eax, dword [ebp - 4]
mov ecx, eax
sub ecx, dword [ebp - 0x14]
cmp ecx, 0x32
jle 0x10060b2
mov dword [ebp - 0x14], eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
add eax, 0x20
push 0x1001bbc
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
mov eax, dword [sym.imp.MSVCRT.dll__iob]
pop ecx
pop ecx
add eax, 0x20
push eax
call dword [sym.imp.MSVCRT.dll_fflush]
pop ecx
cmp dword [ebp - 0x10], 2
jge 0x10060ec
xor ebx, ebx
jmp 0x1005f9f
push 0x10018e8
mov dword [0x1011720], ebx
call dword [sym.imp.MSVCRT.dll_printf]
pop ecx
jmp 0x10060ee
mov dword [ebp - 0xc], 1
jmp 0x10060ec
mov dword [ebp - 0xc], 2
jmp 0x10060ec
mov dword [ebp - 0xc], 3
xor ebx, ebx
cmp dword [ebp + 0x10], ebx
je 0x1006121
cmp dword [ebp - 4], 1
mov eax, 0x1001354
mov ecx, 0x1001bb8
jne 0x1006105
mov ecx, eax
cmp dword [ebp - 4], 0x32
jl 0x1006110
mov eax, 0x10018e8
push ecx
push dword [ebp - 4]
push eax
push 0x21
push 1
call fcn.0100d1e5
add esp, 0x14
push dword [0x100ff20]
call sub.WSOCK32.dll_closesocket
or dword [0x100ff20], 0xffffffff
cmp dword [ebp + 0x10], ebx
je 0x100614f
mov eax, dword [0x1037fb8]
cmp eax, ebx
je 0x100614f
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
mov dword [0x1037fb8], ebx
mov eax, dword [ebp - 0xc]
sub eax, ebx
je 0x10061cb
dec eax
je 0x10061ec
dec eax
je 0x100616f
dec eax
jne 0x10061ec
mov eax, dword [ebp - 0x18]
jmp 0x10061ef
mov esi, dword [0x1011724]
push 0xd2
push 2
call fcn.0100d1e5
mov ax, word [esi + 0xa]
pop ecx
pop ecx
push eax
call sub.WSOCK32.dll_ntohs
movzx eax, ax
push eax
mov ax, word [esi + 8]
push eax
call sub.WSOCK32.dll_ntohs
movzx eax, ax
push eax
mov ax, word [esi + 6]
push eax
call sub.WSOCK32.dll_ntohs
movzx eax, ax
push eax
mov al, byte [esi + 3]
and eax, 0xf
push dword [eax*4 + 0x1010208]
push 0xd3
push 2
call fcn.0100d1e5
add esp, 0x18
jmp 0x10061ec
xor eax, eax
jmp 0x10061ef
push 0x1001bac
call dword [sym.imp.MSVCRT.dll_perror]
pop ecx
push dword [0x100ff20]
call sub.WSOCK32.dll_closesocket
mov dword [0x100ff20], edi
push 0xfffffffffffffffd
pop eax
pop edi
pop esi
pop ebx
leave
ret 0xc