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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10069af5
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push esi
push edi
mov eax, dword [0x10086040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, ecx
mov dword [ebp - 0x10], eax
mov esi, dword [eax + 0x18]
push dword [0x10089498]
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
lea eax, [esi + 0x14]
neg esi
sbb esi, esi
and esi, eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x1000aa9b
nop
cmp dword [eax], esi
je 0x1000aaef
mov eax, dword [eax + 8]
test eax, eax
jne 0x1000aa90
mov eax, dword [edi]
add eax, 0x20
push eax
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp + 8], eax
call eax
mov eax, dword [edi]
cmp byte [eax + 0x38], 0
je 0x1000ac62
mov dword [ebx + 0x14], 0
mov ecx, dword [eax + 0x40]
test ecx, ecx
je 0x1000ac3c
mov dword [ecx + 0x14], ebx
mov dword [eax + 0x40], ebx
mov eax, dword [edi]
add eax, 0x20
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov esi, dword [eax + 4]
mov eax, dword [edi]
add eax, 0x20
push eax
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp + 8], eax
call eax
test esi, esi
je 0x1000aaab
mov eax, dword [edi]
cmp byte [eax + 0x38], 0
jne 0x1000aaab
mov byte [eax + 0x38], 1
mov eax, dword [edi]
add eax, 0x20
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [ebp + 0xc], eax
call eax
mov eax, dword [edi]
push dword [0x1008948c]
mov dword [ebp - 0x30], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x30]
push eax
push dword [0x1008948c]
mov dword [ebp - 0x2c], eax
mov eax, dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [ebp - 0x14], eax
call eax
mov esi, dword [ebp - 0x10]
mov dword [ebp - 4], 0
mov edi, dword [edi]
mov dword [ebp - 0x20], edi
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x24], eax
push 0
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 1
push ecx
push ebx
push eax
mov eax, dword [ebx + 0x18]
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0x10086bb8
call eax
add esp, 0x10
lea eax, [edi + 0x20]
lea ebx, [edi + 0x20]
push eax
call dword [ebp + 8]
mov ecx, dword [edi + 0x3c]
test ecx, ecx
je 0x1000abbb
mov eax, dword [edi + 0x48]
test eax, eax
je 0x1000aba4
mov dword [eax + 0x14], ecx
jmp 0x1000aba7
mov dword [edi + 0x44], ecx
mov eax, dword [edi + 0x40]
mov dword [edi + 0x48], eax
mov dword [edi + 0x3c], 0
mov dword [edi + 0x40], 0
mov esi, dword [edi + 0x44]
test esi, esi
push ebx
setne al
mov byte [edi + 0x38], al
call dword [ebp + 0xc]
test esi, esi
je 0x1000ac1c
mov ebx, dword [ebp - 0x10]
lock inc dword [ebx + 0x18]
push edi
push 0
push 0
mov dword [edi + 0x1c], 1
push dword [ebx + 0x14]
call dword [sym.imp.KERNEL32.dll_PostQueuedCompletionStatus]
test eax, eax
jne 0x1000ac1c
lea esi, [ebx + 0x38]
push esi
call dword [ebp + 8]
mov dword [edi + 0x14], 0
mov eax, dword [ebx + 0x58]
test eax, eax
je 0x1000ac08
mov dword [eax + 0x14], edi
jmp 0x1000ac0b
mov dword [ebx + 0x54], edi
mov dword [ebx + 0x58], edi
lea eax, [ebx + 0x34]
mov ecx, 1
xchg dword [eax], ecx
push esi
call dword [ebp + 0xc]
push dword [ebp - 0x28]
push dword [0x1008948c]
call dword [ebp - 0x14]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov dword [eax + 0x3c], ebx
mov dword [eax + 0x40], ebx
mov eax, dword [edi]
add eax, 0x20
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov byte [eax + 0x38], 1
mov eax, dword [edi]
add eax, 0x20
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [ebp + 0xc], eax
call eax
mov eax, dword [edi]
mov dword [ebx + 0x14], 0
mov ecx, dword [eax + 0x48]
test ecx, ecx
je 0x1000ac8b
mov dword [ecx + 0x14], ebx
jmp 0x1000ac8e
mov dword [eax + 0x44], ebx
mov esi, dword [ebp - 0x10]
mov dword [eax + 0x48], ebx
mov edi, dword [edi]
mov esi, dword [esi + 0x18]
lock inc dword [esi + 0x18]
push edi
push 0
push 0
mov dword [edi + 0x1c], 1
push dword [esi + 0x14]
call dword [sym.imp.KERNEL32.dll_PostQueuedCompletionStatus]
test eax, eax
jne 0x1000ace4
lea ebx, [esi + 0x38]
push ebx
call dword [ebp + 8]
mov dword [edi + 0x14], 0
mov eax, dword [esi + 0x58]
test eax, eax
je 0x1000acd0
mov dword [eax + 0x14], edi
jmp 0x1000acd3
mov dword [esi + 0x54], edi
mov dword [esi + 0x58], edi
lea eax, [esi + 0x34]
mov ecx, 1
xchg dword [eax], ecx
push ebx
call dword [ebp + 0xc]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8