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

Disassembly:
push 0xffffffffffffffff
push 0x4aaf34
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
push ebp
push esi
push edi
lea ecx, [esp + 0xc]
call fcn.00418f10
mov eax, dword [esp + 0x2c]
mov ebp, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
push eax
push ebp
push ecx
lea ecx, [esp + 0x18]
mov dword [esp + 0x28], 0
call fcn.004265c0
mov ecx, 0x4eb358
mov dword [esp + 0x2c], eax
call fcn.00418750
mov edx, dword [esp + 0xc]
or esi, 0xffffffff
mov dword [eax + 0xb4], edx
mov eax, dword [0x4eb358]
xor edi, edi
cmp eax, esi
je 0x417a67
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x417a62
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x28], eax
test eax, eax
mov byte [esp + 0x1c], 1
je 0x4179f4
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x4179f6
xor edi, edi
mov eax, dword [0x4eb358]
push edi
push eax
mov byte [esp + 0x24], 0
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x417a25
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0x28]
push 0x4cb060
push ecx
mov dword [esp + 0x30], 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 [0x4eb358]
or esi, 0xffffffff
jmp 0x417a67
mov eax, dword [0x4eb358]
mov cl, byte [edi + 0xb0]
and cl, 1
cmp cl, 1
je 0x417c0b
cmp dword [ebp], 0x64
jb 0x417c0b
xor edi, edi
cmp eax, esi
je 0x417b2b
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x417b2b
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x28], eax
test eax, eax
mov byte [esp + 0x1c], 2
je 0x417ac3
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x417ac5
xor edi, edi
mov edx, dword [0x4eb358]
push edi
push edx
mov byte [esp + 0x24], 0
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x417af5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x28], eax
lea eax, [esp + 0x28]
push 0x4cb060
push 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 ecx, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], ecx
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
or esi, 0xffffffff
mov eax, dword [esp + 0x2c]
mov dword [edi + 0xb4], esi
test eax, eax
je 0x417b40
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x4eb358]
xor edi, edi
cmp eax, esi
mov dword [esp + 0x1c], esi
je 0x417bf0
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x417bf0
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x2c], eax
test eax, eax
mov dword [esp + 0x1c], 3
je 0x417b8c
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x417b8e
xor edi, edi
mov edx, dword [0x4eb358]
push edi
push edx
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x417bbd
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x2c]
push 0x4cb060
push 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 ecx, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], ecx
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [edi + 4]
dec eax
mov dword [edi + 4], eax
xor eax, eax
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
add esp, 0x14
ret
xor edi, edi
cmp eax, esi
mov dword [esp + 0x1c], esi
je 0x417cb6
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x417cb6
push 0xb8
call fcn.0048b346
add esp, 4
mov dword [esp + 0x28], eax
test eax, eax
mov dword [esp + 0x1c], 4
je 0x417c52
mov ecx, eax
call fcn.00418520
mov edi, eax
jmp 0x417c54
xor edi, edi
mov edx, dword [0x4eb358]
push edi
push edx
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x417c83
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x28], eax
lea eax, [esp + 0x28]
push 0x4cb060
push 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 ecx, dword [0x4eb35c]
push 0x4eb360
mov dword [esi + 4], ecx
mov dword [0x4eb35c], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [edi + 4]
mov ecx, dword [esp + 0x14]
dec eax
mov dword [edi + 4], eax
mov eax, dword [esp + 0x2c]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebp
add esp, 0x14
ret