Function at 0x4050a8
Capabilities:
Connect socket
Get socket status
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x424
mov eax, dword [ebp + 0xc]
mov word [ebp - 0x3fc], ax
mov dword [ebp - 0x24], 0
mov dword [ebp - 0xc], 0xffffffff
mov dword [ebp - 0x3f0], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x3f4], 1
mov dword [ebp - 0x20], 0
cmp dword [ebp + 8], 0
je 0x40563b
cmp word [ebp - 0x3fc], 0
je 0x40563b
mov eax, dword [ebp + 8]
movzx eax, word [eax]
test ax, ax
je 0x40563e
lea eax, [ebp - 0x1bc]
mov dword [esp + 4], eax
mov dword [esp], 0x202
mov eax, dword [sym.imp.WS2_32.dll_WSAStartup]
call eax
sub esp, 8
test eax, eax
jne 0x405641
mov dword [esp + 4], 0xc
mov dword [esp], 0
call fcn.00402588
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x405644
movzx ebx, word [ebp - 0x3fc]
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.004027b2
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x40b33c
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.004083c0
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
js 0x405647
mov dword [esp + 4], 0x20
lea eax, [ebp - 0x1dc]
mov dword [esp], eax
call fcn.004060d0
sub esp, 8
mov dword [ebp - 0x1d8], 0
mov dword [ebp - 0x1d4], 1
mov dword [ebp - 0x1d0], 6
lea eax, [ebp - 0x3f0]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1dc]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_GetAddrInfoW]
call eax
sub esp, 0x10
test eax, eax
jne 0x40564a
mov eax, dword [ebp - 0x3f0]
mov ecx, dword [eax + 0xc]
mov eax, dword [ebp - 0x3f0]
mov edx, dword [eax + 8]
mov eax, dword [ebp - 0x3f0]
mov eax, dword [eax + 4]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_socket]
call eax
sub esp, 0xc
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
je 0x40564d
mov dword [esp + 0x10], 4
lea eax, [ebp + 0x10]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x1006
mov dword [esp + 4], 0xffff
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_setsockopt]
call eax
sub esp, 0x14
cmp eax, 0xffffffff
je 0x405650
lea eax, [ebp - 0x3f4]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x8004667e
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_ioctlsocket]
call eax
sub esp, 0xc
cmp eax, 0xffffffff
je 0x405653
mov eax, dword [ebp - 0x3f0]
mov eax, dword [eax + 0x10]
mov edx, eax
mov eax, dword [ebp - 0x3f0]
mov eax, dword [eax + 0x18]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_connect]
call eax
sub esp, 0xc
cmp eax, 0xffffffff
jne 0x405301
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
cmp eax, 0x2733
jne 0x405656
mov dword [ebp - 0x3f4], 0
lea eax, [ebp - 0x3f4]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x8004667e
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_ioctlsocket]
call eax
sub esp, 0xc
cmp eax, 0xffffffff
je 0x405659
mov dword [ebp - 0x2e0], 0
mov dword [ebp - 0x3e4], 0
mov eax, dword [ebp - 0x2e0]
cmp eax, 0x3f
ja 0x40536e
mov eax, dword [ebp - 0x2e0]
lea edx, [eax + 1]
mov dword [ebp - 0x2e0], edx
mov edx, dword [ebp - 0xc]
mov dword [ebp + eax*4 - 0x2dc], edx
mov eax, dword [ebp - 0x3e4]
cmp eax, 0x3f
ja 0x405392
mov eax, dword [ebp - 0x3e4]
lea edx, [eax + 1]
mov dword [ebp - 0x3e4], edx
mov edx, dword [ebp - 0xc]
mov dword [ebp + eax*4 - 0x3e0], edx
mov dword [esp + 4], 8
lea eax, [ebp - 0x3ec]
mov dword [esp], eax
call fcn.004060d0
sub esp, 8
mov dword [ebp - 0x3ec], 5
mov dword [ebp - 0x3e8], 0
lea eax, [ebp - 0x3ec]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x3e4]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x2e0]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0
mov eax, dword [sym.imp.WS2_32.dll_select]
call eax
sub esp, 0x14
cmp eax, 0xffffffff
je 0x40565c
lea eax, [ebp - 0x2e0]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
jne 0x405447
cmp dword [ebp + 0x14], 0
jne 0x40565f
cmp dword [ebp + 0x18], 0
jne 0x40565f
cmp dword [ebp + 0x1c], 0
je 0x40565f
mov eax, dword [ebp + 0x1c]
mov dword [eax], 1
jmp 0x40566f
cmp dword [ebp + 0x14], 0
jne 0x405467
cmp dword [ebp + 0x18], 0
jne 0x405467
cmp dword [ebp + 0x1c], 0
je 0x405467
mov eax, dword [ebp + 0x1c]
mov dword [eax], 2
jmp 0x40566f
mov eax, dword [ebp + 0x18]
sub eax, dword [ebp - 0x18]
mov ecx, eax
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp - 0x18]
add eax, edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_send]
call eax
sub esp, 0x10
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0xffffffff
je 0x405662
mov eax, dword [ebp - 0x28]
add dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp + 0x18]
jb 0x405467
cmp dword [ebp + 0x1c], 0
je 0x4054c8
mov eax, dword [ebp + 0x1c]
mov eax, dword [eax]
test eax, eax
je 0x4054c8
mov dword [ebp - 0x20], 1
cmp dword [ebp - 0x20], 0
je 0x4054d5
mov eax, dword [ebp + 0x1c]
mov eax, dword [eax]
jmp 0x4054da
mov eax, 0x400
mov dword [esp + 4], eax
mov dword [esp], 0
call fcn.00402588
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x405665
cmp dword [ebp - 0x20], 0
je 0x40550f
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call fcn.004027b2
sub eax, dword [ebp - 0x1c]
mov ecx, eax
jmp 0x405514
mov ecx, 0x400
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x1c]
add eax, edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_recv]
call eax
sub esp, 0x10
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jle 0x4055a3
mov eax, dword [ebp - 0x2c]
add dword [ebp - 0x1c], eax
cmp dword [ebp - 0x20], 0
je 0x405560
mov eax, dword [ebp + 0x1c]
mov eax, dword [eax]
cmp dword [ebp - 0x1c], eax
jb 0x4054f7
jmp 0x4055e8
mov eax, dword [ebp - 0x1c]
add eax, 0x400
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call fcn.00402588
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4054f7
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call fcn.004026f2
test eax, eax
je 0x405668
mov dword [ebp - 0x10], 0
jmp 0x405668
cmp dword [ebp - 0x2c], 0
jne 0x4055af
cmp dword [ebp - 0x1c], 0
jne 0x4055e8
cmp dword [ebp - 0x2c], 0xffffffff
jne 0x4055c9
mov eax, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call eax
cmp eax, 0x274c
jne 0x4055c9
cmp dword [ebp - 0x1c], 0
jne 0x4055e8
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call fcn.004026f2
test eax, eax
je 0x40566b
mov dword [ebp - 0x10], 0
jmp 0x40566b
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call fcn.004027b2
cmp dword [ebp - 0x1c], eax
je 0x40562b
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call fcn.00402588
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x40562b
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call fcn.004026f2
test eax, eax
je 0x40566e
mov dword [ebp - 0x10], 0
jmp 0x40566e
cmp dword [ebp + 0x1c], 0
je 0x40563b
mov eax, dword [ebp + 0x1c]
mov edx, dword [ebp - 0x1c]
mov dword [eax], edx
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
jmp 0x40566f
nop
cmp dword [ebp - 0x14], 0
je 0x405680
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.004026f2
mov eax, dword [ebp - 0x3f0]
test eax, eax
je 0x40569d
mov eax, dword [ebp - 0x3f0]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_FreeAddrInfoW]
call eax
sub esp, 4
cmp dword [ebp - 0xc], 0xffffffff
je 0x4056cb
mov dword [esp + 4], 2
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_shutdown]
call eax
sub esp, 8
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_closesocket]
call eax
sub esp, 4
mov eax, dword [ebp - 0x10]
mov ebx, dword [ebp - 4]
leave
ret