Function at 0x407490
Capabilities:
Act as tcp client
Check for time delay via gettickcount
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Set socket configuration

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x412f03
push eax
mov dword fs:[0], esp
sub esp, 0x65c
mov eax, dword [esp + 0x820]
push ebx
push ebp
push esi
push edi
xor esi, esi
mov edi, 1
push esi
mov ebx, 2
push edi
push ebx
mov byte [eax], 0
call sub.WSOCK32.dll_socket
mov ebp, dword [esp + 0x67c]
cmp eax, 0xffffffff
mov dword [ebp], eax
je 0x407fe0
mov eax, dword [esp + 0x680]
mov word [esp + 0x1c], bx
cmp eax, esi
jne 0x407684
cmp dword [esp + 0x7b5], esi
je 0x407522
mov ecx, dword [esp + 0x81d]
push ecx
call sub.WSOCK32.dll_htons
lea edx, [esp + 0x7b9]
mov word [esp + 0x1e], ax
push edx
call sub.WSOCK32.dll_inet_addr
mov dword [esp + 0x20], eax
jmp 0x407561
mov eax, dword [esp + 0x828]
push eax
call sub.WSOCK32.dll_htons
mov esi, dword [esp + 0x824]
mov word [esp + 0x1e], ax
push esi
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
mov dword [esp + 0x20], eax
jne 0x40755f
push esi
call sub.WSOCK32.dll_gethostbyname
test eax, eax
je 0x40755f
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
mov dword [esp + 0x20], eax
xor esi, esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [esp + 0x82c]
lea edx, [esp + 0x10]
push edx
push 0x8004667e
mov dword [ecx], eax
mov eax, dword [ebp]
push eax
mov dword [esp + 0x1c], edi
call sub.WSOCK32.dll_ioctlsocket
cmp eax, 0xffffffff
je 0x407654
mov edx, dword [ebp]
lea ecx, [esp + 0x1c]
push 0x10
push ecx
push edx
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
jne 0x407654
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x407654
mov eax, dword [ebp]
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x314]
mov dword [esp + 0x318], eax
push esi
push edx
inc eax
push esi
push eax
mov dword [esp + 0x324], edi
mov dword [esp + 0x44], 5
mov dword [esp + 0x48], esi
call sub.WSOCK32.dll_select
cmp eax, edi
jne 0x407654
mov edx, dword [ebp]
lea eax, [esp + 0x14]
lea ecx, [esp + 0x18]
push eax
push ecx
push 0x1007
push 0xffff
push edx
mov dword [esp + 0x24], esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], 4
call sub.WSOCK32.dll_getsockopt
cmp dword [esp + 0x18], esi
jne 0x407654
mov ecx, dword [ebp]
lea eax, [esp + 0x310]
push eax
push ecx
call sub.WSOCK32.dll___WSAFDIsSet
cmp eax, edi
jne 0x407654
mov eax, dword [ebp]
lea edx, [esp + 0x10]
push edx
push 0x8004667e
push eax
call sub.WSOCK32.dll_ioctlsocket
cmp eax, 0xffffffff
jne 0x407f08
mov edi, 0x41b6e4
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, dword [esp + 0x830]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp]
push eax
jmp 0x407fc9
mov al, byte [esp + 0x684]
test al, al
jne 0x4077df
mov ecx, dword [esp + 0x685]
push ecx
call sub.WSOCK32.dll_htons
lea edx, [esp + 0x689]
mov word [esp + 0x1e], ax
push edx
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
mov dword [esp + 0x20], eax
jne 0x4076d7
lea eax, [esp + 0x689]
push eax
call sub.WSOCK32.dll_gethostbyname
cmp eax, esi
je 0x4076d7
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
mov dword [esp + 0x20], eax
mov edx, dword [ebp]
lea ecx, [esp + 0x1c]
push 0x10
push ecx
push edx
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
jne 0x4076f6
mov edi, 0x41b6cc
jmp 0x407fa3
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x54]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x7b5]
mov byte [esp + 0x54], 4
test eax, eax
mov byte [esp + 0x55], 1
je 0x407779
mov edx, dword [esp + 0x81d]
push edx
call sub.WSOCK32.dll_ntohs
mov word [esp + 0x56], ax
lea eax, [esp + 0x7b9]
push eax
call sub.WSOCK32.dll_inet_addr
mov dword [esp + 0x58], eax
mov edx, dword [ebp]
push 0
lea ecx, [esp + 0x58]
push 9
push ecx
push edx
call sub.WSOCK32.dll_send
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x54]
push eax
rep stosd dword es:[edi], eax
mov ecx, dword [ebp]
lea eax, [esp + 0x58]
push 0x64
push eax
push ecx
call sub.WSOCK32.dll_recv
cmp eax, ebx
jae 0x4077c2
mov edi, 0x41b6bc
jmp 0x407659
mov ecx, dword [esp + 0x828]
push ecx
call sub.WSOCK32.dll_ntohs
mov esi, dword [esp + 0x824]
mov word [esp + 0x56], ax
push esi
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
mov dword [esp + 0x58], eax
jne 0x40773b
push esi
call sub.WSOCK32.dll_gethostbyname
test eax, eax
je 0x4077b8
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
mov ecx, dword [eax]
mov dword [esp + 0x58], ecx
jmp 0x40773b
mov edi, 0x41b6b0
jmp 0x407659
mov al, byte [esp + 0x54]
test al, al
jne 0x4077d5
cmp byte [esp + 0x55], 0x5a
je 0x407f08
mov edi, 0x41b698
jmp 0x407659
mov ecx, dword [esp + 0x685]
cmp al, 1
push ecx
jne 0x407b1a
call sub.WSOCK32.dll_htons
lea edx, [esp + 0x689]
mov word [esp + 0x1e], ax
push edx
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
mov dword [esp + 0x20], eax
jne 0x40782b
lea eax, [esp + 0x689]
push eax
call sub.WSOCK32.dll_gethostbyname
cmp eax, esi
je 0x40782b
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
mov dword [esp + 0x20], eax
mov edx, dword [ebp]
lea ecx, [esp + 0x1c]
push 0x10
push ecx
push edx
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
jne 0x40784a
mov edi, 0x41b6cc
jmp 0x407fa3
mov eax, dword [ebp]
push esi
lea edx, [esp + 0xbc]
push 4
push edx
push eax
mov byte [esp + 0xc8], 5
mov byte [esp + 0xc9], bl
mov byte [esp + 0xca], 0
mov byte [esp + 0xcb], bl
call sub.WSOCK32.dll_send
mov edx, dword [ebp]
mov ecx, 0x96
xor eax, eax
lea edi, [esp + 0xb8]
rep stosd dword es:[edi], eax
push eax
lea ecx, [esp + 0xbc]
push 0x258
push ecx
push edx
call sub.WSOCK32.dll_recv
cmp eax, ebx
jae 0x4078b1
mov edi, 0x41b6bc
jmp 0x407fa3
cmp byte [esp + 0xb8], 5
jne 0x407efe
mov al, byte [esp + 0xb9]
test al, al
je 0x4078d4
cmp al, bl
jne 0x407efe
jmp 0x4078dc
cmp al, bl
jne 0x4079bf
lea edi, [esp + 0x751]
or ecx, 0xffffffff
xor eax, eax
lea esi, [esp + 0x751]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0x6ed]
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0xba]
mov eax, ecx
mov ecx, edx
mov ebx, ecx
mov byte [esp + 0xb8], 1
shr ecx, 2
mov byte [esp + 0xb9], dl
push 0
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, eax
lea esi, [esp + 0x6f1]
mov ebx, ecx
lea edi, [esp + edx + 0xbf]
shr ecx, 2
mov byte [esp + edx + 0xbe], al
lea edx, [eax + edx + 3]
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0xbc]
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp]
push eax
push ecx
call sub.WSOCK32.dll_send
mov ecx, 0x96
xor eax, eax
lea edi, [esp + 0xb8]
push eax
rep stosd dword es:[edi], eax
mov eax, dword [ebp]
lea edx, [esp + 0xbc]
push 0x258
push edx
push eax
call sub.WSOCK32.dll_recv
cmp eax, 2
jae 0x4079a0
mov edi, 0x41b6bc
jmp 0x407659
cmp byte [esp + 0xb8], 1
jne 0x4079b5
mov al, byte [esp + 0xb9]
test al, al
je 0x4079bf
mov edi, 0x41b698
jmp 0x407659
mov eax, dword [esp + 0x7b5]
xor esi, esi
test eax, eax
mov byte [esp + 0xb8], 5
mov byte [esp + 0xb9], 1
mov byte [esp + 0xba], 0
je 0x407a04
lea ecx, [esp + 0x7b9]
push ecx
call sub.WSOCK32.dll_inet_addr
mov edx, dword [esp + 0x81d]
mov edi, eax
push edx
call sub.WSOCK32.dll_ntohs
mov edx, eax
jmp 0x407a30
mov ebx, dword [esp + 0x824]
push ebx
call sub.WSOCK32.dll_inet_addr
mov edi, eax
cmp edi, 0xffffffff
jne 0x407a1d
mov esi, 1
mov eax, dword [esp + 0x828]
push eax
call sub.WSOCK32.dll_ntohs
test esi, esi
mov edx, eax
jne 0x407a4e
mov byte [esp + 0xbb], 1
mov dword [esp + 0xbc], edi
mov word [esp + 0xc0], dx
mov ecx, 6
jmp 0x407aaa
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
mov esi, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ebx
mov byte [esp + 0xbc], cl
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0xbd]
mov eax, ecx
mov byte [esp + 0xbb], 3
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ebx
mov word [esp + ecx + 0xbd], dx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
add ecx, 2
mov edx, dword [ebp]
add ecx, 4
push 0
push ecx
lea ecx, [esp + 0xc0]
push ecx
push edx
call sub.WSOCK32.dll_send
mov ecx, 0x96
xor eax, eax
lea edi, [esp + 0xb8]
push eax
rep stosd dword es:[edi], eax
mov ecx, dword [ebp]
lea eax, [esp + 0xbc]
push 0x258
push eax
push ecx
call sub.WSOCK32.dll_recv
cmp eax, 5
jae 0x407af7
mov edi, 0x41b6bc
jmp 0x407659
cmp byte [esp + 0xb8], 5
jne 0x407b10
mov al, byte [esp + 0xb9]
test al, al
je 0x407f08
mov edi, 0x41b698
jmp 0x407659
call sub.WSOCK32.dll_htons
lea edx, [esp + 0x689]
mov word [esp + 0x1e], ax
push edx
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
mov dword [esp + 0x20], eax
jne 0x407b56
lea eax, [esp + 0x689]
push eax
call sub.WSOCK32.dll_gethostbyname
cmp eax, esi
je 0x407b56
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
mov dword [esp + 0x20], eax
mov edx, dword [ebp]
lea ecx, [esp + 0x1c]
push 0x10
push ecx
push edx
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
jne 0x407b75
mov edi, 0x41b6cc
jmp 0x407fa3
mov al, byte [esp + 0x751]
test al, al
jne 0x407bce
cmp dword [esp + 0x7b5], esi
je 0x407b99
mov ecx, dword [esp + 0x81d]
lea eax, [esp + 0x7b9]
jmp 0x407ba7
mov ecx, dword [esp + 0x828]
mov eax, dword [esp + 0x824]
push 0x41b670
push ecx
push eax
push 0x41b664
lea edx, [esp + 0xc8]
push 0x41b658
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x18
jmp 0x407e89
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
mov eax, dword [esp + 0x7b5]
mov dword [esp + 0x674], esi
cmp eax, esi
je 0x407bf9
mov ecx, dword [esp + 0x81d]
lea eax, [esp + 0x7b9]
jmp 0x407c07
mov ecx, dword [esp + 0x828]
mov eax, dword [esp + 0x824]
push ecx
push eax
lea eax, [esp + 0x1c]
push 0x41b63c
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0x10
lea ecx, [esp + 0x3c]
push 0x41b638
call sub.MFC42.DLL_CString::CString_1
lea ecx, [esp + 0x751]
push eax
lea edx, [esp + 0x3c]
push ecx
push edx
mov byte [esp + 0x680], 1
call sub.MFC42.DLL_operator_1
lea ecx, [esp + 0x6ed]
lea edx, [esp + 0x10]
push ecx
push eax
push edx
mov byte [esp + 0x680], bl
call sub.MFC42.DLL_operator
lea ecx, [esp + 0x38]
mov byte [esp + 0x674], 5
call fcn.0040cfa6
lea ecx, [esp + 0x3c]
mov byte [esp + 0x674], 4
call fcn.0040cfa6
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x40]
mov byte [esp + 0x674], 6
call sub.MFC42.DLL_CByteArray::CByteArray
mov eax, dword [esp + 0x10]
mov bl, 7
xor esi, esi
mov byte [esp + 0x674], bl
mov ecx, dword [eax - 8]
test ecx, ecx
jle 0x407cd4
mov al, byte [esi + eax]
mov edx, dword [esp + 0x48]
mov byte [esp + 0x2c], al
mov ecx, dword [esp + 0x2c]
push ecx
push edx
lea ecx, [esp + 0x48]
call sub.MFC42.DLL_CByteArray::SetAtGrow
mov eax, dword [esp + 0x10]
inc esi
cmp esi, dword [eax - 8]
jl 0x407cb0
lea ecx, [esp + 0x310]
call fcn.00401000
lea eax, [esp + 0x18]
lea ecx, [esp + 0x40]
push eax
push ecx
lea ecx, [esp + 0x318]
mov byte [esp + 0x67c], 8
call fcn.00401830
test eax, eax
jne 0x407da7
mov edi, 0x41b624
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, dword [esp + 0x830]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp]
push eax
call sub.WSOCK32.dll_closesocket
push 0x3e8
mov dword [ebp], 0xffffffff
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [esp + 0x310]
mov byte [esp + 0x674], bl
call fcn.00401030
lea ecx, [esp + 0x40]
mov byte [esp + 0x674], 6
call fcn.0040d1d4
lea ecx, [esp + 0x18]
mov byte [esp + 0x674], 4
call fcn.0040cfa6
lea ecx, [esp + 0x10]
mov byte [esp + 0x674], 0
call fcn.0040cfa6
lea ecx, [esp + 0x14]
mov dword [esp + 0x674], 0xffffffff
call fcn.0040cfa6
xor eax, eax
jmp 0x407fe9
lea ecx, [esp + 0x18]
lea edx, [esp + 0x30]
push ecx
push 0x41b608
push edx
call sub.MFC42.DLL_operator_1
push 0x41b600
push eax
lea eax, [esp + 0x34]
mov byte [esp + 0x67c], 9
push eax
call sub.MFC42.DLL_operator
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x678], 0xa
call sub.MFC42.DLL_CString::operator_1
lea ecx, [esp + 0x2c]
mov byte [esp + 0x674], 9
call fcn.0040cfa6
lea ecx, [esp + 0x30]
mov byte [esp + 0x674], 8
call fcn.0040cfa6
mov edi, dword [esp + 0x14]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0xb8]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x674], bl
mov eax, ecx
mov esi, edi
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]
lea ecx, [esp + 0x310]
call fcn.00401030
lea ecx, [esp + 0x40]
mov byte [esp + 0x674], 6
call fcn.0040d1d4
lea ecx, [esp + 0x18]
mov byte [esp + 0x674], 4
call fcn.0040cfa6
lea ecx, [esp + 0x10]
mov byte [esp + 0x674], 0
call fcn.0040cfa6
lea ecx, [esp + 0x14]
mov dword [esp + 0x674], 0xffffffff
call fcn.0040cfa6
lea edi, [esp + 0xb8]
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [ebp]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 0
push ecx
lea ecx, [esp + 0xc0]
push ecx
push edx
call sub.WSOCK32.dll_send
mov ecx, 0x96
xor eax, eax
lea edi, [esp + 0xb8]
push eax
rep stosd dword es:[edi], eax
mov ecx, dword [ebp]
lea eax, [esp + 0xbc]
push 0x258
push eax
push ecx
call sub.WSOCK32.dll_recv
cmp eax, 0x24
jge 0x407ee4
mov edi, 0x41b6bc
jmp 0x407659
lea ecx, [esp + 0xb8]
push 0x41b5e8
push ecx
call dword [sym.imp.MSVCRT.dll_strstr]
add esp, 8
test eax, eax
jne 0x407f08
mov edi, 0x41b698
jmp 0x407659
mov eax, dword [esp + 0x7b5]
test eax, eax
je 0x407fe4
mov ecx, dword [esp + 0x828]
mov edx, dword [esp + 0x824]
push 0x41b5c0
push ecx
push edx
push 0x41b664
lea eax, [esp + 0x424]
push 0x41b658
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea edi, [esp + 0x42c]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x18
repne scasb al, byte es:[edi]
mov edx, dword [ebp]
push 0
not ecx
dec ecx
push ecx
lea ecx, [esp + 0x41c]
push ecx
push edx
call sub.WSOCK32.dll_send
mov ecx, dword [ebp]
push 0
lea eax, [esp + 0x418]
push 0x258
push eax
push ecx
call sub.WSOCK32.dll_recv
lea edx, [esp + 0x414]
push 0x41b5e8
push edx
call dword [sym.imp.MSVCRT.dll_strstr]
add esp, 8
test eax, eax
jne 0x407fe4
mov edi, 0x41b5a4
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x830]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp]
push ecx
call sub.WSOCK32.dll_closesocket
push 0x3e8
mov dword [ebp], 0xffffffff
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
jmp 0x407fe9
mov eax, 1
mov ecx, dword [esp + 0x66c]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x668
ret