Function at 0x513420
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x160
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xaa78]
push ebx
push esi
mov esi, dword [eax + 0x38]
push edi
xor ebx, ebx
push 0x80
mov edi, esi
lea ecx, [ebp - 0x15c]
push ebx
and edi, 0xfffff
push ecx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x34], 1
mov dword [ebp - 0x30], 2
mov dword [ebp - 0x2c], 3
mov dword [ebp - 0x14], edi
call sub.msvcrt.dll_memset
and esi, 0xfff00000
add esp, 0xc
cmp esi, 0x30000000
je 0x513493
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
cmp edi, ebx
mov byte [ebp - 5], bl
mov byte [ebp - 0xd], bl
mov byte [ebp - 0xe], bl
mov byte [ebp - 0xf], bl
mov dword [ebp - 0xc], ebx
jbe 0x5136f3
mov edx, dword [ebp + 8]
fldz
mov eax, dword [edx + 0xaa78]
mov ecx, dword [eax + 4]
mov eax, edi
lea ebx, [eax*4]
lea edi, [eax*8]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x20], edi
mov eax, dword [ebp - 0x1c]
mov edx, dword [eax + ebx]
mov ecx, dword [eax + edi]
mov eax, dword [edx + 0x10]
fld qword [ecx + 0xa8]
mov eax, dword [eax + 8]
and eax, 0x100
xor esi, esi
or eax, esi
je 0x513523
fld st(1)
fcomp qword [edx + 0xa8]
fnstsw ax
test ah, 0x44
jp 0x513523
cmp dword [edx + 0x24], 0xffffffff
jne 0x513523
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xaa78]
mov eax, dword [eax + 4]
mov edx, dword [eax + edi]
mov esi, dword [ebp - 0xc]
cmp edx, dword [eax + esi*4]
jne 0x513523
mov byte [ebp - 5], 1
jmp 0x51352a
mov esi, dword [ebp - 0xc]
mov byte [ebp - 0xe], 1
mov eax, dword [ecx + 0x10]
mov eax, dword [eax + 8]
and eax, 0x100
xor edx, edx
or eax, edx
je 0x513566
fld st(1)
fucompp
fnstsw ax
test ah, 0x44
jp 0x513568
cmp dword [ecx + 0x24], 0xffffffff
jne 0x513568
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xaa78]
mov eax, dword [ecx + 4]
mov edx, dword [eax + ebx]
cmp edx, dword [eax + esi*4]
jne 0x513568
mov byte [ebp - 0xd], 1
jmp 0x51356c
fstp st(0)
mov byte [ebp - 0xf], 1
add esi, 1
add edi, 4
add ebx, 4
cmp esi, dword [ebp - 0x14]
mov dword [ebp - 0xc], esi
jb 0x5134d1
cmp byte [ebp - 5], 0
fstp st(0)
je 0x5135fe
cmp byte [ebp - 0xe], 0
jne 0x5135fe
call fcn.004ce850
mov edx, eax
test edx, edx
je 0x5135f0
mov edi, dword [ebp - 0x14]
xor ebx, ebx
or eax, 0xffffffff
mov dword [edx + 0x10], eax
mov dword [edx + 0x20], eax
push ebx
mov eax, edi
and eax, 0xfffff
mov dword [edx], ebx
mov dword [edx + 8], ebx
mov dword [edx + 0x38], ebx
mov dword [edx + 4], ebx
mov word [edx + 0x3c], bx
mov dword [edx + 0xc], ebx
mov word [edx + 0x3e], bx
mov dword [edx + 0x14], ebx
mov dword [edx + 0x18], ebx
mov dword [edx + 0x1c], ebx
mov dword [edx + 0x24], ebx
mov dword [edx + 0x30], ebx
mov dword [edx + 0x34], ebx
mov esi, edx
push edx
lea ecx, [edi + edi]
or eax, 0x70b00000
mov edx, edi
call fcn.004cc5e0
mov edi, eax
cmp edi, ebx
jmp 0x51364e
mov eax, 0x8007000e
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
cmp byte [ebp - 0xd], 0
je 0x5136f3
cmp byte [ebp - 0xf], 0
jne 0x5136f3
cmp dword [ebp + 0xc], 0
jne 0x513485
call fcn.004ce850
test eax, eax
je 0x5135f0
call fcn.004cc410
mov esi, eax
test esi, esi
je 0x5135f0
mov edx, dword [ebp - 0x14]
mov eax, edx
push 0
and eax, 0xfffff
lea ecx, [edx + edx]
or eax, 0x70c00000
push esi
call fcn.004cc5e0
mov edi, eax
test edi, edi
jl 0x5136cb
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0xaa78]
mov ecx, dword [eax + 0x30]
mov edi, dword [ebp - 0x18]
mov dword [esi + 0x30], ecx
mov edx, dword [eax + 0x34]
mov dword [esi + 0x34], edx
mov eax, dword [ebx + 0xaa78]
mov ecx, dword [eax + 0xc]
mov edx, dword [esi + 0xc]
push edi
push ecx
push edx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebx + 0xaa78]
mov ecx, dword [eax + 4]
mov edx, dword [esi + 4]
add esp, 0xc
push edi
push ecx
push edx
call sub.msvcrt.dll_memcpy
mov edx, dword [esi + 4]
mov eax, dword [ebx + 0xaa78]
mov ecx, dword [eax + 4]
add esp, 0xc
add edx, edi
cmp byte [ebp - 5], 0
push edi
je 0x5136af
add ecx, edi
jmp 0x5136b2
add ecx, dword [ebp - 0x20]
push ecx
push edx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebx + 0xaa78]
add esp, 0xc
push esi
push eax
call fcn.004ccff0
mov edi, eax
xor ebx, ebx
cmp esi, ebx
je 0x513bae
cmp word [esi + 0x3c], bx
je 0x513b1c
mov eax, dword [0x776138]
cmp eax, ebx
jge 0x513ae6
xor eax, eax
jmp 0x513aed
cmp dword [ebp + 0xc], 0
mov edx, dword [ebp - 0x14]
sete cl
lea eax, [ebp - 0x38]
push ecx
push edx
push eax
lea ecx, [ebp - 0xdc]
push ecx
mov ecx, dword [ebp + 8]
lea edx, [ebp - 0x28]
push edx
lea eax, [ebp - 0x15c]
push eax
mov eax, dword [ecx + 0xaa78]
push 0x429300
push eax
call fcn.004e14d0
cmp dword [ebp - 0x28], 0x20
mov edi, eax
jbe 0x513741
mov edi, 0x80004005
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
test edi, edi
jne 0x513bae
mov byte [ebp - 5], 0
xor cl, cl
mov dword [ebp - 0xc], 0
jmp 0x513760
mov dword [ebp - 0x1c], 0
xor edi, edi
cmp dword [ebp - 0x14], edi
mov dword [ebp - 0x18], edi
jbe 0x513888
mov eax, dword [ebp - 0xc]
add eax, eax
add eax, eax
lea ecx, [eax + edi]
mov edx, dword [ebp + ecx*4 - 0xdc]
mov ecx, edi
sub ecx, eax
mov eax, dword [ebp + ecx*4 - 0xcc]
mov ecx, dword [ebp - 0x1c]
fld qword [eax + 0xa8]
mov ebx, edi
sub ebx, ecx
lea esi, [ecx + edi]
mov ecx, dword [ebp + ebx*4 - 0xac]
mov ebx, dword [eax + 0x10]
fld qword [ecx + 0xa8]
mov esi, dword [ebp + esi*4 - 0xbc]
cmp dword [edx + 0x44], esi
mov dword [ebp - 0x20], ebx
mov ebx, dword [ecx + 0x10]
mov dword [ebp - 0x24], ebx
je 0x5137db
cmp dword [esi + 0x44], edx
je 0x5137db
mov ebx, dword [edx + 0x44]
cmp ebx, 0xffffffff
je 0x5137f1
cmp ebx, dword [esi + 0x44]
mov edi, dword [ebp - 0x18]
jne 0x5137f1
mov ebx, dword [edx + 0x48]
xor ebx, 0x400
cmp ebx, dword [esi + 0x48]
jne 0x5137f1
cmp eax, ecx
jne 0x5137f1
mov cl, 1
jmp 0x513861
cmp edx, esi
jne 0x51385f
mov edx, dword [eax + 0x44]
cmp edx, ecx
je 0x51380c
mov esi, dword [ecx + 0x44]
cmp esi, eax
je 0x51380c
cmp edx, 0xffffffff
je 0x513820
cmp edx, esi
jne 0x513820
mov edx, dword [eax + 0x48]
xor edx, 0x400
cmp edx, dword [ecx + 0x48]
jne 0x513820
mov cl, 1
mov al, cl
jmp 0x513863
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 8]
and eax, 0x100
xor ecx, ecx
or eax, ecx
je 0x513855
mov ecx, dword [ebp - 0x24]
mov eax, dword [ecx + 8]
and eax, 0x100
xor ecx, ecx
or eax, ecx
je 0x513855
fxch st(1)
fchs
fucompp
fnstsw ax
test ah, 0x44
jp 0x513859
mov cl, 1
mov al, cl
jmp 0x513867
fstp st(1)
fstp st(0)
xor cl, cl
xor al, al
jmp 0x513867
xor cl, cl
xor al, al
fstp st(1)
fstp st(0)
test edi, edi
jne 0x513870
mov byte [ebp - 5], al
jmp 0x513875
cmp byte [ebp - 5], al
jne 0x5138c0
test cl, cl
je 0x51388c
add edi, 1
cmp edi, dword [ebp - 0x14]
mov dword [ebp - 0x18], edi
jb 0x513775
test cl, cl
jne 0x5138c4
mov eax, dword [ebp - 0x1c]
add eax, 4
cmp eax, 8
mov dword [ebp - 0x1c], eax
jb 0x513767
mov eax, dword [ebp - 0xc]
add eax, 1
cmp eax, 2
mov dword [ebp - 0xc], eax
jb 0x513760
mov edi, 1
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
xor cl, cl
jmp 0x51388c
mov eax, dword [0x776138]
xor edi, edi
cmp eax, edi
jge 0x5138d3
xor eax, eax
jmp 0x5138da
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x10], edi
je 0x513902
mov ecx, dword [eax + 0x10]
cmp ecx, edi
jne 0x5138ec
xor ecx, ecx
mov esi, ecx
jmp 0x513910
mov edx, dword [ecx]
cmp edx, edi
mov dword [eax + 0x10], edx
jne 0x5138f8
mov dword [eax + 0x14], edi
mov dword [ecx], 0xfefefefe
mov esi, ecx
jmp 0x513910
mov ecx, dword [eax + 0xc]
push 0x10
push 0x40
call fcn.007515ae
mov esi, eax
cmp esi, edi
je 0x513a38
or eax, 0xffffffff
cmp byte [ebp - 5], 0
mov dword [esi], edi
mov dword [esi + 8], edi
mov dword [esi + 0x10], eax
mov dword [esi + 0x38], edi
mov dword [esi + 4], edi
mov word [esi + 0x3c], di
mov dword [esi + 0xc], edi
mov word [esi + 0x3e], di
mov dword [esi + 0x14], edi
mov dword [esi + 0x18], edi
mov dword [esi + 0x1c], edi
mov dword [esi + 0x20], eax
mov dword [esi + 0x24], edi
mov dword [esi + 0x30], edi
mov dword [esi + 0x34], edi
je 0x513a48
cmp dword [ebp - 0xc], 1
je 0x513a4d
mov ebx, dword [ebp - 0x14]
cmp dword [ebp - 0xc], 0
jne 0x513989
mov eax, ebx
push 0
and eax, 0xfffff
lea ecx, [ebx + ebx]
or eax, 0x70c00000
push esi
mov edx, ebx
call fcn.004cc5e0
mov edi, eax
test edi, edi
jl 0x5136cb
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0xaa78]
mov edx, dword [eax + 0x30]
mov dword [esi + 0x30], edx
mov eax, dword [eax + 0x34]
mov dword [esi + 0x34], eax
mov ecx, dword [ecx + 0xaa78]
mov edx, dword [ecx + 0xc]
mov eax, dword [esi + 0xc]
lea edi, [ebx*4]
push edi
push edx
push eax
mov dword [ebp - 0x20], 0
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0xc]
mov edx, dword [esi + 4]
add esp, 0xc
shl eax, 4
push edi
lea ecx, [ebp + eax - 0xdc]
push ecx
push edx
mov dword [ebp - 0x24], eax
call sub.msvcrt.dll_memcpy
mov ecx, dword [esi + 4]
add esp, 0xc
lea eax, [ebp - 0xcc]
sub eax, dword [ebp - 0x24]
push edi
push eax
add ecx, edi
push ecx
call sub.msvcrt.dll_memcpy
mov eax, dword [esi + 4]
mov edx, dword [eax]
mov edi, dword [edi + eax]
mov eax, dword [esi + 0xc]
mov ecx, dword [eax]
add esp, 0xc
cmp byte [ebp + 0x18], 0
je 0x513a91
mov eax, dword [ecx + 0x10]
cmp eax, dword [edx + 0x10]
jne 0x513a21
mov ebx, dword [ecx + 0x28]
cmp ebx, dword [edx + 0x28]
je 0x513a2e
cmp eax, dword [edi + 0x10]
jne 0x513a91
mov ecx, dword [ecx + 0x28]
cmp ecx, dword [edi + 0x28]
jne 0x513a91
mov edi, 1
jmp 0x5136cb
mov edi, 0x8007000e
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
cmp dword [ebp - 0xc], edi
jne 0x513a7f
mov ebx, dword [ebp - 0x14]
mov eax, ebx
push 0
and eax, 0xfffff
lea ecx, [ebx + ebx]
or eax, 0x70b00000
push esi
mov edx, ebx
call fcn.004cc5e0
mov edi, eax
test edi, edi
jl 0x5136cb
cmp byte [ebp - 5], 0
jne 0x513960
jmp 0x513a82
mov ebx, dword [ebp - 0x14]
cmp dword [ebp - 0xc], 1
je 0x513966
jmp 0x513989
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x513ad6
mov edx, dword [ebp - 0x28]
mov dword [eax], esi
xor eax, eax
test edx, edx
jbe 0x513ac3
mov ecx, dword [ebp + 0x10]
lea ecx, [ecx + edx*4 - 4]
lea ebx, [ebx]
mov esi, dword [ebp + eax*4 - 0x15c]
mov dword [ecx], esi
add eax, 1
sub ecx, 4
cmp eax, edx
jb 0x513ab0
mov eax, dword [ebp + 0x14]
mov edi, dword [ebp - 0x20]
mov dword [eax], edx
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0xaa78]
push esi
push edx
jmp 0x5136c4
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx ecx, word [esi + 0x3c]
cmp ecx, dword [eax + 0x120]
ja 0x513b15
mov edx, dword [esi + 4]
mov eax, dword [eax + 0x11c]
shl ecx, 4
cmp edx, ebx
lea ecx, [eax + ecx - 0x10]
je 0x513b15
mov eax, dword [ecx + 4]
mov dword [edx], eax
mov dword [ecx + 4], edx
mov word [esi + 0x3c], bx
mov dword [esi + 4], ebx
cmp word [esi + 0x3e], bx
je 0x513b65
mov eax, dword [0x776138]
cmp eax, ebx
jge 0x513b2f
xor eax, eax
jmp 0x513b36
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx ecx, word [esi + 0x3e]
cmp ecx, dword [eax + 0x120]
ja 0x513b5e
mov edx, dword [esi + 0xc]
mov eax, dword [eax + 0x11c]
shl ecx, 4
cmp edx, ebx
lea ecx, [eax + ecx - 0x10]
je 0x513b5e
mov eax, dword [ecx + 4]
mov dword [edx], eax
mov dword [ecx + 4], edx
mov word [esi + 0x3e], bx
mov dword [esi + 0xc], ebx
mov eax, dword [0x776138]
cmp eax, ebx
jl 0x513bae
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
test ebx, ebx
je 0x513bae
push 0x40
push 0xfe
push esi
call sub.msvcrt.dll_memset
mov dword [esi], 0
mov eax, dword [ebx + 0x14]
add esp, 0xc
test eax, eax
je 0x513ba8
mov dword [eax], esi
mov dword [ebx + 0x14], esi
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov dword [ebx + 0x10], esi
mov dword [ebx + 0x14], esi
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14