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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
mov ebp, dword [esp + 0x70]
test ebp, ebp
jne 0x100be550
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
lea edi, [ebp + 0x1c]
mov dword [esp + 0x28], 0
add dword [esp + 0x28], 1
mov dword [esp + 0x30], edi
lea eax, [esp + 0x30]
mov dword [esp + 0x3c], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x34], 0
xchg dword [edi], eax
test eax, eax
je 0x100be5bd
lea esi, [esp + 0x30]
lea edx, [eax + 0xc]
mov ecx, 0xffffffff
mov dword [eax + 4], esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100be5ab
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
xor ebx, ebx
lea eax, [esp + 0x38]
lock xadd dword [eax], ebx
test ebx, ebx
je 0x100bea70
mov eax, dword [ebp + 0x30]
mov ecx, dword [esp + 0x30]
xor edx, edx
mov dword [ebp + 0x34], eax
lea eax, [esp + 0x34]
lock xadd dword [eax], edx
test edx, edx
mov eax, edx
je 0x100beb53
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100be5f9
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov dword [esp + 0x2c], 0
mov dword [esp + 0x30], edi
mov dword [esp + 0x3c], 0
lea eax, [esp + 0x30]
mov dword [esp + 0x38], 0
mov dword [esp + 0x34], 0
xchg dword [edi], eax
test eax, eax
je 0x100be65e
lea esi, [esp + 0x30]
lea edx, [eax + 0xc]
mov ecx, 0xffffffff
mov dword [eax + 4], esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100be64c
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
xor ebx, ebx
lea eax, [esp + 0x38]
lock xadd dword [eax], ebx
test ebx, ebx
je 0x100be7d0
mov edx, dword [ebp + 0x34]
test edx, edx
je 0x100be823
mov eax, dword [edx + 4]
xor ecx, ecx
mov dword [esp + 0x4c], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x44], 0
lea esi, [esp + 0x40]
lea ebx, [eax + 8]
mov eax, ecx
mov dword [esp + 0x40], ebx
lock cmpxchg dword [ebx], esi
test eax, eax
mov ebx, eax
je 0x100be6f0
mov edx, dword [esp + 0x30]
lea eax, [esp + 0x34]
lock xadd dword [eax], ecx
test ecx, ecx
mov eax, ecx
je 0x100bea40
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100be6d1
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_Sleep]
sub esp, 4
jmp 0x100be601
mov ecx, dword [edx + 4]
mov eax, dword [edx + 8]
mov dword [esp + 0x20], edx
mov dword [ebp + 0x34], eax
mov eax, dword [ecx + 4]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x24], eax
mov eax, dword [ecx]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x18], eax
mov dword [esp + 4], 0
mov eax, dword [ecx]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
test eax, eax
je 0x100be870
cmp dword [esp + 0x28], 4
jg 0x100be870
mov edx, dword [esp + 0x30]
lea eax, [esp + 0x34]
lock xadd dword [eax], ebx
test ebx, ebx
mov eax, ebx
je 0x100be9b0
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100be783
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov ecx, dword [esp + 0x40]
lea ebx, [esp + 0x44]
xor edx, edx
lock xadd dword [ebx], edx
test edx, edx
mov eax, edx
je 0x100be981
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100be7b9
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov eax, dword [esp + 0x18]
add dword [esp + 0x2c], 1
mov dword [esp], eax
mov eax, dword [esp + 0x24]
call eax
jmp 0x100be601
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov esi, eax
mov eax, ebx
lea edx, [esp + 0x38]
lock cmpxchg dword [edx], esi
test eax, eax
je 0x100be931
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp + 0x34]
sub esp, 4
test edx, edx
jne 0x100be669
mov ecx, dword [esp + 0x30]
lea eax, [esp + 0x34]
lock xadd dword [eax], edx
test edx, edx
mov eax, edx
je 0x100beb20
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100be857
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov edx, dword [esp + 0x2c]
test edx, edx
jne 0x100be55b
jmp 0x100be53f
mov ecx, dword [edx + 0x10]
mov eax, dword [edx + 8]
test ecx, ecx
je 0x100be87d
mov dword [ecx + 8], eax
test eax, eax
je 0x100be884
mov dword [eax + 0x10], ecx
mov ecx, dword [edx]
cmp edx, dword [ecx + 0x30]
je 0x100bea30
cmp edx, dword [ecx + 0x34]
je 0x100bea20
mov ecx, dword [edx + 0x14]
mov eax, dword [edx + 0xc]
test ecx, ecx
je 0x100be8a5
mov dword [ecx + 0xc], eax
test eax, eax
je 0x100be8ac
mov dword [eax + 0x14], ecx
mov ecx, dword [edx + 4]
cmp edx, dword [ecx + 0xc]
je 0x100bea10
mov dword [esp], edx
call sub.msvcrt.dll_free
mov ecx, dword [esp + 0x30]
xor edx, edx
lea eax, [esp + 0x34]
lock xadd dword [eax], edx
test edx, edx
mov eax, edx
je 0x100be950
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100be8f2
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov ecx, dword [esp + 0x40]
lea ebx, [esp + 0x44]
xor edx, edx
lock xadd dword [ebx], edx
test edx, edx
mov eax, edx
je 0x100be9e3
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100be601
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
jmp 0x100be601
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x100be80c
lea eax, [esp + 0x30]
lock cmpxchg dword [ecx], edx
lea ebx, [esp + 0x30]
cmp ebx, eax
je 0x100be8f2
lea ecx, [esp + 0x3c]
mov ebx, edx
lock xadd dword [ecx], ebx
test ebx, ebx
je 0x100bec83
xor eax, eax
lea ebx, [esp + 0x34]
lock xadd dword [ebx], eax
jmp 0x100be8d4
mov eax, esi
lock cmpxchg dword [ecx], edx
cmp esi, eax
je 0x100be7b9
lea ecx, [esp + 0x4c]
mov esi, edx
lock xadd dword [ecx], esi
test esi, esi
je 0x100bebe1
xor eax, eax
lock xadd dword [ebx], eax
jmp 0x100be79b
lea eax, [esp + 0x30]
lock cmpxchg dword [edx], ebx
lea ecx, [esp + 0x30]
cmp ecx, eax
je 0x100be783
lea edx, [esp + 0x3c]
lock xadd dword [edx], ebx
test ebx, ebx
je 0x100beb90
xor eax, eax
lea ebx, [esp + 0x34]
lock xadd dword [ebx], eax
jmp 0x100be765
mov eax, esi
lock cmpxchg dword [ecx], edx
cmp esi, eax
je 0x100be601
lea ecx, [esp + 0x4c]
mov esi, edx
lock xadd dword [ecx], esi
test esi, esi
je 0x100bec32
xor eax, eax
lock xadd dword [ebx], eax
jmp 0x100be90a
mov dword [ecx + 0xc], eax
jmp 0x100be8b8
mov dword [ecx + 0x34], eax
jmp 0x100be898
mov dword [ecx + 0x30], eax
jmp 0x100be88f
lea eax, [esp + 0x30]
lock cmpxchg dword [edx], ecx
lea esi, [esp + 0x30]
cmp esi, eax
je 0x100be6d1
lea ebx, [esp + 0x3c]
lock xadd dword [ebx], ecx
test ecx, ecx
je 0x100beab9
xor eax, eax
lea esi, [esp + 0x34]
lock xadd dword [esi], eax
jmp 0x100be6b3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov esi, eax
mov eax, ebx
lea ecx, [esp + 0x38]
lock cmpxchg dword [ecx], esi
test eax, eax
je 0x100beb0a
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100be5bd
mov dword [esp + 0x18], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov esi, eax
mov ecx, dword [esp + 0x18]
mov eax, ecx
lock cmpxchg dword [ebx], esi
test eax, eax
je 0x100bedeb
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100bea60
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x100beaa8
lea eax, [esp + 0x30]
lock cmpxchg dword [ecx], edx
lea esi, [esp + 0x30]
cmp esi, eax
je 0x100be857
lea ebx, [esp + 0x3c]
lock xadd dword [ebx], edx
test edx, edx
je 0x100bed9e
xor eax, eax
lea esi, [esp + 0x34]
lock xadd dword [esi], eax
jmp 0x100be839
lea eax, [esp + 0x30]
lock cmpxchg dword [ecx], edx
lea esi, [esp + 0x30]
cmp esi, eax
je 0x100be5f9
lea ebx, [esp + 0x3c]
lock xadd dword [ebx], edx
test edx, edx
je 0x100bed51
xor eax, eax
lea esi, [esp + 0x34]
lock xadd dword [esi], eax
jmp 0x100be5db
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov ecx, eax
mov eax, ebx
mov edx, dword [esp + 0x1c]
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100becd0
mov dword [esp], ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100be9d4
mov dword [esp + 0x1c], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov edx, eax
mov eax, esi
mov ecx, dword [esp + 0x1c]
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x100bed0f
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100be9a1
mov dword [esp + 0x18], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov edx, eax
mov eax, esi
mov ecx, dword [esp + 0x18]
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x100bed30
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100bea03
mov dword [esp + 0x18], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov edx, eax
mov eax, ebx
mov ecx, dword [esp + 0x18]
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x100becf1
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100be972
mov dword [esp], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
mov ecx, dword [esp + 0x1c]
jmp 0x100bebd0
mov dword [esp], edx
mov dword [esp + 0x18], edx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
mov edx, dword [esp + 0x18]
jmp 0x100becbf
mov dword [esp], edx
mov dword [esp + 0x1c], edx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
mov edx, dword [esp + 0x1c]
jmp 0x100bec21
mov dword [esp], edx
mov dword [esp + 0x18], edx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
mov edx, dword [esp + 0x18]
jmp 0x100bec72
mov dword [esp + 0x18], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov esi, eax
mov edx, dword [esp + 0x18]
mov eax, edx
lock cmpxchg dword [ebx], esi
test eax, eax
je 0x100bee04
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100beb77
mov dword [esp + 0x18], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov esi, eax
mov edx, dword [esp + 0x18]
mov eax, edx
lock cmpxchg dword [ebx], esi
test eax, eax
je 0x100bee1d
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100beb44
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x100beaf9
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x100bed8d
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x100bedda