Function at 0x4764d0
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push esi
mov esi, dword [ebp + 8]
test esi, esi
je 0x476716
push str.master
call fcn.00478a50
add esp, 4
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 [ebp - 0x10], eax
lea eax, [ebp - 0x1c]
push eax
push dword [0x55fcc0]
mov dword [ebp - 0x1c], 1
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [esi + 0x7cb4]
test eax, eax
je 0x47653d
push 0
push esi
call eax
add esp, 8
mov dword [ebp - 0x14], eax
jmp 0x476544
mov dword [ebp - 0x14], 0
push ebx
push edi
push 0
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
mov edi, dword [esi + 8]
lea ebx, [esi + 0x14]
add esp, 4
mov dword [esi + 0x7c58], eax
cmp dword [ebx], 0
mov dword [esi + 0x7c5c], edx
mov dword [ebp - 4], edi
jne 0x4765fc
nop
mov eax, dword [esi + 0xc]
xor ecx, ecx
test eax, eax
je 0x47659d
xor edx, edx
mov ebx, 1
mov eax, dword [esi + 4]
lea edx, [edx + 0x28]
mov eax, dword [edx + eax - 0x28]
mov dword [edi + ecx*8], eax
mov word [edi + ecx*8 + 4], bx
inc ecx
mov eax, dword [esi + 0xc]
cmp ecx, eax
jb 0x476580
lea ebx, [esi + 0x14]
push ebx
push 0x7d0
push eax
push edi
call fcn.00477940
add esp, 0x10
test eax, eax
jle 0x4765f2
xor eax, eax
mov dword [ebp + 8], eax
cmp dword [esi + 0xc], eax
jbe 0x4765f2
xor ebx, ebx
add edi, 6
cmp dword [esi + 0x14], 0
jne 0x4765dd
test byte [edi], 1
je 0x4765dd
mov eax, dword [esi + 4]
add eax, ebx
push esi
push eax
call fcn.00473810
mov eax, dword [ebp + 8]
add esp, 8
inc eax
add edi, 8
add ebx, 0x28
mov dword [ebp + 8], eax
cmp eax, dword [esi + 0xc]
jb 0x4765c0
mov edi, dword [ebp - 4]
lea ebx, [esi + 0x14]
cmp dword [esi + 0x14], 0
je 0x476570
xor ebx, ebx
cmp dword [esi + 0xc], ebx
jbe 0x476630
xor edi, edi
nop word [eax + eax]
mov eax, dword [esi + 4]
push dword [eax + edi]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esi + 4]
lea edi, [edi + 0x28]
inc ebx
mov dword [edi + eax - 0x28], 0xffffffff
cmp ebx, dword [esi + 0xc]
jb 0x476610
push dword [esi + 4]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call edi
push dword [esi + 8]
mov dword [esi + 4], 0
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [esi + 0x18]
add esp, 8
mov dword [esi + 8], 0
push eax
call ebx
lea edi, [esi + 0x4c]
push edi
call ebx
cmp dword [edi + 0x18], 0
mov ebx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
je 0x476697
nop
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [edi + 0x18]
test eax, eax
je 0x47668e
mov ecx, dword [eax + 0xc]
mov eax, dword [eax + 0x10]
push ecx
mov dword [edi + 0x18], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push edi
call ebx
cmp dword [edi + 0x18], 0
jne 0x476670
push edi
call ebx
lea eax, [esi + 0x18]
push eax
call ebx
mov eax, dword [esi + 0x34]
xor edi, edi
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp + 8], eax
test eax, eax
je 0x4766e5
mov eax, dword [esi + 0x38]
mov ebx, dword [eax + edi*4]
test ebx, ebx
je 0x4766d9
push 0xffffffffffffffff
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
je 0x4766d9
test eax, eax
jne 0x4766d9
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
jmp 0x4766df
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
inc edi
cmp edi, dword [ebp + 8]
jb 0x4766b2
mov eax, dword [esi + 0x7cb8]
test eax, eax
je 0x4766fa
push dword [ebp - 0x14]
push 0
push esi
call eax
add esp, 0xc
push dword [ebp - 0x10]
call ebx
push 0
push dword [0x55fcc0]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
pop edi
mov dword [esi + 0x14], 2
pop ebx
pop esi
mov esp, ebp
pop ebp
ret