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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4aad54
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
sub esp, 0x10
push ebx
push esi
push edi
mov ecx, 0x4eb358
mov dword [ebp - 0x10], esp
call fcn.00418750
mov al, byte [eax + 0xb0]
and al, 1
cmp al, 1
je 0x415d4f
mov ecx, dword [ebp + 0x10]
mov eax, 0x64
cmp ecx, eax
jae 0x415c91
cmp dword [ebp + 0x14], eax
jb 0x415d4f
mov eax, dword [0x4eb358]
or ebx, 0xffffffff
xor esi, esi
cmp eax, ebx
je 0x415d36
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x415d36
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0x14], eax
test eax, eax
mov dword [ebp - 4], esi
je 0x415cd6
mov ecx, eax
call fcn.00418520
mov esi, eax
jmp 0x415cd8
xor esi, esi
mov ecx, dword [0x4eb358]
push esi
push ecx
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x415d04
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [ebp + 0x14]
push 0x4cb060
push edx
mov dword [ebp + 0x14], eax
call fcn.00472a64
push 8
call fcn.0048b346
add esp, 4
mov edi, eax
push 0x4eb360
mov dword [edi], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x4eb35c]
push 0x4eb360
mov dword [edi + 4], eax
mov dword [0x4eb35c], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esi + 0xb4], ebx
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
test eax, eax
jne 0x415e22
mov eax, dword [0x4eb358]
xor esi, esi
cmp eax, 0xffffffff
je 0x415e05
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x415e05
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0x14], eax
test eax, eax
mov dword [ebp - 4], 1
je 0x415da1
mov ecx, eax
call fcn.00418520
mov esi, eax
jmp 0x415da3
xor esi, esi
mov ecx, dword [0x4eb358]
push esi
push ecx
mov dword [ebp - 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x415dd3
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [ebp + 0x14]
push 0x4cb060
push edx
mov dword [ebp + 0x14], eax
call fcn.00472a64
push 8
call fcn.0048b346
add esp, 4
mov edi, eax
push 0x4eb360
mov dword [edi], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x4eb35c]
push 0x4eb360
mov dword [edi + 4], eax
mov dword [0x4eb35c], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esi + 0xb4], 5
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x20]
test eax, eax
jne 0x415e3c
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 0x14]
mov dword [ebp - 4], 2
imul esi, dword [ebp + 0x10]
push esi
mov dword [ebp - 0x14], esi
call fcn.0048b346
add esp, 4
mov ebx, eax
jmp 0x415e6d
test ebx, ebx
mov dword [ebp - 4], 0xffffffff
jne 0x415e8b
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, esi
mov esi, dword [ebp + 0xc]
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp + 0x14]
mov edi, dword [ebp + 0x10]
push esi
push edi
push ebx
call fcn.00416840
add esp, 0xc
lea ecx, [ebp - 0x20]
call fcn.00418f10
mov eax, dword [ebp + 0x20]
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ebp + 0x18]
push eax
mov eax, dword [ebp + 8]
push ecx
push edx
push esi
push edi
push ebx
push eax
lea ecx, [ebp - 0x20]
mov dword [ebp - 4], 4
call fcn.0041ee50
mov edi, dword [ebp - 0x20]
xor ecx, ecx
test edi, edi
sete cl
push ebx
mov dword [ebp + 0x10], ecx
call fcn.0048b36f
mov eax, dword [0x4eb358]
or edi, 0xffffffff
add esp, 4
xor ebx, ebx
cmp eax, edi
je 0x415f99
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
test ebx, ebx
jne 0x415f99
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0x14], eax
test eax, eax
mov byte [ebp - 4], 5
je 0x415f37
mov ecx, eax
call fcn.00418520
mov ebx, eax
jmp 0x415f39
xor ebx, ebx
mov edx, dword [0x4eb358]
push ebx
push edx
mov byte [ebp - 4], 4
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x415f66
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0x14], eax
lea eax, [ebp + 0x14]
push 0x4cb060
push eax
call fcn.00472a64
push 8
call fcn.0048b346
add esp, 4
mov esi, eax
push 0x4eb360
mov dword [esi], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], ecx
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [ebp - 0x20]
mov dword [ebp - 4], edi
mov dword [ebx + 0xb4], edx
mov eax, dword [0x4eb358]
xor ebx, ebx
cmp eax, edi
je 0x41604b
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
test ebx, ebx
jne 0x41604b
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0x14], eax
test eax, eax
mov dword [ebp - 4], 6
je 0x415feb
mov ecx, eax
call fcn.00418520
mov ebx, eax
jmp 0x415fed
xor ebx, ebx
mov eax, dword [0x4eb358]
push ebx
push eax
mov dword [ebp - 4], edi
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x416018
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [ebp + 0x14]
push 0x4cb060
push ecx
mov dword [ebp + 0x14], eax
call fcn.00472a64
push 8
call fcn.0048b346
add esp, 4
mov esi, eax
push 0x4eb360
mov dword [esi], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], edx
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx + 4]
mov ecx, dword [ebp - 0xc]
dec eax
pop edi
mov dword [ebx + 4], eax
mov eax, dword [ebp + 0x10]
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret