Function at 0x10022380
Capabilities:
Check for time delay via gettickcount
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x340
mov eax, dword [0x100554b0]
xor eax, ebp
mov dword [ebp - 8], eax
xor ecx, ecx
push ebx
push esi
push edi
mov dword [ebp - 0x334], ecx
mov dword [ebp - 0x330], ecx
mov dword [ebp - 0x32c], ecx
cmp dword [ebp + 0x18], ecx
jl 0x100223c5
jg 0x100223bb
mov eax, dword [ebp + 0x14]
cmp eax, 0x7fffffff
jb 0x100223c8
mov dword [ebp + 0x14], connect
mov dword [ebp + 0x18], ecx
mov eax, dword [ebp + 0x14]
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
cmp edi, 0xffffffff
jne 0x100223f2
cmp ebx, edi
jne 0x100223f2
cmp dword [ebp + 0x10], edi
jne 0x100223f2
call fcn.10022360
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.10035d36
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x18], ecx
jl 0x10022416
jg 0x100223fd
cmp eax, ecx
jbe 0x10022416
mov dword [ebp - 0x32c], eax
call fcn.1002b060
mov dword [ebp - 0x334], eax
mov dword [ebp - 0x330], edx
xor ecx, ecx
xor edx, edx
xor esi, esi
mov dword [ebp - 0x114], edx
mov dword [ebp - 0x328], 0xffffffff
mov dword [ebp - 0x21c], esi
cmp edi, 0xffffffff
je 0x1002245a
mov esi, 1
mov edx, esi
mov dword [ebp - 0x218], edi
mov dword [ebp - 0x21c], esi
mov dword [ebp - 0x110], edi
mov dword [ebp - 0x114], edx
mov dword [ebp - 0x328], edi
cmp ebx, 0xffffffff
je 0x100224cf
xor eax, eax
cmp esi, ecx
jbe 0x10022473
cmp dword [ebp + eax*4 - 0x218], ebx
je 0x10022473
inc eax
cmp eax, esi
jb 0x10022465
cmp eax, esi
jne 0x10022490
cmp esi, 0x40
jae 0x10022490
mov dword [ebp + eax*4 - 0x218], ebx
mov esi, dword [ebp - 0x21c]
inc esi
mov dword [ebp - 0x21c], esi
xor eax, eax
cmp edx, ecx
jbe 0x100224a4
cmp dword [ebp + eax*4 - 0x110], ebx
je 0x100224a4
inc eax
cmp eax, edx
jb 0x10022496
cmp eax, edx
jne 0x100224c1
cmp edx, 0x40
jae 0x100224c1
mov dword [ebp + eax*4 - 0x110], ebx
mov edx, dword [ebp - 0x114]
inc edx
mov dword [ebp - 0x114], edx
cmp ebx, dword [ebp - 0x328]
jbe 0x100224cf
mov dword [ebp - 0x328], ebx
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x324], ecx
cmp edi, 0xffffffff
je 0x10022527
mov ecx, 1
xor eax, eax
mov dword [ebp - 0x320], edi
mov dword [ebp - 0x324], ecx
test edx, edx
je 0x10022503
cmp dword [ebp + eax*4 - 0x110], edi
je 0x10022503
add eax, ecx
cmp eax, edx
jb 0x100224f4
cmp eax, edx
jne 0x10022519
cmp edx, 0x40
jae 0x10022519
mov dword [ebp + eax*4 - 0x110], edi
add dword [ebp - 0x114], ecx
cmp edi, dword [ebp - 0x328]
jbe 0x10022527
mov dword [ebp - 0x328], edi
cmp dword [ebp + 0x18], 0
jg 0x1002254e
jl 0x10022535
cmp dword [ebp + 0x14], 0
jae 0x1002254e
mov ebx, dword [ebp - 0x328]
mov edi, dword [sym.imp.WS2_32.dll_select]
mov dword [ebp - 0x338], 0
inc ebx
jmp 0x1002257c
mov ebx, dword [ebp - 0x328]
mov edi, dword [sym.imp.WS2_32.dll_select]
lea eax, [ebp - 0x340]
mov dword [ebp - 0x338], eax
inc ebx
jmp 0x1002257c
mov ecx, dword [ebp - 0x324]
mov esi, dword [ebp - 0x21c]
mov eax, dword [ebp + 0x18]
test eax, eax
jl 0x100225c2
jg 0x1002258b
cmp dword [ebp + 0x14], 0
jbe 0x100225c2
mov eax, 0x10624dd3
imul dword [ebp - 0x32c]
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [ebp - 0x32c]
mov dword [ebp - 0x340], eax
imul eax, eax, 0x3e8
sub edx, eax
imul edx, edx, 0x3e8
mov dword [ebp - 0x33c], edx
jmp 0x100225d7
mov edx, dword [ebp + 0x14]
or edx, eax
jne 0x100225d7
xor eax, eax
mov dword [ebp - 0x340], eax
mov dword [ebp - 0x33c], eax
mov eax, dword [ebp - 0x338]
push eax
neg ecx
sbb ecx, ecx
lea edx, [ebp - 0x114]
push edx
lea eax, [ebp - 0x324]
and ecx, eax
push ecx
neg esi
sbb esi, esi
lea ecx, [ebp - 0x21c]
and esi, ecx
push esi
push ebx
call edi
cmp eax, 0xffffffff
jne 0x10022668
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x10022621
cmp dword [0x10057348], 0
jne 0x1002266c
cmp eax, 0x2714
jne 0x1002266c
cmp dword [ebp + 0x18], 0
jl 0x10022570
jg 0x10022637
cmp dword [ebp + 0x14], 0
jbe 0x10022570
mov edx, dword [ebp - 0x330]
mov eax, dword [ebp - 0x334]
push edx
push eax
call fcn.1002b060
push edx
push eax
call fcn.1002b090
mov ecx, dword [ebp + 0x14]
sub ecx, eax
add esp, 0x10
mov dword [ebp - 0x32c], ecx
test ecx, ecx
jle 0x10022682
jmp 0x10022570
test eax, eax
jns 0x10022680
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.10035d36
mov esp, ebp
pop ebp
ret
jne 0x10022695
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.10035d36
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp + 8]
mov edi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
xor esi, esi
cmp ebx, 0xffffffff
je 0x100226c9
lea ecx, [ebp - 0x21c]
push ecx
push ebx
call edi
test eax, eax
je 0x100226b8
mov esi, 1
lea edx, [ebp - 0x114]
push edx
push ebx
call edi
test eax, eax
je 0x100226c9
or esi, 4
mov ebx, dword [ebp + 0xc]
cmp ebx, 0xffffffff
je 0x100226f3
lea eax, [ebp - 0x21c]
push eax
push ebx
call edi
test eax, eax
je 0x100226e2
or esi, 8
lea ecx, [ebp - 0x114]
push ecx
push ebx
call edi
test eax, eax
je 0x100226f3
or esi, 4
mov ebx, dword [ebp + 0x10]
cmp ebx, 0xffffffff
je 0x1002271d
lea edx, [ebp - 0x324]
push edx
push ebx
call edi
test eax, eax
je 0x1002270c
or esi, 2
lea eax, [ebp - 0x114]
push eax
push ebx
call edi
test eax, eax
je 0x1002271d
or esi, 4
mov ecx, dword [ebp - 8]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.10035d36
mov esp, ebp
pop ebp
ret