Function at 0x412080
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 [0x452004]
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 0x4124a7
mov ecx, str.master
call fcn.004060f0
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 [0x454c6c]
mov dword [esp + 0x24], 1
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [ebx + 0xc4]
test eax, eax
je 0x412101
push 0
push ebx
call eax
add esp, 8
push 0
call fcn.00427b7f
add esp, 4
mov dword [ebx + 0x480], eax
mov dword [ebx + 0x484], edx
push 8
push dword [ebx + 0xdc]
call fcn.00428038
mov edi, eax
add esp, 8
mov dword [esp + 0x14], edi
test edi, edi
je 0x4122a1
nop word [eax + eax]
mov esi, 0x300
cmp dword [ebx], 0
jne 0x4122a1
mov eax, dword [ebx + 0xdc]
xor ecx, ecx
mov dword [esp + 0xc], eax
test eax, eax
je 0x412184
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 0x412160
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 0x4121f6
mov ebx, ecx
xor ecx, ecx
test edx, edx
je 0x4121bb
mov eax, dword [edi + esi*8]
nop dword [eax]
cmp dword [esp + ecx*4 + 0x34], eax
je 0x4121bb
inc ecx
cmp ecx, edx
jb 0x4121b0
cmp ecx, edx
jne 0x4121d4
cmp edx, 0x40
jae 0x4121d4
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 0x4121a0
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 0x412145
xor esi, esi
cmp dword [esp + 0xc], esi
jbe 0x41224c
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 0x412243
mov eax, 0x300
mov word [edi + esi*8 + 6], ax
inc esi
cmp esi, ebx
jb 0x412227
mov ebx, dword [esp + 0x18]
xor esi, esi
cmp dword [ebx + 0xdc], esi
jbe 0x412140
lea eax, [edi + 6]
mov edi, esi
mov dword [esp + 0x10], eax
cmp dword [ebx], 0
jne 0x412285
mov ecx, 0x300
test word [eax], cx
je 0x412285
mov ecx, dword [ebx + 0xd4]
mov edx, ebx
add ecx, edi
call fcn.00411c80
mov eax, dword [esp + 0x10]
inc esi
add eax, 8
add edi, 0x28
mov dword [esp + 0x10], eax
cmp esi, dword [ebx + 0xdc]
jb 0x412263
mov edi, dword [esp + 0x14]
jmp 0x412140
push edi
call fcn.00424740
add esp, 4
mov ecx, ebx
call fcn.0040f830
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 0x412313
nop word [eax + eax]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x18], 0
je 0x41230a
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 0x412306
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 0x4122f4
dec eax
mov dword [esi + 0x18], eax
push esi
call edi
cmp dword [esi + 0x18], 0
jne 0x4122d0
push esi
call edi
push 0xffffffffffffffff
push dword [ebx + 0xe4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [ebx + 0xe0], 0
jle 0x412393
lea esi, [ebx + 0xe8]
push dword [0x454c6c]
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 0x412333
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 0x4123ec
mov eax, dword [ebx + 0x478]
mov edi, dword [eax + esi*4]
test edi, edi
je 0x4123df
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
je 0x4123df
test eax, eax
jne 0x4123df
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
jmp 0x4123e5
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
inc esi
cmp esi, dword [esp + 0x14]
jb 0x4123b5
cmp dword [ebx + 4], 0
je 0x41248d
or eax, 0xffffffff
lock xadd dword [0x454920], eax
dec eax
jne 0x41248d
push 0
call dword [0x452bec]
add esp, 4
push 0
call dword [0x452bf4]
add esp, 4
call dword [0x452c1c]
push 1
call dword [0x452c24]
add esp, 4
call dword [0x452c14]
call dword [0x452c34]
call dword [0x452c2c]
push 0
call dword [0x452c0c]
add esp, 4
xor esi, esi
call dword [0x452be4]
test eax, eax
jle 0x412475
nop dword [eax + eax]
mov eax, dword [0x4548fc]
push dword [eax + esi*4]
call edi
inc esi
call dword [0x452be4]
cmp esi, eax
jl 0x412460
push dword [0x4548fc]
call fcn.00424740
add esp, 4
mov dword [0x4548fc], 0
push dword [esp + 0x24]
call edi
push 0
push dword [0x454c6c]
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.00422702
mov esp, ebp
pop ebp
ret