Function at 0x40e9e0
Capabilities:
Connect socket
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
sub esp, 0x970
push ebx
push ebp
push esi
push edi
xor edi, edi
mov esi, 2
push edi
push 1
mov ebp, ecx
push esi
call sub.WSOCK32.dll_socket
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40ea10
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x970
ret
mov ecx, dword [ebp + 0xf2c]
xor eax, eax
mov dword [esp + 0x1c], eax
lea edx, [esp + 0x2c]
mov dword [esp + 0x20], eax
push edx
mov dword [esp + 0x28], eax
push 0x8004667e
push ebx
mov dword [esp + 0x34], eax
mov dword [esp + 0x2c], ecx
mov word [esp + 0x2a], di
mov word [esp + 0x28], si
mov dword [esp + 0x38], 1
call sub.WSOCK32.dll_ioctlsocket
test eax, eax
je 0x40ea65
push ebx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x970
ret
lea eax, [esp + 0x1c]
push 0x10
push eax
push ebx
call sub.WSOCK32.dll_bind
test eax, eax
je 0x40ea89
push ebx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x970
ret
mov ax, word [ebp + 0xf20]
mov edx, dword [ebp + 0xf1c]
xor ecx, ecx
push eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], ecx
call sub.WSOCK32.dll_htons
lea ecx, [esp + 0x1c]
push 0x10
push ecx
push ebx
mov word [esp + 0x2a], ax
mov word [esp + 0x28], si
call sub.WSOCK32.dll_connect
cmp eax, edi
je 0x40eb36
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x40eaec
push ebx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x970
ret
mov edx, dword [ebp + 0xf24]
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x7c]
push edi
push ecx
push edi
push edi
mov dword [esp + 0x90], ebx
mov dword [esp + 0x8c], 1
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], edi
call sub.WSOCK32.dll_select
cmp eax, 1
jge 0x40eb36
push ebx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x970
ret
mov esi, dword [ebp + 0xf3c]
mov ecx, 0x10
lea edi, [esp + 0x38]
rep movsd dword es:[edi], dword [esi]
mov esi, 1
xor edi, edi
push edi
lea edx, [esp + 0x3c]
push 0x40
push edx
push ebx
call sub.WSOCK32.dll_send
cmp eax, 0x40
jae 0x40ebc2
cmp eax, edi
je 0x40ed8d
jge 0x40eb7b
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x40ed8d
mov eax, dword [ebp + 0xf24]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x7c]
push edi
push edx
shl eax, 1
push edi
push edi
mov dword [esp + 0x90], ebx
mov dword [esp + 0x8c], esi
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edi
call sub.WSOCK32.dll_select
cmp eax, esi
jge 0x40eb4e
push ebx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x970
ret
xor esi, esi
mov eax, dword [ebp + 0xf24]
lea ecx, [esp + 0x30]
push ecx
push edi
lea edx, [esp + 0x80]
push edi
lea eax, [eax + eax*2]
push edx
push edi
mov dword [esp + 0x90], ebx
mov dword [esp + 0x8c], 1
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], edi
call sub.WSOCK32.dll_select
cmp eax, 1
jl 0x40ed8d
lea eax, [esp + 0x14]
mov dword [esp + 0x14], edi
push eax
push 0x4004667f
push ebx
call sub.WSOCK32.dll_ioctlsocket
mov eax, dword [esp + 0x14]
push edi
lea ecx, [eax + esi]
cmp ecx, 0x804
ja 0x40ec34
lea edx, [esp + esi + 0x180]
push eax
push edx
jmp 0x40ec44
mov eax, 0x804
lea ecx, [esp + esi + 0x180]
sub eax, esi
push eax
push ecx
push ebx
call sub.WSOCK32.dll_recv
cmp eax, 1
jl 0x40ed8d
add esi, eax
mov eax, dword [esp + 0x17c]
cmp esi, 4
jl 0x40ec68
cmp eax, 0x4b4341
jne 0x40ec74
cmp esi, 0x804
jb 0x40ebc4
xor edx, edx
cmp esi, 4
setl dl
dec edx
and eax, edx
cmp eax, 0x335245
ja 0x40ed4a
je 0x40ed13
cmp eax, 0x315245
je 0x40ecdc
cmp eax, 0x325245
jne 0x40ed80
mov al, byte [ebp + 0xf60]
test al, al
jne 0x40eccb
mov eax, dword [0x42b01c]
push 0x2010
mov ecx, dword [eax + 0x98c]
mov edx, dword [eax + 0x9a0]
push ecx
push edx
push edi
call dword [sym.imp.USER32.dll_MessageBoxA]
mov byte [ebp + 0xf60], 1
mov edi, 3
jmp 0x40ed82
mov al, byte [ebp + 0xf60]
test al, al
jne 0x40ed05
mov eax, dword [0x42b01c]
push 0x2010
mov ecx, dword [eax + 0x98c]
mov edx, dword [eax + 0x99c]
push ecx
push edx
push edi
call dword [sym.imp.USER32.dll_MessageBoxA]
mov byte [ebp + 0xf60], 1
mov edi, 2
jmp 0x40ed82
mov al, byte [ebp + 0xf60]
test al, al
jne 0x40ed3c
mov eax, dword [0x42b01c]
push 0x2010
mov ecx, dword [eax + 0x98c]
mov edx, dword [eax + 0x9a4]
push ecx
push edx
push edi
call dword [sym.imp.USER32.dll_MessageBoxA]
mov byte [ebp + 0xf60], 1
mov edi, 4
jmp 0x40ed82
cmp eax, 0x4b4341
je 0x40ed5f
cmp eax, 0x52454a
jne 0x40ed80
mov edi, 1
jmp 0x40ed82
cmp esi, 0x804
mov edi, 5
jl 0x40ed80
lea eax, [esp + 0x180]
push eax
call fcn.0041dbb0
add esp, 4
test al, al
jne 0x40ed82
xor edi, edi
cmp edi, 5
mov dword [ebp + 0xf34], edi
je 0x40eda0
push ebx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x970
ret
lea ecx, [esp + 0x180]
push ecx
mov ecx, ebp
call fcn.0040f0f0
cmp byte [ebp + 6], 1
ja 0x40edc8
cmp byte [ebp + 7], 0x18
jae 0x40edc8
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x970
ret
mov ecx, ebp
call fcn.0040d030
test eax, eax
setne dl
mov ecx, ebp
mov byte [ebp + 0xf6a], dl
call fcn.0040d190
test eax, eax
setne al
mov ecx, ebp
mov byte [ebp + 0xf6b], al
call fcn.0040d1f0
test eax, eax
setne cl
mov byte [ebp + 0xf6c], cl
mov ecx, ebp
call fcn.0040d280
test eax, eax
mov eax, dword [esp + 0x4c]
setne dl
test eax, eax
mov byte [ebp + 0xf6d], dl
je 0x40ee28
mov ecx, ebp
call fcn.0040d030
test eax, eax
mov byte [esp + 0x13], 1
jne 0x40ee2d
mov byte [esp + 0x13], 0
mov eax, dword [esp + 0x4c]
test eax, eax
jne 0x40ee3d
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x40ee56
mov ecx, ebp
call fcn.0040d030
mov ecx, ebp
mov esi, eax
call fcn.0040cff0
add esi, eax
mov word [ebp + 0x64e], si
mov ecx, ebp
call fcn.0040d0d0
mov ecx, ebp
mov word [ebp + 0x85b], ax
call fcn.0040d130
test eax, eax
je 0x40ee7c
mov ecx, ebp
call fcn.0040d130
mov byte [ebp + 0x820], al
mov al, byte [ebp + 0x826]
test al, al
je 0x40eea5
mov eax, dword [esp + 0x48]
test eax, eax
jne 0x40ee9a
mov eax, dword [esp + 0x40]
test eax, eax
jne 0x40ee9a
xor eax, eax
jmp 0x40ee9f
mov eax, 1
mov byte [ebp + 0x826], al
mov al, byte [ebp + 0x813]
test al, al
je 0x40eece
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x40eec3
mov eax, dword [esp + 0x4c]
test eax, eax
jne 0x40eec3
xor eax, eax
jmp 0x40eec8
mov eax, 1
mov byte [ebp + 0x813], al
mov al, byte [ebp + 0x818]
test al, al
je 0x40eee7
mov al, byte [esp + 0x13]
test al, al
setne al
mov byte [ebp + 0x818], al
mov dl, byte [ebp + 0x813]
mov cl, byte [ebp + 0x81b]
test dl, dl
setne al
test cl, cl
je 0x40ef0b
mov cl, byte [esp + 0x13]
test cl, cl
setne cl
mov byte [ebp + 0x81b], cl
mov cl, byte [ebp + 0x83e]
test cl, cl
je 0x40ef20
test al, al
setne dl
mov byte [ebp + 0x83e], dl
mov cl, byte [ebp + 0x8ca]
test cl, cl
je 0x40ef35
test al, al
setne cl
mov byte [ebp + 0x8ca], cl
mov cl, byte [ebp + 0x8cb]
test cl, cl
je 0x40ef4a
test al, al
setne dl
mov byte [ebp + 0x8cb], dl
mov cl, byte [ebp + 0x8c5]
test cl, cl
je 0x40ef5f
test al, al
setne al
mov byte [ebp + 0x8c5], al
mov ecx, ebp
call fcn.0040d130
test eax, eax
mov eax, dword [esp + 0x3c]
setne cl
test eax, eax
mov byte [ebp + 0xf69], cl
jne 0x40efae
mov eax, dword [esp + 0x4c]
test eax, eax
jne 0x40efae
mov eax, dword [esp + 0x48]
test eax, eax
jne 0x40efae
mov ecx, ebp
call fcn.0040d0d0
test eax, eax
je 0x40efa5
mov eax, dword [esp + 0x44]
test eax, eax
setne dl
mov byte [ebp + 0x815], dl
jmp 0x40efc8
mov byte [ebp + 0x815], 0
jmp 0x40efc8
mov ecx, ebp
call fcn.0040d130
test eax, eax
je 0x40efc8
mov eax, dword [esp + 0x48]
test eax, eax
setne al
mov byte [ebp + 0x815], al
mov ecx, ebp
call fcn.0040d070
test eax, eax
setne al
mov byte [ebp + 0xf68], al
mov byte [ebp + 0x83a], al
mov eax, dword [esp + 0x40]
test eax, eax
jne 0x40f01c
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x40f01c
mov eax, dword [esp + 0x48]
test eax, eax
jne 0x40f01c
mov eax, dword [esp + 0x44]
test eax, eax
jne 0x40f01c
mov byte [ebp + 0x826], 1
mov byte [ebp + 0x813], 1
mov byte [ebp + 0x815], 1
mov byte [ebp + 0x820], 1
lea ecx, [ebp + 0x5e8]
xor edi, edi
push str._HASP_
push ecx
mov word [ebp + 0x82f], di
mov word [ebp + 0x831], di
mov word [ebp + 0x833], di
mov word [ebp + 0x835], di
mov word [ebp + 0x837], di
mov word [ebp + 0x841], di
mov word [ebp + 0x8ce], di
mov word [ebp + 0x8cc], di
mov word [ebp + 0x83f], di
mov word [ebp + 0x8c7], di
mov byte [ebp + 0x64a], 0
call fcn.004121d0
mov esi, eax
add esp, 8
cmp esi, edi
je 0x40f0c4
mov byte [esi], 0
dec esi
mov edx, esi
sub edx, ebp
sub edx, 0x40d
cmp edx, 0x1db
jle 0x40f0c4
mov edi, dword [sym.imp.MSVCRT.dll_isspace]
movsx eax, byte [esi]
push eax
call edi
add esp, 4
test eax, eax
je 0x40f0c4
mov byte [esi], 0
dec esi
mov ecx, esi
sub ecx, ebp
sub ecx, 0x40d
cmp ecx, 0x1db
jg 0x40f0a1
pop edi
mov dword [ebp + 0xf28], ebx
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x970
ret