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

Disassembly:
push edi
push esi
push ebx
sub esp, 0x150
lea eax, [esp + 0x3c]
mov ebx, dword [esp + 0x160]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x168]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x164]
mov dword [esp], eax
call fcn.004051b5
test al, al
jne 0x405365
xor eax, eax
jmp 0x4054a2
lea esi, [esp + 0x33]
mov dword [esp + 8], 9
mov dword [esp + 4], 0
mov dword [esp], esi
call fcn.004129e4
lea eax, [esp + 0x3e]
mov dword [esp + 8], 2
mov byte [esp + 0x33], 4
mov byte [esp + 0x34], 1
mov dword [esp + 4], eax
lea eax, [esp + 0x35]
mov dword [esp], eax
call fcn.00412aa3
lea eax, [esp + 0x40]
mov dword [esp + 8], 4
mov dword [esp + 4], eax
lea eax, [esp + 0x37]
mov dword [esp], eax
call fcn.00412aa3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 9
mov dword [esp + 4], esi
mov dword [esp], ebx
mov byte [esp + 0x3b], 0
call sub.WS2_32.dll_send
sub esp, 0x10
cmp eax, 9
jne 0x40535e
lea esi, [esp + 0x2f]
mov dword [esp + 8], 4
mov dword [esp + 4], 0
lea edi, [esp + 0x4c]
mov dword [esp], esi
call fcn.004129e4
lea eax, [ebx + 1]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [esp + 0x50], ebx
mov dword [esp + 0x4c], 1
call sub.WS2_32.dll_select
sub esp, 0x14
test eax, eax
jle 0x40535e
mov dword [esp + 4], edi
mov dword [esp], ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
push edx
push edx
je 0x40535e
mov dword [esp + 0xc], 0
mov dword [esp + 8], 4
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.WS2_32.dll_recv
sub esp, 0x10
cmp eax, 4
jne 0x40535e
xor eax, eax
cmp byte [esp + 0x2f], 0
jne 0x40549f
xor eax, eax
cmp byte [esp + 0x30], 0x5a
sete al
and eax, 1
add esp, 0x150
pop ebx
pop esi
pop edi
ret
push ebp
push edi
or ecx, 0xffffffff
push esi
push ebx
xor eax, eax
sub esp, 0x34c
mov edi, dword [esp + 0x364]
mov esi, dword [esp + 0x360]
repne scasb al, byte es:[edi]
not ecx
lea ebx, [ecx + 9]
cmp ebx, 0x200
jle 0x4054df
xor eax, eax
jmp 0x405670
lea ebp, [esp + 0x140]
mov dword [esp + 8], 0x200
mov dword [esp + 4], 0
mov dword [esp], ebp
call fcn.004129e4
movzx eax, word [esp + 0x368]
mov byte [esp + 0x140], 4
mov byte [esp + 0x141], 1
mov dword [esp], eax
call sub.WS2_32.dll_htons
push ecx
mov word [esp + 0x2e], ax
lea eax, [esp + 0x2e]
mov dword [esp + 8], 2
mov dword [esp + 4], eax
lea eax, [esp + 0x142]
mov dword [esp], eax
call fcn.00412aa3
lea eax, [esp + 0x30]
mov dword [esp + 8], 4
mov dword [esp + 0x30], 0x1000000
mov dword [esp + 4], eax
lea eax, [esp + 0x144]
mov dword [esp], eax
call fcn.00412aa3
mov edi, dword [esp + 0x364]
mov byte [esp + 0x148], 0
xor eax, eax
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x364]
not ecx
dec ecx
mov dword [esp + 4], eax
lea eax, [esp + 0x149]
mov dword [esp + 8], ecx
mov dword [esp], eax
call fcn.00412aa3
mov byte [esp + ebx + 0x140], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], ebp
mov dword [esp], esi
call sub.WS2_32.dll_send
sub esp, 0x10
cmp ebx, eax
jne 0x4054d8
lea ebx, [esp + 0x34]
mov dword [esp + 8], 8
mov dword [esp + 4], 0
lea ebp, [esp + 0x3c]
mov dword [esp], ebx
call fcn.004129e4
lea eax, [esi + 1]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], ebp
mov dword [esp], eax
mov dword [esp + 0x40], esi
mov dword [esp + 0x3c], 1
call sub.WS2_32.dll_select
sub esp, 0x14
test eax, eax
jle 0x4054d8
mov dword [esp + 4], ebp
mov dword [esp], esi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
push edx
push edx
je 0x4054d8
mov dword [esp + 0xc], 0
mov dword [esp + 8], 8
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.WS2_32.dll_recv
sub esp, 0x10
cmp eax, 8
jne 0x4054d8
cmp byte [esp + 0x35], 0x5a
sete al
add esp, 0x34c
pop ebx
pop esi
pop edi
pop ebp
ret
push edi
push esi
push ebx
sub esp, 0x420
mov ebx, dword [esp + 0x430]
lea eax, [esp + 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov byte [esp + 0x1c], 5
mov dword [esp + 4], eax
mov byte [esp + 0x1d], 1
mov dword [esp], ebx
mov byte [esp + 0x1e], 0
call sub.WS2_32.dll_send
sub esp, 0x10
movzx edx, byte [esp + 0x1d]
add edx, 2
cmp eax, edx
je 0x4056d0
xor eax, eax
jmp 0x405807
lea esi, [esp + 0x1a]
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], esi
call fcn.004129e4
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.WS2_32.dll_recv
sub esp, 0x10
cmp eax, 2
jne 0x4056c9
cmp byte [esp + 0x1a], 5
jne 0x4056c9
cmp byte [esp + 0x1b], 0
jne 0x4056c9
mov edi, dword [esp + 0x434]
xor eax, eax
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x434]
mov byte [esp + 0x20], 5
lea edi, [esp + 0x20]
not ecx
mov byte [esp + 0x21], 1
mov byte [esp + 0x22], 0
dec ecx
mov byte [esp + 0x23], 3
mov dword [esp + 4], eax
lea eax, [esp + 0x25]
movzx esi, cl
mov dword [esp + 8], esi
mov byte [esp + 0x24], cl
mov dword [esp], eax
call fcn.00412aa3
movzx eax, word [esp + 0x438]
mov dword [esp], eax
call sub.WS2_32.dll_htons
push edx
mov word [esp + 0x18], ax
lea eax, [esp + 0x18]
mov dword [esp + 8], 2
mov dword [esp + 4], eax
lea eax, [edi + esi + 5]
add esi, 7
mov dword [esp], eax
call fcn.00412aa3
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp + 4], edi
mov dword [esp], ebx
call sub.WS2_32.dll_send
sub esp, 0x10
cmp esi, eax
jne 0x4056c9
lea eax, [esp + 0x220]
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp], ebx
mov dword [esp + 4], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
test eax, eax
js 0x4056c9
xor eax, eax
cmp byte [esp + 0x220], 5
jne 0x405804
xor eax, eax
cmp byte [esp + 0x221], 0
sete al
and eax, 1
add esp, 0x420
pop ebx
pop esi
pop edi
ret
push edi
push esi
push ebx
sub esp, 0x220
mov ebx, dword [esp + 0x234]
mov edi, dword [esp + 0x238]
mov dword [esp], str.PTLLjPq__6:_S__qq9_G.y
mov esi, dword [esp + 0x230]
call fcn.004081aa
mov dword [esp + 0x14], ebx
mov dword [esp + 0xc], ebx
lea ebx, [esp + 0x20]
mov dword [esp + 0x18], edi
mov dword [esp + 0x10], edi
mov dword [esp + 8], eax
mov dword [esp + 4], 0x200
mov dword [esp], ebx
call fcn.004127a8
mov dword [esp + 0xc], 0
mov edi, eax
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.WS2_32.dll_send
sub esp, 0x10
cmp edi, eax
je 0x405888
xor eax, eax
jmp 0x4058df
mov dword [esp + 8], 0x200
mov dword [esp + 4], 0
mov dword [esp], ebx
call fcn.004129e4
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x200
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.WS2_32.dll_recv
sub esp, 0x10
test eax, eax
jle 0x405884
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x422ee8
mov dword [esp], 0
call fcn.004125de
inc eax
setne al
add esp, 0x220
pop ebx
pop esi
pop edi
ret
push ebx
mov ebx, dword [esp + 0xc]
mov eax, dword [esp + 8]
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov ebx, dword [ebx]
cmp ebx, 1
je 0x405931
jb 0x40591f
cmp ebx, 2
je 0x405943
cmp ebx, 3
jne 0x405955
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
pop ebx
jmp 0x405811
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
pop ebx
jmp 0x405328
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
pop ebx
jmp 0x4054ac
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
pop ebx
jmp 0x40567b
mov al, 1
pop ebx
ret