Function at 0x518140
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x164
push ebx
push esi
push edi
mov edi, eax
mov eax, dword [edi + 0xaa78]
mov ebx, dword [eax + 0x38]
push 1
and ebx, 0xfffff
push ebx
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0xe0]
push edx
lea ecx, [ebp - 0xc]
push ecx
lea edx, [ebp - 0x160]
push edx
push 0x42bab0
xor esi, esi
push eax
mov ecx, edi
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0x18], 2
mov dword [ebp - 0x14], 3
call fcn.004e14d0
cmp eax, esi
je 0x5182a6
push 1
push ebx
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0xe0]
push ecx
mov ecx, dword [edi + 0xaa78]
lea edx, [ebp - 0xc]
push edx
lea eax, [ebp - 0x160]
push eax
push 0x42bc40
push ecx
mov ecx, edi
call fcn.004e14d0
cmp eax, esi
je 0x5182a6
push 1
push ebx
lea edx, [ebp - 0x20]
push edx
lea eax, [ebp - 0xe0]
push eax
mov eax, dword [edi + 0xaa78]
lea ecx, [ebp - 0xc]
push ecx
lea edx, [ebp - 0x160]
push edx
push 0x42bdd0
push eax
mov ecx, edi
call fcn.004e14d0
cmp eax, esi
je 0x5182a6
push 1
push ebx
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0xe0]
push edx
mov edx, dword [edi + 0xaa78]
lea eax, [ebp - 0xc]
push eax
lea ecx, [ebp - 0x160]
push ecx
push 0x42bf60
push edx
mov ecx, edi
call fcn.004e14d0
cmp eax, esi
je 0x5182a6
push 1
push ebx
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0xe0]
push ecx
mov ecx, dword [edi + 0xaa78]
lea edx, [ebp - 0xc]
push edx
lea eax, [ebp - 0x160]
push eax
push 0x42c0f0
push ecx
mov ecx, edi
call fcn.004e14d0
cmp eax, esi
je 0x5182a6
push 1
push ebx
lea edx, [ebp - 0x20]
push edx
lea eax, [ebp - 0xe0]
push eax
mov eax, dword [edi + 0xaa78]
lea ecx, [ebp - 0xc]
push ecx
lea edx, [ebp - 0x160]
push edx
push 0x42c280
push eax
mov ecx, edi
call fcn.004e14d0
cmp eax, esi
jne 0x5185ab
lea esi, [ebx*4]
push esi
lea ecx, [ebp - 0xb0]
push ecx
lea edx, [ebp - 0x20]
push edx
call sub.msvcrt.dll_memcpy
add esp, 0xc
push esi
lea eax, [ebp - 0xe0]
push eax
lea ecx, [ebp - 0x40]
push ecx
call sub.msvcrt.dll_memcpy
add esp, 0xc
push esi
lea edx, [ebp - 0xc0]
push edx
lea eax, [ebp - 0x30]
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
xor edx, edx
test ebx, ebx
jbe 0x518335
mov cl, byte [edi + 0xab]
shr cl, 4
and cl, 1
mov byte [ebp - 1], cl
mov edi, edi
test cl, cl
mov eax, dword [ebp + edx*4 - 0x20]
je 0x51832e
test byte [eax + 0x48], 1
jne 0x51832e
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0xc], eax
mov eax, ecx
and eax, 4
xor esi, esi
or eax, esi
je 0x518342
and ecx, 0x10
xor eax, eax
or ecx, eax
je 0x518342
mov cl, byte [ebp - 1]
add edx, 1
cmp edx, ebx
jb 0x518300
mov eax, dword [0x776138]
test eax, eax
jge 0x518369
xor eax, eax
jmp 0x518370
mov ecx, dword [edi + 0xaa78]
mov esi, dword [ecx + 0x34]
push 0x461d2c
push 0x125f
call fcn.004f6060
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [eax + 0x10], 0
je 0x518397
mov ecx, dword [eax + 0x10]
test ecx, ecx
jne 0x518381
mov esi, ecx
jmp 0x5183a5
mov edx, dword [ecx]
test edx, edx
mov dword [eax + 0x10], edx
jne 0x51838d
mov dword [eax + 0x14], edx
mov dword [ecx], 0xfefefefe
mov esi, ecx
jmp 0x5183a5
mov ecx, dword [eax + 0xc]
push 0x10
push 0x40
call fcn.007515ae
mov esi, eax
xor eax, eax
cmp esi, eax
je 0x5184ac
push eax
mov dword [esi], eax
mov dword [esi + 8], eax
mov dword [esi + 0x38], eax
mov dword [esi + 4], eax
mov word [esi + 0x3c], ax
mov dword [esi + 0xc], eax
mov word [esi + 0x3e], ax
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x24], eax
mov dword [esi + 0x30], eax
mov dword [esi + 0x34], eax
or ecx, 0xffffffff
mov eax, ebx
and eax, 0xfffff
mov dword [esi + 0x10], ecx
mov dword [esi + 0x20], ecx
lea ecx, [ebx + ebx*2]
or eax, 0x70100000
push esi
mov edx, ebx
call fcn.004cc5e0
test eax, eax
mov dword [ebp - 0xc], eax
jl 0x518497
mov eax, dword [edi + 0xaa78]
mov edx, dword [eax + 0x30]
mov dword [esi + 0x30], edx
mov eax, dword [eax + 0x34]
mov dword [esi + 0x34], eax
mov ecx, dword [edi + 0xaa78]
mov edx, dword [ecx + 0xc]
lea eax, [ebx*4]
push eax
mov eax, dword [esi + 0xc]
push edx
push eax
call sub.msvcrt.dll_memcpy
mov edx, dword [esi + 4]
add esp, 0xc
lea eax, [ebx*4]
push eax
lea ecx, [ebp - 0x20]
push ecx
push edx
call sub.msvcrt.dll_memcpy
mov edx, dword [esi + 4]
add esp, 0xc
lea eax, [ebx*4]
push eax
lea ecx, [ebp - 0x30]
push ecx
add edx, eax
push edx
call sub.msvcrt.dll_memcpy
mov ecx, dword [esi + 4]
add esp, 0xc
lea eax, [ebx*4]
push eax
lea eax, [ebp - 0x40]
push eax
lea edx, [ecx + ebx*8]
push edx
call sub.msvcrt.dll_memcpy
mov eax, dword [edi]
mov edx, dword [eax + 0x3c]
add esp, 0xc
push 0
push esi
mov ecx, edi
call edx
test al, al
je 0x5184b8
mov dword [ebp - 0xc], 1
xor ecx, ecx
cmp word [esi + 0x3c], cx
je 0x518515
mov eax, dword [0x776138]
cmp eax, ecx
jge 0x5184dd
xor eax, eax
jmp 0x5184e4
mov eax, 0x8007000e
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
or edx, 0xffffffff
mov ecx, esi
call fcn.00482d90
mov eax, dword [edi + 0xaa78]
push 1
push 0
push esi
push eax
push edi
call fcn.004ca960
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx ecx, word [esi + 0x3c]
cmp ecx, dword [eax + 0x120]
ja 0x51850c
mov edx, dword [esi + 4]
mov eax, dword [eax + 0x11c]
shl ecx, 4
test edx, edx
lea eax, [ecx + eax - 0x10]
je 0x51850c
mov ecx, dword [eax + 4]
mov dword [edx], ecx
mov dword [eax + 4], edx
xor ecx, ecx
mov word [esi + 0x3c], cx
mov dword [esi + 4], ecx
cmp word [esi + 0x3e], cx
je 0x518560
mov eax, dword [0x776138]
cmp eax, ecx
jge 0x518528
xor eax, eax
jmp 0x51852f
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
movzx ecx, word [esi + 0x3e]
cmp ecx, dword [eax + 0x120]
ja 0x518557
mov edx, dword [esi + 0xc]
mov eax, dword [eax + 0x11c]
shl ecx, 4
test edx, edx
lea eax, [ecx + eax - 0x10]
je 0x518557
mov ecx, dword [eax + 4]
mov dword [edx], ecx
mov dword [eax + 4], edx
xor ecx, ecx
mov word [esi + 0x3e], cx
mov dword [esi + 0xc], ecx
mov eax, dword [0x776138]
cmp eax, ecx
jl 0x5185a8
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
je 0x5185a8
push 0x40
push 0xfe
push esi
call sub.msvcrt.dll_memset
mov dword [esi], 0
mov eax, dword [edi + 0x14]
add esp, 0xc
test eax, eax
je 0x5185a2
mov dword [eax], esi
mov eax, dword [ebp - 0xc]
mov dword [edi + 0x14], esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x10], esi
mov dword [edi + 0x14], esi
mov eax, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret