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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x144
mov eax, dword [0x40d2a4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
and dword [ebp - 0x12c], 0
and dword [ebp - 0x118], 0
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov ebx, ecx
mov dword [ebp - 0x140], eax
xor eax, eax
mov dword [ebp - 0x11c], edx
mov dword [ebp - 0x120], esi
mov word [ebp - 0x114], ax
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x130], edi
test ebx, ebx
je 0x40b6af
test dword [0x40d3c8], 0x80000000
je 0x40b117
push edi
push 0x40376c
call dword [sym.imp.msvcrt.dll_printf]
push 1
call fcn.0040c9f9
add esp, 0xc
push eax
mov eax, dword [ebp - 0x11c]
push ecx
mov ecx, eax
lea edx, [edi + eax]
call fcn.00405041
mov edx, dword [ebp - 0x11c]
movzx eax, word [ebx]
push 2
pop ecx
cmp ax, cx
je 0x40b127
cmp eax, 0x17
jne 0x40b130
mov eax, 0x3500
mov word [ebx + 2], ax
test byte [0x40d3c8], 8
jne 0x40b145
cmp edi, 0x200
jg 0x40b145
xor ecx, ecx
jmp 0x40b148
xor ecx, ecx
inc ecx
movzx eax, word [edx]
mov dword [ebp - 0x13c], eax
xor eax, eax
mov dword [ebp - 0x128], eax
mov eax, dword [0x40d3c4]
mov dword [ebp - 0x124], ecx
test eax, eax
jle 0x40b669
test ecx, ecx
jne 0x40b336
cmp dword [0x4106d4], 0xffffffff
jne 0x40b1b5
push ecx
push 2
pop eax
push eax
movzx eax, word [ebx]
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [0x4106d4], eax
cmp eax, 0xffffffff
jne 0x40b1b5
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b5ba
push 0x4037d0
jmp 0x40b37f
cmp dword [ebp - 0x118], 0
jne 0x40b1e1
push dword [ebx + 0x20]
push ebx
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x40b2cc
mov dword [ebp - 0x118], 1
push 0
push edi
push dword [ebp - 0x11c]
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x40b411
mov eax, dword [0x40d3c0]
mov dword [ebp - 0x138], eax
test eax, eax
jg 0x40b218
mov dword [ebp - 0x138], 1
and dword [ebp - 0x134], 0
mov eax, dword [0x4106d4]
lea ecx, [ebp - 0x138]
push ecx
push 0
push 0
lea ecx, [ebp - 0x110]
mov dword [ebp - 0x10c], eax
push ecx
push eax
mov dword [ebp - 0x110], 1
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
js 0x40b3e9
je 0x40b39d
push 0
push 0x10000
push esi
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
test edi, edi
je 0x40b38b
cmp edi, 0xffffffff
je 0x40b38b
mov eax, dword [ebp - 0x13c]
mov dword [ebp - 0x12c], 1
cmp ax, word [esi]
je 0x40b2e5
test dword [0x40d3c8], 0x80000000
je 0x40b21f
push 0x403854
call dword [sym.imp.msvcrt.dll_printf]
push 1
call fcn.0040c9f9
pop ecx
pop ecx
push eax
push ecx
lea edx, [esi + edi]
mov ecx, esi
call fcn.00405041
jmp 0x40b21f
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b5ba
push 0x4037e4
jmp 0x40b37f
mov eax, dword [0x40d3c8]
push 2
pop ecx
test al, 0x20
jne 0x40b5ed
test byte [esi + 2], cl
je 0x40b5ed
test cl, al
je 0x40b30e
push 0x403870
call dword [sym.imp.msvcrt.dll_printf]
pop ecx
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_closesocket]
or dword [0x4106d4], 0xffffffff
mov eax, dword [0x40d3c4]
mov edi, dword [ebp - 0x130]
mov dword [ebp - 0x124], 1
cmp dword [0x4106d4], 0xffffffff
mov dword [ebp - 0x128], eax
jne 0x40b459
movzx eax, word [ebx]
push 0
push 1
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [0x4106d4], eax
cmp eax, 0xffffffff
jne 0x40b42a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b5ba
push 0x403790
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
jmp 0x40b5ba
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b400
push 0x403848
jmp 0x40b3f9
push 0x4037fc
call dword [sym.imp.msvcrt.dll_printf]
push dword [ebp - 0x138]
push 0x403814
call dword [sym.imp.msvcrt.dll_printf]
add esp, 0xc
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b3da
push dword [ebp - 0x138]
push 0x403834
call dword [sym.imp.msvcrt.dll_printf]
pop ecx
pop ecx
mov dword [ebp - 0x12c], 1
jmp 0x40b5ba
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b400
push 0x4037f4
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
call fcn.0040b6c9
and dword [ebp - 0x118], 0
jmp 0x40b5ba
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b5ba
push 0x4037ec
jmp 0x40b37f
push dword [ebx + 0x20]
push ebx
push eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40b459
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b5a7
push 0x4037a4
jmp 0x40b5a0
push edi
call dword [sym.imp.WS2_32.dll_htons]
push 0
push 2
mov word [ebp - 0x114], ax
pop eax
push eax
lea eax, [ebp - 0x114]
push eax
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x40b58a
push 0
push edi
push dword [ebp - 0x11c]
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x40b58a
push 2
pop eax
mov word [ebp - 0x114], ax
push 0
movzx eax, ax
push eax
push esi
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_recv]
mov ecx, eax
test ecx, ecx
jle 0x40b4e2
mov ax, word [ebp - 0x114]
add esi, ecx
sub ax, cx
mov word [ebp - 0x114], ax
movzx eax, ax
jne 0x40b4b1
cmp ecx, 0xffffffff
jne 0x40b51b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b504
push 0x4037c4
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_closesocket]
mov esi, dword [ebp - 0x120]
jmp 0x40b5b3
mov eax, dword [ebp - 0x120]
mov esi, eax
movzx eax, word [eax]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edi, ax
mov eax, edi
mov ecx, edi
mov word [ebp - 0x114], ax
test cx, cx
je 0x40b5e5
push 0
movzx eax, ax
push eax
push esi
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_recv]
mov edx, eax
test edx, edx
jle 0x40b57a
mov ax, word [ebp - 0x114]
add esi, edx
sub ax, dx
movzx ecx, ax
mov word [ebp - 0x114], ax
mov eax, ecx
test cx, cx
jne 0x40b544
cmp edx, 0xffffffff
jne 0x40b5e5
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
jmp 0x40b4ed
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push 2
pop eax
test byte [0x40d3c8], al
je 0x40b5a7
push 0x4037b4
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_closesocket]
or dword [0x4106d4], 0xffffffff
mov edx, dword [ebp - 0x128]
mov eax, dword [0x40d3c4]
inc edx
mov dword [ebp - 0x128], edx
cmp edx, eax
jge 0x40b669
mov ecx, dword [ebp - 0x124]
mov edi, dword [ebp - 0x130]
jmp 0x40b16c
mov eax, dword [0x40d3c8]
push 2
pop ecx
test cl, al
je 0x40b64a
test eax, eax
jns 0x40b604
push edi
push 0x403884
call dword [sym.imp.msvcrt.dll_printf]
pop ecx
jmp 0x40b60f
push 0x4038ac
call dword [sym.imp.msvcrt.dll_printf]
cmp edi, 0x10000
pop ecx
sbb eax, eax
and eax, edi
movzx eax, ax
mov edx, eax
mov word [ebp - 0x114], ax
cmp edx, 0xc
jb 0x40b64a
mov esi, edx
add esi, dword [ebp - 0x120]
push 1
call fcn.0040c9f9
pop ecx
push eax
push ecx
mov ecx, dword [ebp - 0x120]
mov edx, esi
call fcn.00405041
push dword [0x4106d4]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 0x140]
or dword [0x4106d4], 0xffffffff
mov dword [eax], edi
xor eax, eax
jmp 0x40b6b2
mov eax, dword [0x4106d4]
cmp eax, 0xffffffff
je 0x40b681
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
or dword [0x4106d4], 0xffffffff
cmp dword [ebp - 0x124], 0
jne 0x40b698
cmp dword [ebp - 0x12c], 0
je 0x40b6af
or eax, 0xffffffff
jmp 0x40b6b2
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
sub eax, 0x72
neg eax
push 2
sbb eax, eax
pop ecx
and eax, ecx
add eax, 0xfffffffb
jmp 0x40b6b2
push 0xfffffffffffffffb
pop eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040c480
leave
ret 0x10