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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4aad14
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 0x41593f
mov ecx, dword [ebp + 0x10]
mov eax, 0x64
cmp ecx, eax
jae 0x415881
cmp dword [ebp + 0x14], eax
jb 0x41593f
mov eax, dword [0x4eb358]
or ebx, 0xffffffff
xor esi, esi
cmp eax, ebx
je 0x415926
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x415926
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0x14], eax
test eax, eax
mov dword [ebp - 4], esi
je 0x4158c6
mov ecx, eax
call fcn.00418520
mov esi, eax
jmp 0x4158c8
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 0x4158f4
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 0x415a12
mov eax, dword [0x4eb358]
xor esi, esi
cmp eax, 0xffffffff
je 0x4159f5
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x4159f5
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0x14], eax
test eax, eax
mov dword [ebp - 4], 1
je 0x415991
mov ecx, eax
call fcn.00418520
mov esi, eax
jmp 0x415993
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 0x4159c3
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 + 0x14]
mov dword [ebp - 4], 2
imul eax, dword [ebp + 0x10]
lea esi, [eax + eax*2]
push esi
mov dword [ebp - 0x14], esi
call fcn.0048b346
add esp, 4
mov ebx, eax
jmp 0x415a46
test ebx, ebx
mov dword [ebp - 4], 0xffffffff
jne 0x415a64
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 edi, dword [ebp + 0x14]
mov esi, dword [ebp + 0x10]
push edi
push esi
push ebx
call fcn.004168a0
add esp, 0xc
lea eax, [esi + esi*2]
push edi
push eax
push ebx
call fcn.00416840
add esp, 0xc
lea ecx, [ebp - 0x20]
call fcn.00418f10
mov ecx, dword [ebp + 8]
push edi
push esi
push ebx
push ecx
lea ecx, [ebp - 0x20]
mov dword [ebp - 4], 4
call fcn.0041ee20
push ebx
call fcn.0048b36f
mov esi, dword [ebp - 0x20]
mov eax, dword [0x4eb358]
add esp, 4
xor edx, edx
test esi, esi
sete dl
or ebx, 0xffffffff
xor edi, edi
cmp eax, ebx
mov dword [ebp + 0x10], edx
je 0x415b73
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x415b73
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0x14], eax
test eax, eax
mov byte [ebp - 4], 5
je 0x415b12
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x415b14
xor edi, edi
mov eax, dword [0x4eb358]
push edi
push eax
mov byte [ebp - 4], 4
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x415b40
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], edi
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 [ebp - 0x20]
mov dword [ebp - 4], ebx
mov dword [edi + 0xb4], eax
mov eax, dword [0x4eb358]
xor edi, edi
cmp eax, ebx
je 0x415c25
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x415c25
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [ebp + 0x14], eax
test eax, eax
mov dword [ebp - 4], 6
je 0x415bc5
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x415bc7
xor edi, edi
mov ecx, dword [0x4eb358]
push edi
push ecx
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x415bf3
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 esi, eax
push 0x4eb360
mov dword [esi], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], eax
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [edi + 4]
mov ecx, dword [ebp - 0xc]
dec eax
mov dword [edi + 4], eax
mov eax, dword [ebp + 0x10]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret