Function at 0x1012ed40
Capabilities:
Get socket status
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
mov eax, 0x303c
call fcn.1014e020
mov eax, dword [0x101db014]
xor eax, ebp
mov dword [ebp - 0x10], eax
push dword [0x101de1f0]
call dword [sym.imp.kernel32.dll_TlsGetValue]
test eax, eax
je 0x1012f34d
mov ecx, dword [eax + 0xe0]
mov edx, ecx
and edx, 0x1002
cmp edx, 2
je 0x1012f394
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x1012f3a6
mov edi, dword [ebp + 8]
xor eax, eax
mov dword [ebp - 0x1014], eax
mov dword [ebp - 0x2018], eax
mov dword [ebp - 0x3030], 0
mov dword [ebp - 0x301c], eax
lea eax, [edi + ecx*8]
mov dword [ebp - 0x3044], eax
mov dword [ebp - 0x3040], 0
mov eax, 0
test ecx, ecx
jle 0x1012efa9
xor esi, esi
mov dword [ebp - 0x3030], 0
mov dword [ebp - 0x3040], 0
xor eax, eax
mov dword [ebp - 0x3034], esi
xor ecx, ecx
mov word [ebp - 0x3024], cx
mov word [ebp - 0x3028], cx
mov esi, dword [edi]
test esi, esi
je 0x1012f368
movzx ebx, word [edi + 4]
test bx, bx
je 0x1012f368
mov dword [ebp - 0x303c], eax
test bl, 1
je 0x1012ef97
mov eax, dword [esi]
mov ecx, dword [eax + 0x54]
and ebx, 0xfffd
call dword [section..00cfg]
movsx eax, bx
lea edx, [ebp - 0x3024]
push edx
push eax
push esi
call ecx
add esp, 0xc
mov esi, eax
movzx ebx, word [edi + 4]
test bl, 2
jne 0x1012ef56
xor eax, eax
movzx ecx, word [ebp - 0x3024]
test cx, si
jne 0x1012f31d
test word [ebp - 0x3028], ax
jne 0x1012f31d
mov word [edi + 6], 0
mov ecx, dword [edi]
test ecx, ecx
je 0x1012f21d
movzx ebx, si
movzx eax, ax
mov edx, ecx
cmp dword [edx + 0x14], 0
je 0x1012ee9f
mov edx, dword [edx + 8]
test edx, edx
jne 0x1012ee8d
jmp 0x1012f20c
mov ecx, dword [edx + 4]
cmp dword [ecx], 0xaaaaaaaa
jne 0x1012f21d
mov esi, dword [ebp - 0x3034]
test esi, esi
jne 0x1012f243
mov ecx, dword [ecx + 0x18]
test bl, 1
je 0x1012ef8a
mov word [edi + 6], 1
mov edx, dword [ebp - 0x1014]
cmp edx, 0x3ff
ja 0x1012eeec
lea esi, [edx + 1]
mov dword [ebp - 0x1014], esi
mov dword [ebp + edx*4 - 0x1010], ecx
mov esi, dword [ebp - 0x3030]
inc esi
xor edx, edx
inc edx
test bl, 2
jne 0x1012f1cd
test al, 1
jne 0x1012f193
test al, 2
mov dword [ebp - 0x3030], esi
jne 0x1012f144
xor esi, esi
test byte [edi + 4], 4
je 0x1012f243
mov eax, dword [ebp - 0x301c]
cmp eax, 0x3ff
ja 0x1012ef3e
lea edx, [eax + 1]
mov dword [ebp - 0x301c], edx
mov dword [ebp + eax*4 - 0x3018], ecx
mov eax, dword [ebp - 0x303c]
inc eax
add edi, 8
cmp edi, dword [ebp - 0x3044]
jb 0x1012ede9
jmp 0x1012ef9e
mov eax, dword [edi]
mov dword [ebp - 0x3048], eax
mov eax, dword [eax]
mov ecx, dword [eax + 0x54]
and ebx, 0xfffe
call dword [section..00cfg]
movsx eax, bx
lea edx, [ebp - 0x3028]
push edx
push eax
push dword [ebp - 0x3048]
call ecx
add esp, 0xc
jmp 0x1012ee58
xor edx, edx
mov esi, dword [ebp - 0x3030]
jmp 0x1012eef6
xor esi, esi
jmp 0x1012ee4d
test esi, esi
mov edi, dword [ebp + 8]
jne 0x1012f3b6
mov dword [ebp - 0x3038], edi
mov edx, eax
cmp eax, 0x400
mov eax, dword [ebp - 0x3030]
mov ecx, dword [ebp - 0x3040]
jg 0x1012f380
cmp eax, 0x400
jg 0x1012f380
cmp ecx, 0x401
jge 0x1012f380
test eax, eax
lea esi, [ebp - 0x1014]
cmove esi, eax
mov dword [ebp - 0x3034], esi
test ecx, ecx
lea ebx, [ebp - 0x2018]
cmove ebx, ecx
test edx, edx
lea edi, [ebp - 0x301c]
cmove edi, edx
or ecx, eax
or ecx, edx
mov ecx, dword [ebp + 0x10]
je 0x1012f3ab
xor esi, esi
cmp ecx, 0xffffffff
jne 0x1012f10a
push esi
push edi
push ebx
push dword [ebp - 0x3034]
push 0
call sub.wsock32.dll_select
test eax, eax
jle 0x1012f24e
cmp dword [ebp + 0xc], 0
mov edi, dword [ebp + 8]
jle 0x1012f3b4
xor esi, esi
mov eax, dword [edi]
test eax, eax
mov dword [ebp - 0x3034], esi
je 0x1012f379
cmp word [edi + 4], 0
je 0x1012f379
mov ecx, eax
cmp dword [ecx + 0x14], 0
je 0x1012f08b
mov ecx, dword [ecx + 8]
test ecx, ecx
jne 0x1012f062
jmp 0x1012f083
mov eax, dword [eax + 0xc]
cmp dword [eax + 0x14], 0
jne 0x1012f080
jmp 0x1012f08d
mov eax, ecx
mov eax, dword [eax + 4]
mov ebx, dword [eax + 0x18]
lea eax, [ebp - 0x1014]
push eax
push ebx
call sub.wsock32.dll___WSAFDIsSet
test eax, eax
jne 0x1012f0f8
xor esi, esi
lea eax, [ebp - 0x2018]
push eax
push ebx
call sub.wsock32.dll___WSAFDIsSet
test eax, eax
jne 0x1012f176
lea eax, [ebp - 0x301c]
push eax
push ebx
call sub.wsock32.dll___WSAFDIsSet
movzx ecx, si
lea edx, [ecx + 4]
test eax, eax
cmovne ecx, edx
mov word [edi + 6], cx
cmp cx, 1
mov esi, dword [ebp - 0x3034]
sbb esi, 0xffffffff
add edi, 8
cmp edi, dword [ebp - 0x3044]
jb 0x1012f045
jmp 0x1012f3b6
movzx esi, word [edi + 6]
mov eax, esi
and eax, 1
shr esi, 1
and esi, 2
or esi, eax
jmp 0x1012f0a6
cmp dword [0x101de200], 0
je 0x1012f3cd
mov edx, 0x10624dd3
mov eax, ecx
mul edx
shr edx, 6
lea esi, [ebp - 0x3024]
mov dword [esi], edx
imul eax, edx, 0x3e8
sub ecx, eax
push ecx
call sym.nss3.dll_PR_IntervalToMicroseconds
add esp, 4
mov dword [esi + 4], eax
jmp 0x1012f01e
movzx eax, dx
or eax, 8
mov word [edi + 6], ax
mov eax, dword [ebp - 0x2018]
cmp eax, 0x3ff
ja 0x1012f16b
lea edx, [eax + 1]
mov dword [ebp - 0x2018], edx
mov dword [ebp + eax*4 - 0x2014], ecx
inc dword [ebp - 0x3040]
jmp 0x1012ef15
movzx eax, si
movzx esi, word [edi + 6]
mov ecx, esi
shr ecx, 1
and ecx, 1
or eax, ecx
shr esi, 2
and esi, 2
or esi, eax
jmp 0x1012f0bb
mov dword [ebp - 0x3030], esi
movzx edx, dx
or edx, 4
mov word [edi + 6], dx
mov esi, dword [ebp - 0x1014]
cmp esi, 0x3ff
ja 0x1012f1c1
lea ebx, [esi + 1]
mov dword [ebp - 0x1014], ebx
mov dword [ebp + esi*4 - 0x1010], ecx
mov esi, dword [ebp - 0x3030]
inc esi
jmp 0x1012ef07
mov dword [ebp - 0x3030], esi
movzx edx, dx
or edx, 2
mov word [edi + 6], dx
mov esi, dword [ebp - 0x2018]
cmp esi, 0x3ff
ja 0x1012f1fb
lea ebx, [esi + 1]
mov dword [ebp - 0x2018], ebx
mov dword [ebp + esi*4 - 0x2014], ecx
inc dword [ebp - 0x3040]
mov esi, dword [ebp - 0x3030]
jmp 0x1012eeff
cmp dword [ecx + 0x14], 0
je 0x1012f3da
mov ecx, dword [ecx + 0xc]
test ecx, ecx
jne 0x1012f20c
mov esi, dword [ebp - 0x3034]
test esi, esi
jne 0x1012f23c
cmp edi, dword [ebp + 8]
jbe 0x1012f23c
mov eax, dword [ebp + 8]
mov word [eax + 6], 0
add eax, 8
cmp eax, edi
jb 0x1012f22f
inc esi
mov word [edi + 6], 0x10
mov eax, dword [ebp - 0x303c]
jmp 0x1012ef45
mov esi, eax
cmp eax, 0xffffffff
jne 0x1012f3b6
call sub.wsock32.dll_WSAGetLastError
cmp eax, 0x2736
jne 0x1012f3e1
mov dword [ebp - 0x302c], 4
xor esi, esi
cmp dword [ebp + 0xc], 0
jle 0x1012f3b6
lea edi, [ebp - 0x302c]
lea ebx, [ebp - 0x3028]
mov eax, dword [ebp - 0x3038]
mov word [eax + 6], 0
mov eax, dword [eax]
test eax, eax
je 0x1012f2fd
mov ecx, dword [ebp - 0x3038]
cmp word [ecx + 4], 0
je 0x1012f2fd
mov ecx, eax
cmp dword [ecx + 0x14], 0
je 0x1012f2c6
mov ecx, dword [ecx + 8]
test ecx, ecx
jne 0x1012f2ac
jmp 0x1012f2be
mov eax, dword [eax + 0xc]
cmp dword [eax + 0x14], 0
jne 0x1012f2bb
jmp 0x1012f2c8
mov eax, ecx
mov eax, dword [eax + 4]
push edi
push ebx
push 0x1008
push 0xffff
push dword [eax + 0x18]
call sub.wsock32.dll_getsockopt
cmp eax, 0xffffffff
jne 0x1012f2fd
call sub.wsock32.dll_WSAGetLastError
cmp eax, 0x2736
jne 0x1012f2fd
mov eax, dword [ebp - 0x3038]
mov word [eax + 6], 0x10
inc esi
mov eax, dword [ebp - 0x3038]
add eax, 8
mov dword [ebp - 0x3038], eax
cmp eax, dword [ebp - 0x3044]
jb 0x1012f28b
jmp 0x1012f3b6
mov esi, dword [ebp - 0x3034]
test esi, esi
jne 0x1012f33c
cmp edi, dword [ebp + 8]
jbe 0x1012f33c
mov eax, dword [ebp + 8]
mov word [eax + 6], 0
add eax, 8
cmp eax, edi
jb 0x1012f32f
inc esi
or cx, word [ebp - 0x3028]
mov word [edi + 6], cx
jmp 0x1012f243
sub esp, 0x10
movaps xmm0, xmmword [0x1019c190]
movups xmmword [esp], xmm0
call fcn.10072140
add esp, 0x10
jmp 0x1012ed6e
mov word [edi + 6], 0
mov esi, dword [ebp - 0x3034]
jmp 0x1012ef45
xor ecx, ecx
jmp 0x1012f0d3
push 0
push 0xffffe89d
call sym.nss3.dll_PR_SetError
add esp, 8
xor esi, esi
dec esi
jmp 0x1012f3b6
and ecx, 0xfffffffd
mov dword [eax + 0xe0], ecx
push 0
push 0xffffe897
jmp 0x1012f387
push dword [ebp + 0x10]
jmp 0x1012f3ac
push ecx
call sym.nss3.dll_PR_Sleep
add esp, 4
xor esi, esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.1014dc80
mov eax, esi
add esp, 0x303c
pop esi
pop edi
pop ebx
pop ebp
ret
call fcn.100745f0
mov ecx, dword [ebp + 0x10]
jmp 0x1012f117
mov edx, ecx
jmp 0x1012ee9f
push eax
call fcn.10189f70
add esp, 4
jmp 0x1012f38f