Function at 0x40e640
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x154
mov eax, dword [0x4a4014]
xor eax, esp
mov dword [esp + 0x150], eax
mov eax, dword [ebp + 0x18]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push 1
push 0
push 0
push 6
mov dword [esp + 0x3c], eax
mov edi, ecx
mov eax, dword [ebp + 0x20]
push 1
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0x24]
push 2
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x40], eax
call dword [sym.imp.WS2_32.dll_WSASocketW]
mov dword [edi], eax
cmp eax, 0xffffffff
je 0x40e732
push 0
push 0
push dword [0x4a5a04]
push eax
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
test eax, eax
jne 0x40e707
mov esi, dword [edi]
cmp esi, 0xffffffff
je 0x40e6e4
push 4
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 1
push eax
push 0x80
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
push 2
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi], 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x150]
xor ecx, esp
call fcn.0042b8bd
mov esp, ebp
pop ebp
ret 0x24
push 0x10
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 2
push eax
push dword [edi]
mov dword [esp + 0x24], 0
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x40e74f
mov ecx, edi
call fcn.0040ee60
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x150]
xor ecx, esp
call fcn.0042b8bd
mov esp, ebp
pop ebp
ret 0x24
mov esi, dword [ebp + 0x14]
mov eax, 2
mov dword [edi + 4], 0
mov word [esp + 0x14], ax
test esi, esi
jne 0x40e860
push ebx
call dword [sym.imp.WS2_32.dll_gethostbyname]
movsx ecx, word [eax + 0xa]
mov eax, dword [eax + 0xc]
push ecx
push dword [eax]
lea eax, [esp + 0x20]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
push dword [ebp + 0xc]
mov dword [esp + 0x1c], eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x16], ax
lea eax, [esp + 0x28]
push eax
push 0x8004667e
push dword [edi]
mov dword [esp + 0x34], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push 0x10
lea eax, [esp + 0x18]
push eax
push dword [edi]
call dword [sym.imp.WS2_32.dll_connect]
mov eax, dword [ebp + 0x28]
mov ecx, dword [edi]
mov dword [esp + 0x30], eax
lea eax, [esp + 0x30]
push eax
push esi
lea eax, [esp + 0x58]
mov dword [esp + 0x5c], ecx
push eax
push esi
push ecx
mov dword [esp + 0x64], 1
mov dword [esp + 0x48], esi
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x40ead8
mov ebx, dword [edi]
mov esi, 1
cmp ebx, 0xffffffff
je 0x40e841
push 4
lea eax, [esp + 0x28]
mov dword [esp + 0x28], esi
push eax
push 0x80
push 0xffff
push ebx
call dword [sym.imp.WS2_32.dll_setsockopt]
push 2
push ebx
call dword [sym.imp.WS2_32.dll_shutdown]
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, esi
mov dword [edi], 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x150]
xor ecx, esp
call fcn.0042b8bd
mov esp, ebp
pop ebp
ret 0x24
push dword [esp + 0x2c]
call dword [sym.imp.WS2_32.dll_gethostbyname]
movsx ecx, word [eax + 0xa]
mov eax, dword [eax + 0xc]
push ecx
push dword [eax]
lea eax, [esp + 0x20]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
push dword [ebp + 0x1c]
mov dword [esp + 0x1c], eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x16], ax
lea eax, [esp + 0x38]
push eax
push 0x8004667e
push dword [edi]
mov dword [esp + 0x44], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push 0x10
lea eax, [esp + 0x18]
push eax
push dword [edi]
call dword [sym.imp.WS2_32.dll_connect]
mov eax, dword [ebp + 0x28]
mov ecx, dword [edi]
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x3c]
push eax
push 0
lea eax, [esp + 0x58]
mov dword [esp + 0x5c], ecx
push eax
push 0
push ecx
mov dword [esp + 0x64], 1
mov dword [esp + 0x54], 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x40e95a
mov ebx, dword [edi]
mov esi, 1
cmp ebx, 0xffffffff
je 0x40e93b
push 4
lea eax, [esp + 0x28]
mov dword [esp + 0x28], esi
push eax
push 0x80
push 0xffff
push ebx
call dword [sym.imp.WS2_32.dll_setsockopt]
push 2
push ebx
call dword [sym.imp.WS2_32.dll_shutdown]
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi], 0xffffffff
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x150]
xor ecx, esp
call fcn.0042b8bd
mov esp, ebp
pop ebp
ret 0x24
mov ebx, dword [sym.imp.WS2_32.dll_setsockopt]
lea eax, [esp + 0x2c]
push 4
push eax
push 0x1005
push 0xffff
push dword [edi]
mov dword [esp + 0x40], 0x7530
call ebx
push 4
lea eax, [esp + 0x30]
push eax
push 0x1006
push 0xffff
push dword [edi]
call ebx
push 0
push 0
lea eax, [esp + 0x38]
mov dword [esp + 0x4c], 1
push eax
push 0
push 0
push 0xc
lea eax, [esp + 0x5c]
mov dword [esp + 0x60], 0x1388
push eax
push 0x98000004
push dword [edi]
mov dword [esp + 0x70], 0x1388
mov dword [esp + 0x54], 0
call dword [sym.imp.WS2_32.dll_WSAIoctl]
sub esi, 1
je 0x40ea69
sub esi, 1
je 0x40ea51
sub esi, 1
je 0x40ea39
mov esi, dword [edi]
cmp esi, 0xffffffff
je 0x40ea19
push 4
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 1
push eax
push 0x80
push 0xffff
push esi
call ebx
push 2
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi], 0xffffffff
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x150]
xor ecx, esp
call fcn.0042b8bd
mov esp, ebp
pop ebp
ret 0x24
push dword [esp + 0x28]
mov ecx, edi
push dword [esp + 0x14]
push dword [ebp + 0xc]
push dword [esp + 0x30]
call fcn.0040f380
jmp 0x40ea7c
push dword [esp + 0x28]
mov ecx, edi
push dword [esp + 0x14]
push dword [ebp + 0xc]
push dword [esp + 0x30]
call fcn.0040f130
jmp 0x40ea7c
push ecx
push dword [esp + 0x14]
mov ecx, edi
push dword [ebp + 0xc]
push dword [esp + 0x30]
call fcn.0040f020
mov ebx, eax
test ebx, ebx
je 0x40ead8
mov esi, dword [edi]
cmp esi, 0xffffffff
je 0x40eab9
push 4
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], 1
push eax
push 0x80
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
push 2
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, ebx
mov dword [edi], 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x150]
xor ecx, esp
call fcn.0042b8bd
mov esp, ebp
pop ebp
ret 0x24
push 0x30
call dword [sym.imp.mfc140u.dll_operator_2]
push 0x30
mov esi, eax
push 0
push esi
call sub.VCRUNTIME140.dll_memset
add esp, 0x10
mov dword [esi + 0x14], edi
mov dword [esi + 0x18], 1
mov dword [esi + 0x2c], 0
mov dword [esi + 0x1c], 0
push esi
push 0
push 0
push dword [0x4a5a04]
mov dword [esi + 0x28], 0
call dword [sym.imp.KERNEL32.dll_PostQueuedCompletionStatus]
mov ecx, dword [esp + 0x15c]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0042b8bd
mov esp, ebp
pop ebp
ret 0x24