Function at 0x10053e50
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
push esi
push edi
push dword [0x100c7608]
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x34], ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
mov dword [ebp - 0x14], edi
test edi, edi
jne 0x10053e80
mov eax, 5
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
xor esi, esi
mov edx, dword [edi + 0x7134]
xor ebx, ebx
mov ecx, dword [edi + 0x7130]
mov dword [ebp - 4], 0
movzx eax, word [eax*2 + 0x100b0540]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x18], 1
mov dword [ebp - 8], ecx
mov dword [ebp - 0x10], edx
movzx eax, word [eax*2 + 0x100b0540]
mov dword [ebp - 0x28], eax
test edx, edx
jl 0x100542f7
jg 0x10053ed2
test ecx, ecx
je 0x100542f7
cmp dword [edi + 4], 0
jne 0x100542f7
cmp esi, 1
jae 0x10053f11
lea eax, [edi + 0x1b430]
mov edx, edi
mov ecx, eax
call fcn.1004f8d0
movzx eax, word [edi + 0x1b430]
mov ecx, esi
shl eax, cl
add esi, 8
or ebx, eax
lea eax, [edi + 0x1b430]
cmp esi, 1
jb 0x10053ee7
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x10]
mov eax, ebx
dec esi
shr eax, 1
test bl, 1
mov ebx, eax
je 0x10053fb0
add ecx, 0xffffffff
mov dword [ebp - 8], ecx
adc edx, 0xffffffff
cmp dword [edi + 0x34], 0
mov dword [ebp - 0x10], edx
je 0x10053f4a
cmp dword [edi + 0x3c], 0
je 0x10053f4a
cmp dword [edi + 0x18370], 0
ja 0x10053f4a
xor eax, eax
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], eax
cmp esi, 8
jae 0x10053f79
lea eax, [edi + 0x1b430]
mov edx, edi
mov ecx, eax
call fcn.1004f8d0
movzx eax, word [edi + 0x1b430]
mov ecx, esi
shl eax, cl
add esi, 8
or ebx, eax
lea eax, [edi + 0x1b430]
cmp esi, 8
jb 0x10053f55
mov eax, dword [ebp - 4]
mov byte [eax + edi + 0x8344], bl
inc eax
mov dword [ebp - 4], eax
cmp eax, 0x8000
jne 0x10053fa5
mov edx, edi
mov ecx, eax
call fcn.10055240
mov dword [ebp - 0x18], 0
mov dword [ebp - 4], 0
shr ebx, 8
sub esi, 8
jmp 0x100542d6
cmp esi, 7
jae 0x10053fe4
lea eax, [edi + 0x1b430]
jmp 0x10053fc0
mov edx, edi
mov ecx, eax
call fcn.1004f8d0
movzx eax, word [edi + 0x1b430]
mov ecx, esi
shl eax, cl
add esi, 8
or ebx, eax
lea eax, [edi + 0x1b430]
cmp esi, 7
jb 0x10053fc0
mov eax, ebx
sub esi, 7
and eax, 0x7f
shr ebx, 7
mov dword [ebp - 0x20], eax
cmp esi, dword [ebp + 0xc]
jae 0x10054024
lea eax, [edi + 0x1b430]
lea ecx, [ecx]
mov edx, edi
mov ecx, eax
call fcn.1004f8d0
movzx eax, word [edi + 0x1b430]
mov ecx, esi
shl eax, cl
add esi, 8
or ebx, eax
lea eax, [edi + 0x1b430]
cmp esi, dword [ebp + 0xc]
jb 0x10054000
mov ecx, dword [ebp - 0x2c]
mov eax, ebx
not eax
and eax, dword [ebp - 0x28]
lea edx, [ecx + eax*8]
movzx eax, byte [edx]
mov dword [ebp - 0x1c], edx
cmp eax, 0x10
jbe 0x100540a7
lea esp, [esp]
cmp eax, 0x63
je 0x100542eb
movzx ecx, byte [edx + 1]
sub eax, 0x10
sub esi, ecx
shr ebx, cl
mov dword [ebp - 0x24], eax
cmp esi, eax
jae 0x10054088
lea ecx, [edi + 0x1b430]
mov edx, edi
call fcn.1004f8d0
movzx eax, word [edi + 0x1b430]
mov ecx, esi
shl eax, cl
add esi, 8
or ebx, eax
lea ecx, [edi + 0x1b430]
mov eax, dword [ebp - 0x24]
cmp esi, eax
jb 0x10054061
mov edx, dword [ebp - 0x1c]
movzx ecx, word [eax*2 + 0x100b0540]
mov eax, ebx
not eax
and ecx, eax
mov eax, dword [edx + 4]
lea edx, [eax + ecx*8]
movzx eax, byte [edx]
mov dword [ebp - 0x1c], edx
cmp eax, 0x10
ja 0x10054040
movzx ecx, byte [edx + 1]
movzx eax, word [edx + 4]
sub esi, ecx
shr ebx, cl
mov ecx, dword [ebp - 4]
sub ecx, eax
sub ecx, dword [ebp - 0x20]
mov dword [ebp - 0xc], ecx
cmp esi, dword [ebp + 8]
jae 0x100540f4
lea eax, [edi + 0x1b430]
lea esp, [esp]
mov edx, edi
mov ecx, eax
call fcn.1004f8d0
movzx eax, word [edi + 0x1b430]
mov ecx, esi
shl eax, cl
add esi, 8
or ebx, eax
lea eax, [edi + 0x1b430]
cmp esi, dword [ebp + 8]
jb 0x100540d0
mov ecx, dword [ebp - 0x34]
mov eax, ebx
not eax
and eax, dword [ebp - 0x30]
lea edx, [ecx + eax*8]
movzx eax, byte [edx]
mov dword [ebp - 0x1c], edx
cmp eax, 0x10
jbe 0x10054177
lea esp, [esp]
cmp eax, 0x63
je 0x100542eb
movzx ecx, byte [edx + 1]
sub eax, 0x10
sub esi, ecx
shr ebx, cl
mov dword [ebp - 0x24], eax
cmp esi, eax
jae 0x10054158
lea ecx, [edi + 0x1b430]
mov edx, edi
call fcn.1004f8d0
movzx eax, word [edi + 0x1b430]
mov ecx, esi
shl eax, cl
add esi, 8
or ebx, eax
lea ecx, [edi + 0x1b430]
mov eax, dword [ebp - 0x24]
cmp esi, eax
jb 0x10054131
mov edx, dword [ebp - 0x1c]
movzx ecx, word [eax*2 + 0x100b0540]
mov eax, ebx
not eax
and ecx, eax
mov eax, dword [edx + 4]
lea edx, [eax + ecx*8]
movzx eax, byte [edx]
mov dword [ebp - 0x1c], edx
cmp eax, 0x10
ja 0x10054110
movzx ecx, byte [edx + 1]
shr ebx, cl
sub esi, ecx
movzx ecx, word [edx + 4]
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x1c], ecx
test eax, eax
je 0x100541d8
cmp esi, 8
jae 0x100541c7
lea eax, [edi + 0x1b430]
jmp 0x100541a0
mov edx, edi
mov ecx, eax
call fcn.1004f8d0
movzx eax, word [edi + 0x1b430]
mov ecx, esi
shl eax, cl
add esi, 8
or ebx, eax
lea eax, [edi + 0x1b430]
cmp esi, 8
jb 0x100541a0
mov ecx, dword [ebp - 0x1c]
movzx eax, bl
shr ebx, 8
add ecx, eax
sub esi, 8
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x20], esi
sub dword [ebp - 8], ecx
mov eax, dword [ebp - 0x10]
sbb eax, 0
cmp dword [edi + 0x34], 0
mov dword [ebp - 0x10], eax
je 0x10054201
cmp dword [edi + 0x3c], 0
je 0x10054201
cmp dword [edi + 0x18370], 0
ja 0x10054201
xor eax, eax
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], eax
mov esi, dword [ebp - 4]
mov edx, dword [ebp - 0xc]
and edx, 0x7fff
mov dword [ebp - 0xc], edx
mov eax, edx
cmp edx, esi
ja 0x10054218
mov eax, esi
mov edi, 0x8000
sub edi, eax
cmp edi, ecx
jbe 0x10054225
mov edi, ecx
sub ecx, edi
cmp dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], ecx
je 0x10054251
cmp esi, edx
ja 0x10054251
mov eax, dword [ebp - 0x14]
push edi
add eax, 0x8344
add eax, esi
push 0
push eax
call fcn.1007cff0
add esp, 0xc
add esi, edi
add dword [ebp - 0xc], edi
jmp 0x100542a5
mov ecx, dword [ebp - 0x14]
mov eax, esi
sub eax, edx
cmp eax, edi
lea eax, [ecx + 0x8344]
jb 0x1005427e
add eax, edx
push edi
push eax
lea eax, [ecx + 0x8344]
add eax, esi
push eax
call fcn.1007d410
add esp, 0xc
add esi, edi
add dword [ebp - 0xc], edi
jmp 0x100542a5
add eax, esi
lea ebx, [ecx + 0x8344]
mov dword [ebp - 0xc], eax
add ebx, edx
mov ecx, eax
lea ecx, [ecx]
mov al, byte [ebx]
lea ecx, [ecx + 1]
inc esi
mov byte [ecx - 1], al
inc edx
lea ebx, [ebx + 1]
sub edi, 1
jne 0x10054290
mov dword [ebp - 0xc], edx
mov edi, dword [ebp - 0x14]
cmp esi, 0x8000
jne 0x100542c2
mov edx, edi
mov ecx, esi
call fcn.10055240
mov dword [ebp - 0x18], 0
xor esi, esi
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
jne 0x10054204
mov ebx, dword [ebp - 0x24]
mov dword [ebp - 4], esi
mov esi, dword [ebp - 0x20]
mov edx, dword [ebp - 0x10]
test edx, edx
jl 0x100542f7
mov ecx, dword [ebp - 8]
jle 0x10053eca
jmp 0x10053ed2
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov edx, edi
call fcn.10055240
cmp dword [edi + 0x34], 0
jne 0x10054319
mov eax, dword [edi + 0x7128]
or eax, dword [edi + 0x712c]
jne 0x10053e74
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret