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

Disassembly:
sub esp, 0x30
mov eax, dword [esp + 0x34]
mov dword [esp], eax
test eax, eax
je 0x462421
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea edx, [eax + 0x1c]
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventA]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_SetEvent]
mov dword [esp + 0x18], edx
xor eax, eax
mov dword [esp + 0x20], edx
inc ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x20]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], eax
xchg dword [edx], ecx
test ecx, ecx
je 0x461f1a
lea eax, [esp + 0x20]
or edx, 0xffffffff
mov dword [ecx + 4], eax
add ecx, 0xc
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x461ee6
push eax
call edi
xor eax, eax
lea ecx, [esp + 0x28]
lock xadd dword [ecx], eax
test eax, eax
jne 0x461f1a
push eax
push eax
push eax
push eax
call esi
mov esi, eax
lea edx, [esp + 0x28]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x461f11
push 0xffffffffffffffff
push esi
call ebx
push esi
call ebp
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventA]
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx + 0x30]
mov dword [ecx + 0x34], eax
xor ecx, ecx
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x24]
lock xadd dword [eax], ecx
test ecx, ecx
jne 0x461f7e
lea eax, [esp + 0x20]
lock cmpxchg dword [edx], ecx
lea ecx, [esp + 0x20]
cmp ecx, eax
je 0x461fb0
xor eax, eax
lea ecx, [esp + 0x2c]
lock xadd dword [ecx], eax
test eax, eax
jne 0x461f74
push eax
push eax
push eax
push eax
call esi
mov esi, eax
lea edx, [esp + 0x2c]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x461f71
push 0xffffffffffffffff
push esi
call ebx
push esi
call ebp
xor ecx, ecx
lea eax, [esp + 0x24]
lock xadd dword [eax], ecx
or edx, 0xffffffff
add ecx, 8
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x461fb0
push eax
call edi
jmp 0x461fb0
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [eax]
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x20]
mov dword [esp + 0x20], eax
mov dword [esp + 0x2c], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], 0
xchg dword [eax], ecx
test ecx, ecx
je 0x462026
lea eax, [esp + 0x20]
or edx, 0xffffffff
mov dword [ecx + 4], eax
add ecx, 0xc
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x461ff4
push eax
call edi
xor eax, eax
lea ecx, [esp + 0x28]
lock xadd dword [ecx], eax
test eax, eax
jne 0x462026
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea edx, [esp + 0x28]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x462023
push 0xffffffffffffffff
push esi
call ebx
push esi
call ebp
mov eax, dword [esp + 0x10]
mov esi, dword [eax + 0x34]
test esi, esi
je 0x462392
mov edx, dword [esi + 4]
lea ecx, [esp + 0x30]
add edx, 8
mov dword [esp + 0x3c], 0
mov dword [esp + 0x30], edx
xor eax, eax
mov dword [esp + 0x38], 0
mov dword [esp + 0x34], 0
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x4620e3
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x24]
xor ecx, ecx
lock xadd dword [eax], ecx
test ecx, ecx
jne 0x4620c3
lea eax, [esp + 0x20]
lock cmpxchg dword [edx], ecx
lea ecx, [esp + 0x20]
cmp ecx, eax
je 0x4620d6
xor eax, eax
lea ecx, [esp + 0x2c]
lock xadd dword [ecx], eax
test eax, eax
jne 0x4620b9
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea edx, [esp + 0x2c]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x4620b6
push 0xffffffffffffffff
push esi
call ebx
push esi
call ebp
xor ecx, ecx
lea eax, [esp + 0x24]
lock xadd dword [eax], ecx
or edx, 0xffffffff
add ecx, 8
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x4620d6
push eax
call edi
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x461fb0
mov ecx, dword [esp + 0x10]
mov eax, dword [esi + 8]
mov dword [ecx + 0x34], eax
mov edi, dword [esi + 4]
push dword [edi]
mov ebp, dword [edi + 4]
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 0x462229
cmp dword [esp + 0x1c], 4
jg 0x462229
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x24]
xor ecx, ecx
lock xadd dword [eax], ecx
test ecx, ecx
jne 0x462180
lea eax, [esp + 0x20]
lock cmpxchg dword [edx], ecx
lea ecx, [esp + 0x20]
cmp ecx, eax
je 0x46219b
xor eax, eax
lea ecx, [esp + 0x2c]
lock xadd dword [ecx], eax
test eax, eax
jne 0x462176
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea edx, [esp + 0x2c]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x46216f
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
lea eax, [esp + 0x24]
lock xadd dword [eax], ecx
or edx, 0xffffffff
add ecx, 8
xor eax, eax
lock cmpxchg dword [ecx], edx
mov edi, dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
je 0x4621a1
push eax
call edi
jmp 0x4621a1
mov edi, dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [esp + 0x30]
lea eax, [esp + 0x34]
xor ecx, ecx
lock xadd dword [eax], ecx
test ecx, ecx
jne 0x462207
lea eax, [esp + 0x30]
lock cmpxchg dword [edx], ecx
lea ecx, [esp + 0x30]
cmp ecx, eax
je 0x46221a
xor eax, eax
lea ecx, [esp + 0x3c]
lock xadd dword [ecx], eax
test eax, eax
jne 0x4621fd
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea edx, [esp + 0x3c]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x4621f6
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
lea eax, [esp + 0x34]
lock xadd dword [eax], ecx
or edx, 0xffffffff
add ecx, 8
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x46221a
push eax
call edi
inc dword [esp + 0x14]
push ebx
call ebp
add esp, 4
jmp 0x461fa0
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 8]
test ecx, ecx
je 0x462236
mov dword [ecx + 8], eax
test eax, eax
je 0x46223d
mov dword [eax + 0x10], ecx
mov ecx, dword [esi]
cmp dword [ecx + 0x30], esi
jne 0x462247
mov dword [ecx + 0x30], eax
mov ecx, dword [esi]
cmp dword [ecx + 0x34], esi
jne 0x462251
mov dword [ecx + 0x34], eax
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 0xc]
test ecx, ecx
je 0x46225e
mov dword [ecx + 0xc], eax
test eax, eax
je 0x462265
mov dword [eax + 0x14], ecx
mov ecx, dword [esi + 4]
cmp dword [ecx + 0xc], esi
jne 0x462270
mov dword [ecx + 0xc], eax
push esi
call fcn.0046c157
mov edx, dword [esp + 0x24]
lea eax, [esp + 0x28]
add esp, 4
xor ecx, ecx
lock xadd dword [eax], ecx
test ecx, ecx
jne 0x4622df
lea eax, [esp + 0x20]
lock cmpxchg dword [edx], ecx
lea ecx, [esp + 0x20]
cmp ecx, eax
je 0x4622fa
xor eax, eax
lea ecx, [esp + 0x2c]
lock xadd dword [ecx], eax
test eax, eax
jne 0x4622d5
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea edx, [esp + 0x2c]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x4622ce
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
lea eax, [esp + 0x24]
lock xadd dword [eax], ecx
or edx, 0xffffffff
add ecx, 8
xor eax, eax
lock cmpxchg dword [ecx], edx
mov edi, dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
je 0x462300
push eax
call edi
jmp 0x462300
mov edi, dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [esp + 0x30]
lea eax, [esp + 0x34]
xor ecx, ecx
lock xadd dword [eax], ecx
test ecx, ecx
jne 0x46236a
lea eax, [esp + 0x30]
lock cmpxchg dword [edx], ecx
lea ecx, [esp + 0x30]
cmp ecx, eax
je 0x461fa0
xor eax, eax
lea ecx, [esp + 0x3c]
lock xadd dword [ecx], eax
test eax, eax
jne 0x462360
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea edx, [esp + 0x3c]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x462359
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
lea eax, [esp + 0x34]
lock xadd dword [eax], ecx
or edx, 0xffffffff
add ecx, 8
xor eax, eax
lock cmpxchg dword [ecx], edx
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x461fb0
push eax
call edi
jmp 0x461fa0
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x24]
xor ecx, ecx
lock xadd dword [eax], ecx
test ecx, ecx
jne 0x4623f0
lea eax, [esp + 0x20]
lock cmpxchg dword [edx], ecx
lea ecx, [esp + 0x20]
cmp ecx, eax
je 0x462403
xor eax, eax
lea ecx, [esp + 0x2c]
lock xadd dword [ecx], eax
test eax, eax
jne 0x4623e6
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov esi, eax
lea edx, [esp + 0x2c]
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x4623e3
push 0xffffffffffffffff
push esi
call ebx
push esi
call ebp
xor ecx, ecx
lea eax, [esp + 0x24]
lock xadd dword [eax], ecx
or edx, 0xffffffff
add ecx, 8
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x462403
push eax
call edi
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventA]
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
test eax, eax
jne 0x461ea7
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret