Function at 0x41f500
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
mov ebx, dword [ebp + 8]
test ebx, ebx
je 0x41f704
push esi
lea esi, [ebx + 0x1c]
xor eax, eax
push edi
mov dword [ebp - 8], esi
nop dword [eax]
inc eax
xor edi, edi
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x20]
push eax
push esi
mov dword [ebp - 4], edi
call fcn.0041fd10
mov eax, dword [ebx + 0x30]
mov dword [ebx + 0x34], eax
lea eax, [ebp - 0x20]
push eax
call fcn.0041fda0
add esp, 0xc
nop word [eax + eax]
mov dword [ebp - 0x20], esi
lea eax, [ebx + 0x1c]
mov dword [ebp - 0x14], 0
lea esi, [ebp - 0x20]
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], 0
xchg dword [eax], esi
test esi, esi
je 0x41f5d4
lea ecx, [ebp - 0x20]
lea eax, [esi + 4]
xchg dword [eax], ecx
or edx, 0xffffffff
lea ecx, [esi + 0xc]
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x41f598
cmp eax, 0xffffffff
je 0x41f598
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
lea ecx, [ebp - 0x18]
lock xadd dword [ecx], eax
test eax, eax
jne 0x41f5d4
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
test esi, esi
je 0x41f5d4
mov ecx, esi
lea edx, [ebp - 0x18]
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x41f5cd
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebx + 0x34]
test esi, esi
je 0x41f6e8
mov edx, dword [esi + 4]
lea ecx, [ebp - 0x30]
add edx, 8
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x30], edx
xor eax, eax
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x41f626
lea eax, [ebp - 0x20]
push eax
call fcn.0041fda0
add esp, 4
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
lea esi, [ebx + 0x1c]
jmp 0x41f550
mov eax, dword [esi + 8]
mov dword [ebx + 0x34], eax
mov edi, dword [esi + 4]
mov eax, dword [edi + 4]
push dword [edi]
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push 0
push dword [edi]
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test ebx, ebx
je 0x41f67b
cmp dword [ebp - 0xc], 4
jg 0x41f67b
lea eax, [ebp - 0x20]
push eax
call fcn.0041fda0
lea eax, [ebp - 0x30]
push eax
call fcn.0041fda0
mov edi, dword [ebp - 4]
inc edi
push ebx
mov dword [ebp - 4], edi
call dword [ebp - 0x10]
mov ebx, dword [ebp + 8]
mov esi, dword [ebp - 8]
jmp 0x41f542
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 8]
test ecx, ecx
je 0x41f688
mov dword [ecx + 8], eax
test eax, eax
je 0x41f68f
mov dword [eax + 0x10], ecx
mov ecx, dword [esi]
cmp dword [ecx + 0x30], esi
jne 0x41f69b
mov dword [ecx + 0x30], eax
mov ecx, dword [esi]
cmp dword [ecx + 0x34], esi
jne 0x41f6a3
mov dword [ecx + 0x34], eax
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 0xc]
test ecx, ecx
je 0x41f6b0
mov dword [ecx + 0xc], eax
test eax, eax
je 0x41f6b7
mov dword [eax + 0x14], ecx
mov ecx, dword [esi + 4]
cmp dword [ecx + 0xc], esi
jne 0x41f6c2
mov dword [ecx + 0xc], eax
push esi
call fcn.00425d83
lea eax, [ebp - 0x20]
push eax
call fcn.0041fda0
lea eax, [ebp - 0x30]
push eax
call fcn.0041fda0
mov ebx, dword [ebp + 8]
mov edi, dword [ebp - 4]
mov esi, dword [ebp - 8]
jmp 0x41f542
lea eax, [ebp - 0x20]
push eax
call fcn.0041fda0
mov eax, dword [ebp - 0xc]
lea esi, [ebx + 0x1c]
add esp, 4
test edi, edi
jne 0x41f520
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret