Function at 0x407200
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push edi
sub esp, 0x1a4
mov byte [ebp - 9], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov byte [ebp - 9], 1
mov dword [0x441950], 0
cmp byte [ebp - 9], 0
jne 0x4072aa
mov dword [ebp - 0x1c], 0
mov eax, dword [ebp - 0x1c]
cmp eax, dword [0x441950]
jb 0x407244
jmp 0x407271
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp + 0xc]
cmp eax, dword [edx*4 + 0x441630]
jne 0x40726a
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x198], eax
mov dword [ebp - 0x194], edx
jmp 0x407934
lea eax, [ebp - 0x1c]
inc dword [eax]
jmp 0x407237
cmp dword [0x441950], 0xc6
jbe 0x407294
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x198], eax
mov dword [ebp - 0x194], edx
jmp 0x407934
inc dword [0x441950]
mov edx, dword [0x441950]
mov eax, dword [ebp + 0xc]
mov dword [edx*4 + 0x441630], eax
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x20], 0
lea edi, [ebp - 0x38]
cld
mov edx, 0
mov eax, 4
mov ecx, eax
mov eax, edx
rep stosd dword es:[edi], eax
mov dword [ebp - 0x3c], 0xffffffff
mov dword [ebp - 0x40], 0
lea edi, [ebp - 0x58]
cld
mov edx, 0
mov eax, 3
mov ecx, eax
mov eax, edx
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x168]
cld
mov edx, 0
mov eax, 0x41
mov ecx, eax
mov eax, edx
rep stosd dword es:[edi], eax
mov dword [ebp - 0x16c], 0
mov dword [ebp - 0x170], 0
mov dword [ebp - 0x174], 0
mov word [ebp - 0x176], 0
mov word [ebp - 0x178], 0
mov word [ebp - 0x17a], 0
lea eax, [ebp - 0x176]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00406a3e
mov dword [ebp - 0x170], eax
cmp dword [ebp - 0x170], 0
jne 0x407367
jmp 0x4078f7
movzx eax, word [ebp - 0x176]
mov dword [esp], eax
call sub.WS2_32.DLL_htons
sub esp, 4
mov word [ebp - 0x17a], ax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x34], eax
mov word [ebp - 0x38], 2
mov dword [esp], 0x35
call sub.WS2_32.DLL_htons
sub esp, 4
mov word [ebp - 0x36], ax
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.DLL_socket
sub esp, 0xc
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0xffffffff
jne 0x4073cc
jmp 0x4078f7
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
mov eax, dword [sym.imp.KERNEL32.DLL_CreateEventA]
call eax
sub esp, 0x10
mov dword [ebp - 0x16c], eax
cmp dword [ebp - 0x16c], 0
jne 0x407409
jmp 0x4078f7
mov dword [esp + 8], 0x10
mov eax, dword [ebp - 0x16c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_WSAEventSelect
sub esp, 0xc
cmp eax, 0xffffffff
jne 0x407433
jmp 0x4078f7
mov dword [esp + 8], 0x10
lea eax, [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_connect
sub esp, 0xc
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x40746a
call sub.WS2_32.DLL_WSAGetLastError
cmp eax, 0x2733
je 0x40746a
jmp 0x4078f7
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x16c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
call eax
sub esp, 8
test eax, eax
je 0x40748d
jmp 0x4078f7
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x16c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_WSAEventSelect
sub esp, 0xc
cmp eax, 0xffffffff
je 0x4078f7
lea eax, [ebp - 0x40]
mov dword [esp + 8], eax
mov eax, 0x8004667e
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_ioctlsocket
sub esp, 0xc
cmp eax, 0xffffffff
je 0x4078f7
mov eax, dword [ebp - 0x16c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.DLL_ResetEvent]
call eax
sub esp, 4
test eax, eax
jne 0x4074f9
jmp 0x4078f7
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
lea eax, [ebp - 0x17a]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_send
sub esp, 0x10
cmp eax, 2
je 0x40752b
jmp 0x4078f7
mov dword [esp + 0xc], 0
movzx eax, word [ebp - 0x176]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x170]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_send
sub esp, 0x10
mov edx, eax
movzx eax, word [ebp - 0x176]
cmp edx, eax
je 0x407568
jmp 0x4078f7
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x16c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_WSAEventSelect
sub esp, 0xc
cmp eax, 0xffffffff
jne 0x407592
jmp 0x4078f7
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
lea eax, [ebp - 0x178]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_recv
sub esp, 0x10
cmp eax, 2
je 0x40760a
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x16c]
mov dword [esp], eax
call fcn.00407174
test al, al
je 0x40760a
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
lea eax, [ebp - 0x178]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_recv
sub esp, 0x10
cmp eax, 2
je 0x40760a
jmp 0x4078f7
movzx eax, word [ebp - 0x178]
mov dword [esp], eax
call sub.WS2_32.DLL_htons
sub esp, 4
mov word [ebp - 0x178], ax
movzx eax, word [ebp - 0x178]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x174], eax
mov eax, dword [ebp - 0x174]
test eax, eax
jne 0x407647
jmp 0x4078f7
mov dword [esp + 0xc], 0
movzx eax, word [ebp - 0x178]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x174]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_recv
sub esp, 0x10
mov edx, eax
movzx eax, word [ebp - 0x178]
cmp edx, eax
je 0x4076d5
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x16c]
mov dword [esp], eax
call fcn.00407174
test al, al
je 0x4076d5
mov dword [esp + 0xc], 0
movzx eax, word [ebp - 0x178]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x174]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_recv
sub esp, 0x10
mov edx, eax
movzx eax, word [ebp - 0x178]
cmp edx, eax
je 0x4076d5
jmp 0x4078f7
mov eax, dword [ebp - 0x16c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.DLL_CloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_closesocket
sub esp, 4
mov dword [ebp - 0x3c], 0xffffffff
mov dword [ebp - 0x1c], 0
cmp dword [ebp - 0x1c], 0xb
jbe 0x40770c
jmp 0x407755
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x174]
movzx eax, byte [eax]
mov byte [ebp - 0x17b], al
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x174]
add edx, eax
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x174]
inc eax
movzx eax, byte [eax]
mov byte [edx], al
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x174]
lea edx, [eax + 1]
movzx eax, byte [ebp - 0x17b]
mov byte [edx], al
lea eax, [ebp - 0x1c]
add dword [eax], 2
jmp 0x407704
mov dword [esp + 8], 0xc
mov eax, dword [ebp - 0x174]
mov dword [esp + 4], eax
lea eax, [ebp - 0x58]
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov dword [esp], 0
call fcn.00406a00
cmp word [ebp - 0x58], ax
jne 0x4078f7
cmp word [ebp - 0x52], 0
je 0x4077bf
movzx eax, word [ebp - 0x52]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x174]
mov dword [esp], eax
call fcn.00406f9e
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x4078f7
movzx eax, word [ebp - 0x52]
mov dword [ebp - 0x18], eax
jmp 0x4078f7
cmp word [ebp - 0x50], 0
je 0x4078f7
movzx eax, word [ebp - 0x50]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x174]
mov dword [esp], eax
call fcn.00406f9e
mov dword [ebp - 0x180], eax
cmp dword [ebp - 0x180], 0
je 0x4078f7
mov eax, dword [ebp - 0x174]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [ebp - 0x174], 0
mov dword [ebp - 0x1c], 0
movzx eax, word [ebp - 0x50]
cmp dword [ebp - 0x1c], eax
jge 0x4078e0
cmp dword [ebp - 0x14], 0
jne 0x4078e0
mov edx, dword [ebp - 0x1c]
mov eax, edx
shl eax, 5
add eax, edx
mov edx, eax
shl edx, 4
mov eax, dword [ebp - 0x180]
cmp word [eax + edx + 0x100], 2
jne 0x4078d6
mov edx, dword [ebp - 0x1c]
mov eax, edx
shl eax, 5
add eax, edx
mov edx, eax
shl edx, 4
mov eax, dword [ebp - 0x180]
cmp word [eax + edx + 0x102], 1
jne 0x4078d6
mov edx, dword [ebp - 0x1c]
mov eax, edx
shl eax, 5
add eax, edx
shl eax, 4
add eax, dword [ebp - 0x180]
add eax, 0x10e
mov dword [esp], eax
call fcn.00407078
mov dword [ebp - 0x184], eax
cmp dword [ebp - 0x184], 0
je 0x4078d6
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x184]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00407200
mov dword [ebp - 0x190], eax
mov dword [ebp - 0x18c], edx
mov eax, dword [ebp - 0x190]
mov edx, dword [ebp - 0x18c]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], edx
lea eax, [ebp - 0x1c]
inc dword [eax]
jmp 0x407812
cmp dword [ebp - 0x180], 0
je 0x4078f7
mov eax, dword [ebp - 0x180]
mov dword [esp], eax
call fcn.0040b800
cmp dword [ebp - 0x3c], 0xffffffff
je 0x40790b
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.WS2_32.DLL_closesocket
sub esp, 4
cmp dword [ebp - 0x174], 0
je 0x407922
mov eax, dword [ebp - 0x174]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x198], eax
mov dword [ebp - 0x194], edx
mov eax, dword [ebp - 0x198]
mov edx, dword [ebp - 0x194]
mov edi, dword [ebp - 4]
leave
ret