Function at 0x1012a510
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.10157e10
mov eax, dword [0x101f1014]
xor eax, ebp
mov dword [ebp - 0x10], eax
push dword [0x101f45d4]
call dword [sym.imp.kernel32.dll_TlsGetValue]
test eax, eax
je 0x1012ab0d
mov ecx, dword [eax + 0xe0]
mov edx, ecx
and edx, 0x1002
cmp edx, 2
je 0x1012ab5a
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x1012ab6c
mov edi, dword [ebp + 8]
xor edx, edx
mov dword [ebp - 0x1014], edx
mov dword [ebp - 0x2018], edx
mov dword [ebp - 0x301c], edx
lea eax, [edi + ecx*8]
mov dword [ebp - 0x3044], eax
mov dword [ebp - 0x3040], 0
mov ebx, 0
test ecx, ecx
mov dword [ebp - 0x3038], edi
jle 0x1012a78d
xor esi, esi
mov dword [ebp - 0x303c], 0
mov dword [ebp - 0x3040], 0
xor ebx, ebx
mov dword [ebp - 0x3034], ebx
mov dword [ebp - 0x3030], esi
xor eax, eax
mov word [ebp - 0x3024], ax
mov word [ebp - 0x3028], ax
mov esi, dword [edi]
test esi, esi
je 0x1012ab28
movzx ebx, word [edi + 4]
test bx, bx
je 0x1012ab28
test bl, 1
je 0x1012a946
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 0x1012a713
xor eax, eax
movzx ecx, word [ebp - 0x3024]
test cx, si
jne 0x1012a9b9
test word [ebp - 0x3028], ax
jne 0x1012a9b9
mov word [edi + 6], 0
mov ecx, dword [edi]
test ecx, ecx
je 0x1012a9ff
movzx ebx, si
movzx eax, ax
mov edx, ecx
cmp dword [edx + 0x14], 0
je 0x1012a66b
mov edx, dword [edx + 8]
test edx, edx
jne 0x1012a659
jmp 0x1012a9ee
mov ecx, dword [edx + 4]
cmp dword [ecx], 0xaaaaaaaa
jne 0x1012a9ff
mov esi, dword [ebp - 0x3030]
test esi, esi
jne 0x1012a9e3
mov ecx, dword [ecx + 0x18]
test bl, 1
je 0x1012a93f
mov word [edi + 6], 1
mov edx, dword [ebp - 0x1014]
cmp edx, 0x3ff
ja 0x1012a6b8
lea esi, [edx + 1]
mov dword [ebp - 0x1014], esi
mov dword [ebp + edx*4 - 0x1010], ecx
inc dword [ebp - 0x303c]
xor edx, edx
inc edx
test bl, 2
jne 0x1012a986
test al, 1
mov ebx, dword [ebp - 0x3034]
jne 0x1012a94d
test al, 2
jne 0x1012a747
xor esi, esi
test byte [edi + 4], 4
je 0x1012a702
mov eax, dword [ebp - 0x301c]
cmp eax, 0x3ff
ja 0x1012a701
lea edx, [eax + 1]
mov dword [ebp - 0x301c], edx
mov dword [ebp + eax*4 - 0x3018], ecx
inc ebx
add edi, 8
cmp edi, dword [ebp - 0x3044]
jb 0x1012a5b5
jmp 0x1012a779
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 0x1012a624
movzx eax, dx
or eax, 8
mov word [edi + 6], ax
mov eax, dword [ebp - 0x2018]
cmp eax, 0x3ff
ja 0x1012a76e
lea edx, [eax + 1]
mov dword [ebp - 0x2018], edx
mov dword [ebp + eax*4 - 0x2014], ecx
inc dword [ebp - 0x3040]
jmp 0x1012a6dc
mov dword [ebp - 0x3030], esi
test esi, esi
mov edx, dword [ebp - 0x303c]
jne 0x1012ab81
cmp edx, 0x400
mov edi, dword [ebp - 0x3040]
jg 0x1012ab40
cmp edi, 0x400
jg 0x1012ab40
cmp ebx, 0x401
jge 0x1012ab40
mov eax, edx
test edi, edi
lea esi, [ebp - 0x2018]
cmove esi, edi
test ebx, ebx
lea edx, [ebp - 0x301c]
mov ecx, ebx
mov ebx, edx
mov edx, ecx
cmove ebx, ecx
lea ecx, [ebp - 0x1014]
test eax, eax
cmovne eax, ecx
mov dword [ebp - 0x303c], eax
mov ecx, dword [ebp + 0x10]
jne 0x1012a7f7
test edi, edi
jne 0x1012a7f7
test edx, edx
je 0x1012ab9c
xor edi, edi
cmp ecx, 0xffffffff
jne 0x1012a8e8
push edi
push ebx
push esi
push dword [ebp - 0x303c]
push 0
call sub.wsock32.dll_select
test eax, eax
jle 0x1012aa2f
cmp dword [ebp + 0xc], 0
mov esi, dword [ebp + 8]
jle 0x1012ab77
mov dword [ebp - 0x3030], 0
mov eax, dword [esi]
test eax, eax
je 0x1012ab39
cmp word [esi + 4], 0
je 0x1012ab39
mov ecx, eax
cmp dword [ecx + 0x14], 0
je 0x1012a86b
mov ecx, dword [ecx + 8]
test ecx, ecx
jne 0x1012a848
jmp 0x1012a863
mov eax, dword [eax + 0xc]
cmp dword [eax + 0x14], 0
jne 0x1012a860
jmp 0x1012a86d
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 0x1012a8d6
xor edi, edi
lea eax, [ebp - 0x2018]
push eax
push ebx
call sub.wsock32.dll___WSAFDIsSet
test eax, eax
jne 0x1012a922
lea eax, [ebp - 0x301c]
push eax
push ebx
call sub.wsock32.dll___WSAFDIsSet
movzx ecx, di
lea edx, [ecx + 4]
test eax, eax
cmovne ecx, edx
mov word [esi + 6], cx
cmp cx, 1
sbb dword [ebp - 0x3030], 0xffffffff
add esi, 8
cmp esi, dword [ebp - 0x3044]
jb 0x1012a831
jmp 0x1012ab81
movzx edi, word [esi + 6]
mov eax, edi
and eax, 1
shr edi, 1
and edi, 2
or edi, eax
jmp 0x1012a886
cmp dword [0x101f4f80], 0
je 0x1012ab9f
mov edx, 0x10624dd3
mov eax, ecx
mul edx
shr edx, 6
lea edi, [ebp - 0x3024]
mov dword [edi], edx
imul eax, edx, 0x3e8
sub ecx, eax
push ecx
call sym.nss3.dll_PR_IntervalToMicroseconds
add esp, 4
mov dword [edi + 4], eax
jmp 0x1012a802
movzx eax, word [esi + 6]
mov ecx, eax
shr ecx, 1
and ecx, 1
shr eax, 2
and eax, 2
or eax, ecx
movzx edi, di
or edi, eax
jmp 0x1012a89b
xor edx, edx
jmp 0x1012a6c1
xor esi, esi
jmp 0x1012a619
movzx edx, dx
or edx, 4
mov word [edi + 6], dx
mov esi, dword [ebp - 0x1014]
cmp esi, 0x3ff
ja 0x1012a975
lea ebx, [esi + 1]
mov dword [ebp - 0x1014], ebx
mov dword [ebp + esi*4 - 0x1010], ecx
inc dword [ebp - 0x303c]
mov ebx, dword [ebp - 0x3034]
jmp 0x1012a6d8
movzx edx, dx
or edx, 2
mov word [edi + 6], dx
mov esi, dword [ebp - 0x2018]
cmp esi, 0x3ff
ja 0x1012a9ae
lea ebx, [esi + 1]
mov dword [ebp - 0x2018], ebx
mov dword [ebp + esi*4 - 0x2014], ecx
inc dword [ebp - 0x3040]
jmp 0x1012a6ca
mov esi, dword [ebp - 0x3030]
test esi, esi
mov eax, dword [ebp + 8]
jne 0x1012a9d7
cmp edi, eax
jbe 0x1012a9d7
mov word [eax + 6], 0
add eax, 8
cmp eax, edi
jb 0x1012a9ca
inc esi
or cx, word [ebp - 0x3028]
mov word [edi + 6], cx
mov ebx, dword [ebp - 0x3034]
jmp 0x1012a702
cmp dword [ecx + 0x14], 0
je 0x1012abac
mov ecx, dword [ecx + 0xc]
test ecx, ecx
jne 0x1012a9ee
mov esi, dword [ebp - 0x3030]
test esi, esi
mov eax, dword [ebp + 8]
mov ebx, dword [ebp - 0x3034]
jne 0x1012aa23
cmp edi, eax
jbe 0x1012aa23
mov word [eax + 6], 0
add eax, 8
cmp eax, edi
jb 0x1012aa16
inc esi
mov word [edi + 6], 0x10
jmp 0x1012a702
mov dword [ebp - 0x3030], eax
cmp eax, 0xffffffff
jne 0x1012ab81
call sub.wsock32.dll_WSAGetLastError
cmp eax, 0x2736
jne 0x1012abb3
mov dword [ebp - 0x302c], 4
cmp dword [ebp + 0xc], 0
jle 0x1012ab77
mov dword [ebp - 0x3030], 0
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 0x1012aad1
mov ecx, dword [ebp - 0x3038]
cmp word [ecx + 4], 0
je 0x1012aad1
mov ecx, eax
cmp dword [ecx + 0x14], 0
je 0x1012aab3
mov ecx, dword [ecx + 8]
test ecx, ecx
jne 0x1012aa99
jmp 0x1012aaab
mov eax, dword [eax + 0xc]
cmp dword [eax + 0x14], 0
jne 0x1012aaa8
jmp 0x1012aab5
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
je 0x1012aaed
mov eax, dword [ebp - 0x3038]
add eax, 8
mov dword [ebp - 0x3038], eax
cmp eax, dword [ebp - 0x3044]
jb 0x1012aa78
jmp 0x1012ab81
call sub.wsock32.dll_WSAGetLastError
cmp eax, 0x2736
jne 0x1012aad1
mov eax, dword [ebp - 0x3038]
mov word [eax + 6], 0x10
inc dword [ebp - 0x3030]
jmp 0x1012aad1
sub esp, 0x10
movaps xmm0, xmmword [0x101b11e0]
movups xmmword [esp], xmm0
call fcn.1006e720
add esp, 0x10
jmp 0x1012a53e
mov word [edi + 6], 0
mov esi, dword [ebp - 0x3030]
jmp 0x1012a9e3
xor ecx, ecx
jmp 0x1012a8b3
push 0
push 0xffffe89d
call sym.nss3.dll_PR_SetError
add esp, 8
xor eax, eax
dec eax
mov dword [ebp - 0x3030], eax
jmp 0x1012ab81
and ecx, 0xfffffffd
mov dword [eax + 0xe0], ecx
push 0
push 0xffffe897
jmp 0x1012ab47
push dword [ebp + 0x10]
call sym.nss3.dll_PR_Sleep
add esp, 4
mov dword [ebp - 0x3030], 0
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.10157a00
mov eax, dword [ebp - 0x3030]
add esp, 0x303c
pop esi
pop edi
pop ebx
pop ebp
ret
push ecx
jmp 0x1012ab6f
call fcn.1001b2f0
mov ecx, dword [ebp + 0x10]
jmp 0x1012a8f5
mov edx, ecx
jmp 0x1012a66b
push eax
call fcn.101a78b0
add esp, 4
jmp 0x1012ab4f