Function at 0x409c60
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Initialize winsock library
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x648
push esi
push edi
mov dword [ebp - 0x1a4], 0
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax*4 + 0x41245c]
mov dword [ebp + 0xc], ecx
mov edi, dword [ebp + 0xc]
mov edx, 0x417894
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov eax, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x4816e0
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov edx, dword [0x4178d0]
imul edx, edx, 0x32
lea eax, [ecx + edx*2 + 0x3e8]
push eax
call sub.MSVCRT.dll_malloc
add esp, 4
mov dword [ebp - 0x1f4], eax
cmp dword [ebp - 0x1f4], 0
jne 0x409cea
mov eax, 0x64
jmp 0x40a62c
push pe_nt_image_headers32
push 0x417894
call sub.MSVCRT.dll_strchr
add esp, 8
test eax, eax
je 0x409d09
mov dword [ebp - 0x648], 0x417894
jmp 0x409d12
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x648], ecx
mov edx, dword [ebp - 0x648]
mov dword [ebp - 0x5f8], edx
mov edi, dword [ebp + 0xc]
lea edx, [ebp - 0x1d8]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov eax, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push pe_nt_image_headers32
lea ecx, [ebp - 0x1d8]
push ecx
call sub.MSVCRT.dll_strchr
add esp, 8
test eax, eax
je 0x409d6d
push pe_nt_image_headers32
lea edx, [ebp - 0x1d8]
push edx
call sub.MSVCRT.dll_strchr
add esp, 8
mov byte [eax], 0
mov edi, dword [ebp + 0xc]
lea edx, [ebp - 0x62c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov eax, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x4816e0
mov edx, dword [ebp - 0x1f4]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov eax, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [0x47c8bc], 0
je 0x409dce
push 0xa
call dword [sym.imp.KERNEL32.DLL_Sleep]
jmp 0x409dbb
mov dword [0x47c8bc], 1
push str._TO_
mov ecx, dword [ebp - 0x1f4]
push ecx
call sub.MSVCRT.dll_strstr
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x409e8f
mov edi, dword [ebp + 0xc]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov dword [ebp - 0x1a0], ecx
mov edi, dword [ebp - 0x1f4]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov edx, dword [ebp - 8]
sub edx, dword [ebp - 0x1f4]
sub ecx, edx
sub ecx, 4
mov dword [ebp - 0x1f0], ecx
mov eax, dword [ebp - 0x1f0]
push eax
mov ecx, dword [ebp - 8]
add ecx, 4
push ecx
mov edx, dword [ebp - 8]
add edx, dword [ebp - 0x1a0]
push edx
call sub.MSVCRT.dll_memmove
add esp, 0xc
mov eax, dword [ebp - 0x1a0]
add eax, dword [ebp - 0x1f0]
mov ecx, dword [ebp - 8]
mov byte [ecx + eax], 0
mov edi, dword [ebp + 0xc]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov esi, dword [ebp + 0xc]
mov edi, dword [ebp - 8]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x409dd8
push str._FROM_
mov eax, dword [ebp - 0x1f4]
push eax
call sub.MSVCRT.dll_strstr
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x409f4f
mov edi, dword [ebp - 0x5f8]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov dword [ebp - 0x1a0], ecx
mov edi, dword [ebp - 0x1f4]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov edx, dword [ebp - 8]
sub edx, dword [ebp - 0x1f4]
sub ecx, edx
sub ecx, 6
mov dword [ebp - 0x1f0], ecx
mov eax, dword [ebp - 0x1f0]
push eax
mov ecx, dword [ebp - 8]
add ecx, 6
push ecx
mov edx, dword [ebp - 8]
add edx, dword [ebp - 0x1a0]
push edx
call sub.MSVCRT.dll_memmove
add esp, 0xc
mov eax, dword [ebp - 0x1a0]
add eax, dword [ebp - 0x1f0]
mov ecx, dword [ebp - 8]
mov byte [ecx + eax], 0
mov edi, dword [ebp - 0x5f8]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov esi, dword [ebp - 0x5f8]
mov edi, dword [ebp - 8]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x409e8f
mov eax, dword [ebp + 0xc]
push eax
call fcn.0040ad60
add esp, 4
mov dword [ebp - 4], eax
push str._HOST_
mov ecx, dword [ebp - 0x1f4]
push ecx
call sub.MSVCRT.dll_strstr
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x40a015
mov edi, dword [ebp - 4]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov dword [ebp - 0x1a0], ecx
mov edi, dword [ebp - 0x1f4]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov edx, dword [ebp - 8]
sub edx, dword [ebp - 0x1f4]
sub ecx, edx
sub ecx, 6
mov dword [ebp - 0x1f0], ecx
mov eax, dword [ebp - 0x1f0]
push eax
mov ecx, dword [ebp - 8]
add ecx, 6
push ecx
mov edx, dword [ebp - 8]
add edx, dword [ebp - 0x1a0]
push edx
call sub.MSVCRT.dll_memmove
add esp, 0xc
mov eax, dword [ebp - 0x1a0]
add eax, dword [ebp - 0x1f0]
mov ecx, dword [ebp - 8]
mov byte [ecx + eax], 0
mov edi, dword [ebp - 4]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x409f5e
mov dword [0x47c8bc], 0
lea eax, [ebp - 0x198]
push eax
push 0x101
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x40a04e
mov ecx, dword [ebp - 0x1f4]
push ecx
call sub.MSVCRT.dll_free
add esp, 4
mov eax, 1
jmp 0x40a62c
push 1
push 0
push 0
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov dword [ebp - 0x630], eax
cmp dword [ebp - 0x630], 0xffffffff
jne 0x40a088
mov edx, dword [ebp - 0x1f4]
push edx
call sub.MSVCRT.dll_free
add esp, 4
mov eax, 2
jmp 0x40a62c
mov dword [ebp - 0x1ec], 0x3a98
push 4
lea eax, [ebp - 0x1ec]
push eax
push 0x1006
push 0xffff
mov ecx, dword [ebp - 0x630]
push ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea edx, [ebp - 0x1ec]
push edx
push 0x1005
push 0xffff
mov eax, dword [ebp - 0x630]
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
mov word [ebp - 0x1e8], 2
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.WS2_32.dll_gethostbyname]
mov dword [ebp - 0x1a4], eax
cmp dword [ebp - 0x1a4], 0
jne 0x40a11a
mov edx, dword [ebp - 0x630]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 0x1f4]
push eax
call sub.MSVCRT.dll_free
add esp, 4
mov eax, 3
jmp 0x40a62c
mov ecx, dword [ebp - 0x1a4]
movsx ecx, word [ecx + 0xa]
mov edx, dword [ebp - 0x1a4]
mov eax, dword [edx + 0xc]
mov esi, dword [eax]
lea edi, [ebp - 0x1e4]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x19
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x1e6], ax
push 0x10
lea eax, [ebp - 0x1e8]
push eax
mov ecx, dword [ebp - 0x630]
push ecx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40a193
mov edx, dword [ebp - 0x630]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 0x1f4]
push eax
call sub.MSVCRT.dll_free
add esp, 4
mov eax, 4
jmp 0x40a62c
mov dword [ebp - 0x19c], 0
mov ecx, 1
test ecx, ecx
je 0x40a5fb
mov byte [ebp - 0x5f4], 0
push 0x3ff
lea edx, [ebp - 0x5f4]
push edx
mov eax, dword [ebp - 0x630]
push eax
call fcn.0040b380
add esp, 0xc
test eax, eax
jne 0x40a1df
mov dword [ebp - 0x19c], 0xb
jmp 0x40a5fb
push 3
push 0x40d0bc
lea ecx, [ebp - 0x5f4]
push ecx
call sub.MSVCRT.dll_strncmp
add esp, 0xc
test eax, eax
je 0x40a222
push 3
push 0x40d7f0
lea edx, [ebp - 0x5f4]
push edx
call sub.MSVCRT.dll_strncmp
add esp, 0xc
test eax, eax
je 0x40a222
mov dword [ebp - 0x19c], 0x11
jmp 0x40a5fb
mov dword [ebp - 0x63c], 0x7530
push 4
lea eax, [ebp - 0x63c]
push eax
push 0x1006
push 0xffff
mov ecx, dword [ebp - 0x630]
push ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea edx, [ebp - 0x63c]
push edx
push 0x1005
push 0xffff
mov eax, dword [ebp - 0x630]
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
lea ecx, [ebp - 0x1d8]
push ecx
push str.HELO__s_r_n
push 0x400
lea edx, [ebp - 0x5f4]
push edx
call sub.MSVCRT.dll__snprintf
add esp, 0x10
lea eax, [ebp - 0x5f4]
push eax
mov ecx, dword [ebp - 0x630]
push ecx
call fcn.0040b410
add esp, 8
test eax, eax
jne 0x40a2b5
mov dword [ebp - 0x19c], 0xa
jmp 0x40a5fb
mov byte [ebp - 0x5f4], 0
mov edx, dword [ebp + 0xc]
push edx
push 0
push 0
lea eax, [ebp - 0x5f4]
push eax
mov ecx, dword [ebp - 0x630]
push ecx
call fcn.0040b2b0
add esp, 0x14
test eax, eax
jne 0x40a2ed
mov dword [ebp - 0x19c], 0xc
jmp 0x40a5fb
mov edx, dword [ebp - 0x5f8]
push edx
push str.MAIL_From:__s__r_n
push 0x400
lea eax, [ebp - 0x5f4]
push eax
call sub.MSVCRT.dll__snprintf
add esp, 0x10
lea ecx, [ebp - 0x5f4]
push ecx
mov edx, dword [ebp - 0x630]
push edx
call fcn.0040b410
add esp, 8
test eax, eax
jne 0x40a336
mov dword [ebp - 0x19c], 0xa
jmp 0x40a5fb
mov byte [ebp - 0x5f4], 0
mov eax, dword [ebp + 0xc]
push eax
push 0
push 0
lea ecx, [ebp - 0x5f4]
push ecx
mov edx, dword [ebp - 0x630]
push edx
call fcn.0040b2b0
add esp, 0x14
test eax, eax
jne 0x40a36e
mov dword [ebp - 0x19c], 0xd
jmp 0x40a5fb
mov dword [ebp - 0x638], 0
jmp 0x40a389
mov eax, dword [ebp - 0x638]
add eax, 1
mov dword [ebp - 0x638], eax
mov ecx, dword [ebp - 0x638]
cmp ecx, dword [ebp + 0x10]
jge 0x40a48b
mov edx, dword [ebp + 0x14]
add edx, dword [ebp - 0x638]
mov eax, dword [edx*4 + 0x41245c]
mov dword [ebp - 0x644], eax
mov ecx, dword [ebp - 0x644]
movsx edx, byte [ecx]
cmp edx, 0x21
jne 0x40a3e9
mov eax, dword [ebp - 0x644]
movsx ecx, byte [eax + 1]
cmp ecx, 0x21
jne 0x40a3e9
mov edx, dword [ebp - 0x644]
movsx eax, byte [edx + 2]
cmp eax, 0x21
jne 0x40a3e9
mov ecx, dword [ebp - 0x644]
add ecx, 3
mov dword [ebp - 0x644], ecx
mov edx, dword [ebp - 0x644]
push edx
push str.RCPT_To:__s__r_n
push 0x400
lea eax, [ebp - 0x5f4]
push eax
call sub.MSVCRT.dll__snprintf
add esp, 0x10
lea ecx, [ebp - 0x5f4]
push ecx
mov edx, dword [ebp - 0x630]
push edx
call fcn.0040b410
add esp, 8
test eax, eax
jne 0x40a438
mov eax, dword [ebp - 0x638]
mov ecx, dword [ebp + 0x18]
mov dword [ecx + eax*4], 0
jmp 0x40a37a
mov byte [ebp - 0x5f4], 0
mov edx, dword [ebp + 0xc]
push edx
push 0
push 0
lea eax, [ebp - 0x5f4]
push eax
mov ecx, dword [ebp - 0x630]
push ecx
call fcn.0040b2b0
add esp, 0x14
test eax, eax
jne 0x40a476
mov edx, dword [ebp - 0x638]
mov eax, dword [ebp + 0x18]
mov dword [eax + edx*4], 0
jmp 0x40a37a
mov ecx, dword [ebp - 0x638]
mov edx, dword [ebp + 0x18]
mov dword [edx + ecx*4], 1
jmp 0x40a37a
mov dword [ebp - 0x634], 1
mov dword [ebp - 0x640], 0
jmp 0x40a4b0
mov eax, dword [ebp - 0x640]
add eax, 1
mov dword [ebp - 0x640], eax
mov ecx, dword [ebp - 0x640]
cmp ecx, dword [ebp + 0x10]
jge 0x40a4d6
mov edx, dword [ebp - 0x640]
mov eax, dword [ebp + 0x18]
cmp dword [eax + edx*4], 1
jne 0x40a4d4
mov dword [ebp - 0x634], 0
jmp 0x40a4a1
cmp dword [ebp - 0x634], 1
jne 0x40a4ee
mov dword [ebp - 0x19c], 0xe
jmp 0x40a5fb
push str.DATA_r_n
push 0x400
lea ecx, [ebp - 0x5f4]
push ecx
call sub.MSVCRT.dll__snprintf
add esp, 0xc
lea edx, [ebp - 0x5f4]
push edx
mov eax, dword [ebp - 0x630]
push eax
call fcn.0040b410
add esp, 8
test eax, eax
jne 0x40a530
mov dword [ebp - 0x19c], 0xa
jmp 0x40a5fb
mov byte [ebp - 0x5f4], 0
mov ecx, dword [ebp + 0xc]
push ecx
push 0
push 0
lea edx, [ebp - 0x5f4]
push edx
mov eax, dword [ebp - 0x630]
push eax
call fcn.0040b2b0
add esp, 0x14
test eax, eax
jne 0x40a568
mov dword [ebp - 0x19c], 0xf
jmp 0x40a5fb
mov ecx, dword [ebp - 0x1f4]
push ecx
mov edx, dword [ebp - 0x630]
push edx
call fcn.0040b410
add esp, 8
test eax, eax
jne 0x40a58e
mov dword [ebp - 0x19c], 0xa
jmp 0x40a5fb
push str._r_n._r_n
mov eax, dword [ebp - 0x630]
push eax
call fcn.0040b410
add esp, 8
test eax, eax
jne 0x40a5b2
mov dword [ebp - 0x19c], 0xa
jmp 0x40a5fb
mov byte [ebp - 0x5f4], 0
mov ecx, dword [ebp + 0xc]
push ecx
push 0
push 0
lea edx, [ebp - 0x5f4]
push edx
mov eax, dword [ebp - 0x630]
push eax
call fcn.0040b2b0
add esp, 0x14
test eax, eax
jne 0x40a5e7
mov dword [ebp - 0x19c], 0x10
jmp 0x40a5fb
push str.QUIT_r_n
mov ecx, dword [ebp - 0x630]
push ecx
call fcn.0040b410
add esp, 8
push 2
mov edx, dword [ebp - 0x630]
push edx
call dword [sym.imp.WS2_32.dll_shutdown]
mov eax, dword [ebp - 0x630]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [ebp - 0x1f4]
push ecx
call sub.MSVCRT.dll_free
add esp, 4
mov eax, dword [ebp - 0x19c]
pop edi
pop esi
mov esp, ebp
pop ebp
ret