Function at 0x10053370
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push ebx
push esi
push edi
push dword [0x100c7608]
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x2c], ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
mov dword [ebp - 0x14], edi
test edi, edi
jne 0x100533a0
mov eax, 5
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
xor ecx, ecx
mov edx, dword [edi + 0x7130]
xor esi, esi
xor ebx, ebx
mov dword [ebp - 4], ecx
mov dword [ebp - 0x18], 1
movzx eax, word [eax*2 + 0x100b0540]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 8], edx
movzx eax, word [eax*2 + 0x100b0540]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 0x14]
movzx eax, word [eax*2 + 0x100b0540]
mov dword [ebp - 0x30], eax
mov eax, dword [edi + 0x7134]
mov dword [ebp - 0x10], eax
test eax, eax
jl 0x100538ad
jg 0x10053400
test edx, edx
je 0x100538ad
mov edi, edi
cmp dword [edi + 4], 0
jne 0x100538aa
cmp esi, 1
jae 0x1005343c
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 0x10053415
mov edx, dword [ebp - 8]
mov eax, ebx
dec esi
shr eax, 1
test bl, 1
mov ebx, eax
je 0x10053564
add edx, 0xffffffff
mov dword [ebp - 8], edx
adc dword [ebp - 0x10], 0xffffffff
cmp dword [edi + 0x34], 0
je 0x10053473
cmp dword [edi + 0x3c], 0
je 0x10053473
cmp dword [edi + 0x18370], 0
ja 0x10053473
xor eax, eax
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], eax
cmp esi, dword [ebp + 0xc]
jae 0x100534a4
lea eax, [edi + 0x1b430]
mov edi, edi
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 0x10053480
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 0x10053527
lea esp, [esp]
cmp eax, 0x63
je 0x1005389e
movzx ecx, byte [edx + 1]
sub eax, 0x10
sub esi, ecx
shr ebx, cl
mov dword [ebp - 0x24], eax
cmp esi, eax
jae 0x10053508
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 0x100534e1
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 0x100534c0
movzx ecx, byte [edx + 1]
mov al, byte [edx + 4]
sub esi, ecx
shr ebx, cl
mov ecx, dword [ebp - 4]
mov byte [ecx + edi + 0x8344], al
inc ecx
mov dword [ebp - 4], ecx
cmp ecx, 0x8000
jne 0x10053889
mov edx, edi
call fcn.10055240
xor ecx, ecx
mov dword [ebp - 0x18], 0
mov dword [ebp - 4], ecx
jmp 0x10053889
cmp esi, 7
jae 0x10053594
lea eax, [edi + 0x1b430]
nop
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 0x10053570
mov eax, ebx
sub esi, 7
and eax, 0x7f
shr ebx, 7
mov dword [ebp - 0x20], eax
cmp esi, dword [ebp + 0x14]
jae 0x100535d4
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 + 0x14]
jb 0x100535b0
mov ecx, dword [ebp + 8]
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 0x10053657
lea esp, [esp]
cmp eax, 0x63
je 0x1005389e
movzx ecx, byte [edx + 1]
sub eax, 0x10
sub esi, ecx
shr ebx, cl
mov dword [ebp - 0x24], eax
cmp esi, eax
jae 0x10053638
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 0x10053611
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 0x100535f0
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 + 0x10]
jae 0x100536a4
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 + 0x10]
jb 0x10053680
mov ecx, dword [ebp - 0x38]
mov eax, ebx
not eax
and eax, dword [ebp - 0x34]
lea edx, [ecx + eax*8]
movzx eax, byte [edx]
mov dword [ebp - 0x1c], edx
cmp eax, 0x10
jbe 0x10053727
lea esp, [esp]
cmp eax, 0x63
je 0x1005389e
movzx ecx, byte [edx + 1]
sub eax, 0x10
sub esi, ecx
shr ebx, cl
mov dword [ebp - 0x24], eax
cmp esi, eax
jae 0x10053708
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 0x100536e1
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 0x100536c0
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 0x10053788
cmp esi, 8
jae 0x10053777
lea eax, [edi + 0x1b430]
jmp 0x10053750
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 0x10053750
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
sbb dword [ebp - 0x10], 0
cmp dword [edi + 0x34], 0
je 0x100537ac
cmp dword [edi + 0x3c], 0
je 0x100537ac
cmp dword [edi + 0x18370], 0
ja 0x100537ac
xor eax, eax
mov dword [ebp - 8], eax
mov dword [ebp - 0x10], eax
mov ebx, dword [ebp - 4]
nop
mov edx, dword [ebp - 0xc]
and edx, 0x7fff
mov dword [ebp - 0xc], edx
mov eax, edx
cmp edx, ebx
ja 0x100537c4
mov eax, ebx
mov edi, 0x8000
sub edi, eax
cmp edi, ecx
jbe 0x100537d1
mov edi, ecx
sub ecx, edi
cmp dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], ecx
je 0x100537fd
cmp ebx, edx
ja 0x100537fd
mov eax, dword [ebp - 0x14]
push edi
add eax, 0x8344
add eax, ebx
push 0
push eax
call fcn.1007cff0
add esp, 0xc
add ebx, edi
add dword [ebp - 0xc], edi
jmp 0x10053855
mov ecx, dword [ebp - 0x14]
mov eax, ebx
sub eax, edx
cmp eax, edi
lea eax, [ecx + 0x8344]
jb 0x1005382a
add eax, edx
push edi
push eax
lea eax, [ecx + 0x8344]
add eax, ebx
push eax
call fcn.1007d410
add esp, 0xc
add ebx, edi
add dword [ebp - 0xc], edi
jmp 0x10053855
add eax, ebx
lea esi, [ecx + 0x8344]
mov dword [ebp - 0xc], eax
add esi, edx
mov ecx, eax
lea esp, [esp]
mov al, byte [esi]
lea ecx, [ecx + 1]
inc ebx
mov byte [ecx - 1], al
inc edx
lea esi, [esi + 1]
sub edi, 1
jne 0x10053840
mov dword [ebp - 0xc], edx
mov edi, dword [ebp - 0x14]
cmp ebx, 0x8000
jne 0x10053872
mov edx, edi
mov ecx, ebx
call fcn.10055240
mov dword [ebp - 0x18], 0
xor ebx, ebx
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
jne 0x100537b0
mov esi, dword [ebp - 0x20]
mov dword [ebp - 4], ebx
mov ebx, dword [ebp - 0x24]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x10]
test eax, eax
jl 0x100538ad
mov edx, dword [ebp - 8]
jle 0x100533f6
jmp 0x10053400
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 0x100538cc
mov eax, dword [edi + 0x7128]
or eax, dword [edi + 0x712c]
jne 0x10053394
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret