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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x134
mov eax, dword [0x454004]
xor eax, esp
mov dword [esp + 0x130], eax
push ebx
mov ebx, ecx
mov dword [esp + 0x10], ebx
push esi
push edi
test ebx, ebx
je 0x412617
mov ecx, str.master
call fcn.00406270
push 1
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
push 0
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [esp + 0x24], eax
lea eax, [esp + 0x1c]
push eax
push dword [0x456c8c]
mov dword [esp + 0x24], 1
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [ebx + 0xc4]
test eax, eax
je 0x412271
push 0
push ebx
call eax
add esp, 8
push 0
call fcn.0042933f
add esp, 4
mov dword [ebx + 0x480], eax
mov dword [ebx + 0x484], edx
push 8
push dword [ebx + 0xdc]
call fcn.004296e8
mov edi, eax
add esp, 8
mov dword [esp + 0x14], edi
test edi, edi
je 0x412411
nop word [eax + eax]
mov esi, 0x300
cmp dword [ebx], 0
jne 0x412411
mov eax, dword [ebx + 0xdc]
xor ecx, ecx
mov dword [esp + 0xc], eax
test eax, eax
je 0x4122f4
xor edx, edx
mov eax, dword [ebx + 0xd4]
lea edx, [edx + 0x28]
mov eax, dword [edx + eax - 0x28]
mov dword [edi + ecx*8], eax
mov word [edi + ecx*8 + 4], si
inc ecx
mov eax, dword [ebx + 0xdc]
mov dword [esp + 0xc], eax
cmp ecx, eax
jb 0x4122d0
xor ecx, ecx
mov dword [esp + 0x2c], 0x30d40
xor edx, edx
mov dword [esp + 0x28], ecx
xor esi, esi
mov dword [esp + 0x30], edx
test eax, eax
je 0x412366
mov ebx, ecx
xor ecx, ecx
test edx, edx
je 0x41232b
mov eax, dword [edi + esi*8]
nop dword [eax]
cmp dword [esp + ecx*4 + 0x34], eax
je 0x41232b
inc ecx
cmp ecx, edx
jb 0x412320
cmp ecx, edx
jne 0x412344
cmp edx, 0x40
jae 0x412344
mov eax, dword [edi + esi*8]
mov dword [esp + ecx*4 + 0x34], eax
mov edx, dword [esp + 0x30]
inc edx
mov dword [esp + 0x30], edx
xor eax, eax
mov word [edi + esi*8 + 6], ax
mov eax, dword [edi + esi*8]
cmp eax, ebx
cmovbe eax, ebx
inc esi
mov ebx, eax
cmp esi, dword [esp + 0xc]
jb 0x412310
mov dword [esp + 0x10], ebx
mov ecx, eax
mov ebx, dword [esp + 0x18]
lea eax, [esp + 0x28]
push eax
push 0
push 0
lea eax, [esp + 0x3c]
push eax
lea eax, [ecx + 1]
push eax
call dword [sym.imp.WS2_32.dll_select]
mov esi, 0x300
test eax, eax
jle 0x4122b5
xor esi, esi
cmp dword [esp + 0xc], esi
jbe 0x4123bc
mov ebx, dword [esp + 0xc]
lea eax, [esp + 0x30]
push eax
push dword [edi + esi*8]
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x4123b3
mov eax, 0x300
mov word [edi + esi*8 + 6], ax
inc esi
cmp esi, ebx
jb 0x412397
mov ebx, dword [esp + 0x18]
xor esi, esi
cmp dword [ebx + 0xdc], esi
jbe 0x4122b0
lea eax, [edi + 6]
mov edi, esi
mov dword [esp + 0x10], eax
cmp dword [ebx], 0
jne 0x4123f5
mov ecx, 0x300
test word [eax], cx
je 0x4123f5
mov ecx, dword [ebx + 0xd4]
mov edx, ebx
add ecx, edi
call fcn.00411df0
mov eax, dword [esp + 0x10]
inc esi
add eax, 8
add edi, 0x28
mov dword [esp + 0x10], eax
cmp esi, dword [ebx + 0xdc]
jb 0x4123d3
mov edi, dword [esp + 0x14]
jmp 0x4122b0
push edi
call fcn.00425f00
add esp, 4
mov ecx, ebx
call fcn.0040f9a0
lea esi, [ebx + 0x430]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x18], 0
mov edi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
je 0x412483
nop word [eax + eax]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x18], 0
je 0x41247a
mov eax, dword [esi + 0x1c]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [esi + 0x18]
mov edx, 1
cmp eax, edx
jle 0x412476
mov ecx, dword [esi + 0x1c]
mov eax, dword [ecx + edx*4]
mov dword [ecx + edx*4 - 4], eax
inc edx
mov eax, dword [esi + 0x18]
cmp edx, eax
jl 0x412464
dec eax
mov dword [esi + 0x18], eax
push esi
call edi
cmp dword [esi + 0x18], 0
jne 0x412440
push esi
call edi
push 0xffffffffffffffff
push dword [ebx + 0xe4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [ebx + 0xe0], 0
jle 0x412503
lea esi, [ebx + 0xe8]
push dword [0x456c8c]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [esi + 0x18]
mov edx, dword [ebx + 0x104]
mov ecx, dword [edi + 8]
mov dword [edx + esi*4], ecx
lea esi, [ebx + 0xe8]
inc dword [esi + 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push dword [ebx + 0xe4]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push 0xffffffffffffffff
push dword [edi + 8]
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call edi
push 0xffffffffffffffff
push dword [ebx + 0xe4]
call edi
cmp dword [ebx + 0xe0], 0
jg 0x4124a3
push dword [ebx + 0xe4]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebx + 0x474]
xor esi, esi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x14], eax
test eax, eax
je 0x41255c
mov eax, dword [ebx + 0x478]
mov edi, dword [eax + esi*4]
test edi, edi
je 0x41254f
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
je 0x41254f
test eax, eax
jne 0x41254f
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
jmp 0x412555
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
inc esi
cmp esi, dword [esp + 0x14]
jb 0x412525
cmp dword [ebx + 4], 0
je 0x4125fd
or eax, 0xffffffff
lock xadd dword [0x456940], eax
dec eax
jne 0x4125fd
push 0
call dword [0x454bec]
add esp, 4
push 0
call dword [0x454bf4]
add esp, 4
call dword [0x454c1c]
push 1
call dword [0x454c24]
add esp, 4
call dword [0x454c14]
call dword [0x454c34]
call dword [0x454c2c]
push 0
call dword [0x454c0c]
add esp, 4
xor esi, esi
call dword [0x454be4]
test eax, eax
jle 0x4125e5
nop dword [eax + eax]
mov eax, dword [0x45691c]
push dword [eax + esi*4]
call edi
inc esi
call dword [0x454be4]
cmp esi, eax
jl 0x4125d0
push dword [0x45691c]
call fcn.00425f00
add esp, 4
mov dword [0x45691c], 0
push dword [esp + 0x24]
call edi
push 0
push dword [0x456c8c]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [ebx], 2
mov ecx, dword [esp + 0x13c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00423c62
mov esp, ebp
pop ebp
ret