Function at 0x512cd0
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x68
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov ecx, dword [edi + 0xaa78]
mov eax, dword [ecx + 0x38]
and eax, 0xfffff
mov dword [ebp - 0xc], eax
je 0x513097
xor esi, esi
cmp dword [ecx], esi
je 0x513097
cmp dword [ecx + 8], esi
je 0x513097
mov ebx, dword [ecx + 0x38]
mov eax, dword [ecx]
and ebx, 0xfffff
xor edx, edx
div ebx
xor ebx, ebx
mov dword [ebp - 0x10], esi
test eax, eax
mov dword [ebp - 0x1c], eax
jbe 0x513097
mov ecx, dword [ecx + 4]
mov dword [ebp - 8], ecx
lea ecx, [ecx]
mov eax, dword [ecx]
mov ecx, dword [eax + 0x24]
cmp ecx, 0xffffffff
je 0x512d6d
mov eax, dword [ecx + 0x10]
mov eax, dword [eax + 8]
and eax, 4
xor edx, edx
or eax, edx
jne 0x512d6d
test ebx, ebx
mov dword [ebp + ebx*4 - 0x34], ecx
jbe 0x512d62
mov ecx, dword [ebp + esi*4 - 0x34]
cmp dword [ebp + eax*4 - 0x34], ecx
je 0x512d62
add eax, 1
cmp eax, ebx
jb 0x512d55
cmp eax, ebx
jne 0x512d6a
add dword [ebp - 0x10], 1
add ebx, 1
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
add eax, eax
add eax, eax
add esi, 1
add ecx, eax
cmp esi, dword [ebp - 0x1c]
mov dword [ebp - 8], ecx
jb 0x512d30
test ebx, ebx
mov dword [ebp - 8], ebx
je 0x513097
xor esi, esi
test ebx, ebx
jbe 0x512e14
xor eax, eax
test esi, esi
jbe 0x512dbb
mov ecx, dword [ebp + esi*4 - 0x34]
nop
cmp dword [ebp + eax*4 - 0x34], ecx
je 0x512daf
add eax, 1
cmp eax, esi
jb 0x512da0
jmp 0x512dbb
cmp eax, esi
mov ecx, dword [ebp + eax*4 - 0x44]
mov dword [ebp + esi*4 - 0x44], ecx
jb 0x512e0d
cmp dword [ebp - 0x10], 1
mov eax, 3
je 0x512dc8
mov eax, esi
fldz
mov edx, dword [edi + 0x2900]
sub esp, 8
fstp qword [esp]
push 0
push 0
push eax
push 0
push edx
lea ebx, [ebp + esi*4 - 0x44]
push ebx
push edi
call fcn.004ca3c0
test eax, eax
jl 0x51309c
mov eax, dword [edi + 0xaa78]
mov ecx, dword [eax + 0xc]
mov eax, dword [ecx]
mov ebx, dword [ebx]
mov edx, dword [eax + 0x30]
mov dword [ebx + 0x30], edx
mov al, byte [eax + 0x34]
mov byte [ebx + 0x34], al
mov ebx, dword [ebp - 8]
add esi, 1
cmp esi, ebx
jb 0x512d95
xor ecx, ecx
xor esi, esi
mov dword [ebp - 8], ecx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], esi
jmp 0x512e25
xor ecx, ecx
mov edx, dword [edi + 0xaa78]
mov eax, dword [edx + 4]
mov eax, dword [esi + eax]
mov eax, dword [eax + 0x24]
cmp eax, 0xffffffff
je 0x512f35
mov eax, dword [eax + 0x10]
mov eax, dword [eax + 8]
and eax, 4
or eax, ecx
jne 0x512f35
cmp dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], ecx
jbe 0x512f31
lea ebx, [ebx]
fldz
mov ecx, dword [edi + 0xaa78]
mov edx, dword [ecx + 4]
mov eax, dword [edi + 0x28dc]
mov ebx, dword [esi + edx]
sub esp, 8
fstp qword [esp]
push 0
push 0
push 0
push 0
push eax
lea ecx, [ebp - 0x20]
push ecx
push edi
call fcn.004ca3c0
test eax, eax
jl 0x51309c
mov edi, dword [ebp - 0x20]
mov eax, ebx
mov edx, edi
call fcn.004db5d0
test eax, eax
jl 0x51309c
cmp dword [edi + 0x44], 0xffffffff
je 0x512efd
fldz
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x28dc]
sub esp, 8
fstp qword [esp]
push 0
push 0
push 0
push 0
push edx
lea ecx, [ebp - 0x24]
push ecx
push eax
call fcn.004ca3c0
test eax, eax
jl 0x51309c
mov eax, dword [ebx + 0x44]
mov ebx, dword [ebp - 0x24]
mov edx, ebx
call fcn.004db5d0
test eax, eax
jl 0x51309c
mov edx, dword [ebp - 8]
mov eax, dword [ebp + edx*4 - 0x44]
mov dword [edi + 0x44], ebx
mov dword [ebx + 0x24], eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + ecx*4 - 0x44]
mov eax, dword [ebp + 8]
mov dword [edi + 0x24], edx
mov ecx, dword [eax + 0xaa78]
mov eax, dword [ebp - 0x10]
mov edx, dword [ecx + 4]
mov dword [esi + edx], edi
mov edi, dword [ebp + 8]
add eax, 1
add esi, 4
cmp eax, dword [ebp - 0xc]
mov dword [ebp - 0x10], eax
jb 0x512e60
mov esi, dword [ebp - 0x18]
add dword [ebp - 8], 1
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x14]
add eax, eax
add eax, eax
add ecx, 1
add esi, eax
cmp ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], esi
jb 0x512e23
mov eax, dword [0x776138]
test eax, eax
jge 0x512f60
xor eax, eax
jmp 0x512f67
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x10], 0
je 0x512f8e
mov ecx, dword [eax + 0x10]
test ecx, ecx
jne 0x512f78
mov edi, ecx
jmp 0x512f9c
mov edx, dword [ecx]
test edx, edx
mov dword [eax + 0x10], edx
jne 0x512f84
mov dword [eax + 0x14], edx
mov dword [ecx], 0xfefefefe
mov edi, ecx
jmp 0x512f9c
mov ecx, dword [eax + 0xc]
push 0x10
push 0x40
call fcn.007515ae
mov edi, eax
xor ebx, ebx
cmp edi, ebx
je 0x513089
or eax, 0xffffffff
mov dword [edi + 0x10], eax
mov dword [edi + 0x20], eax
xor esi, esi
xor eax, eax
cmp dword [ebp - 8], ebx
mov dword [edi], ebx
mov dword [edi + 8], ebx
mov dword [edi + 0x38], ebx
mov dword [edi + 4], ebx
mov word [edi + 0x3c], bx
mov dword [edi + 0xc], ebx
mov word [edi + 0x3e], bx
mov dword [edi + 0x14], ebx
mov dword [edi + 0x18], ebx
mov dword [edi + 0x1c], ebx
mov dword [edi + 0x24], ebx
mov dword [edi + 0x30], ebx
mov dword [edi + 0x34], ebx
jbe 0x51301c
xor ecx, ecx
cmp eax, ebx
jbe 0x512ffd
mov edx, dword [ebp + eax*4 - 0x34]
lea ebx, [ebx]
cmp dword [ebp + ecx*4 - 0x34], edx
je 0x512ffd
add ecx, 1
cmp ecx, eax
jb 0x512ff0
cmp ecx, eax
jne 0x513014
mov ecx, dword [ebp + eax*4 - 0x44]
mov edx, dword [ebp + eax*4 - 0x34]
mov dword [ebp + esi*4 - 0x54], ecx
mov dword [ebp + esi*4 - 0x64], edx
add esi, 1
add eax, 1
cmp eax, dword [ebp - 8]
jb 0x512fe0
mov eax, esi
push ebx
and eax, 0xfffff
or eax, 0x10000000
push edi
mov edx, esi
mov ecx, esi
call fcn.004cc5e0
cmp eax, ebx
jl 0x51309c
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0xaa78]
mov ecx, dword [eax + 0x30]
mov dword [edi + 0x30], ecx
mov edx, dword [eax + 0x34]
mov ecx, dword [edi + 0xc]
add esi, esi
add esi, esi
push esi
lea eax, [ebp - 0x54]
push eax
push ecx
mov dword [edi + 0x34], edx
call sub.msvcrt.dll_memcpy
mov eax, dword [edi + 4]
add esp, 0xc
push esi
lea edx, [ebp - 0x64]
push edx
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
push edi
mov esi, ebx
call fcn.004ca180
test eax, eax
jl 0x51309c
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, 0x8007000e
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4