Function at 0x50bb90
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x28
push ebx
push esi
mov esi, dword [esp + 0x38]
mov ebx, ecx
test esi, esi
jle 0x50bec9
mov eax, dword [ebx + 0x98]
mov ecx, dword [ebx + 0x94]
add eax, ecx
je 0x50bbd9
mov eax, dword [esp + 0x34]
mov ecx, ebx
mov dword [esp + 0xc], eax
lea eax, [esp + 8]
push eax
mov byte [esp + 0xc], 0x11
mov word [esp + 0x14], si
call fcn.00510450
pop esi
pop ebx
add esp, 0x28
ret 8
lea eax, [ecx + 1]
mov dword [esp + 0x1c], 0
push edi
mov dword [ebx + 0x94], eax
push dword [0x884adc]
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], connect
mov dword [esp + 0x34], esi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea ecx, [esi*4 + 0x7f]
and ecx, 0xffffff80
mov edx, dword [eax + 0xc]
lea edi, [edx + ecx]
cmp ecx, dword [eax + 8]
jg 0x50bc2a
cmp edi, dword [eax + 0x10]
ja 0x50bc2a
mov dword [eax + 0xc], edi
jmp 0x50bc34
push ecx
mov ecx, eax
call fcn.0046a3c0
mov edx, eax
mov ecx, esi
mov dword [esp + 0x20], edx
push ebp
or ecx, 0x80000000
mov dword [esp + 0x30], edx
xor ebp, ebp
mov dword [esp + 0x2c], ecx
test esi, esi
jle 0x50bc81
nop
mov eax, dword [esp + 0x3c]
mov edx, dword [esp + 0x24]
mov edi, dword [eax + ebp*4]
mov eax, dword [esp + 0x28]
push edi
push ebx
lea esi, [edi + 0x24]
mov dword [edx + eax*4], esi
inc dword [esp + 0x30]
call fcn.00527ea0
add esp, 8
mov ecx, edi
call fcn.0051eb40
inc ebp
cmp ebp, dword [esp + 0x40]
jl 0x50bc50
cmp dword [esp + 0x28], 0
je 0x50bd9a
mov esi, dword [ebx + 0x348]
mov ebp, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], connect
mov dword [esp + 0x20], esi
test esi, esi
je 0x50bce9
push dword [0x884adc]
call ebp
mov ecx, eax
lea edx, [esi*8 + 0x7f]
and edx, 0xffffff80
mov eax, dword [ecx + 0xc]
lea edi, [eax + edx]
cmp edx, dword [ecx + 8]
jg 0x50bce1
cmp edi, dword [ecx + 0x10]
ja 0x50bce1
mov dword [ecx + 0xc], edi
jmp 0x50bceb
push edx
call fcn.0046a3c0
jmp 0x50bceb
xor eax, eax
mov ecx, dword [ebx + 0x58]
lea edx, [esp + 0x10]
or esi, 0x80000000
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], eax
mov eax, dword [ecx]
push edx
lea edx, [esp + 0x28]
push edx
call dword [eax + 0x24]
push dword [esp + 0x14]
mov ecx, dword [ebx + 0x64]
push dword [esp + 0x14]
call fcn.006af340
mov edi, dword [esp + 0x1c]
xor ecx, ecx
mov eax, dword [esp + 0x14]
cmp edi, dword [esp + 0x10]
push dword [0x884adc]
cmove eax, ecx
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x24]
lea esi, [eax*8 + 0x7f]
and esi, 0xffffff80
call ebp
lea edx, [esi + 0xf]
and edx, 0xfffffff0
cmp esi, dword [eax + 8]
jg 0x50bd67
lea ecx, [edx + edi]
cmp ecx, dword [eax + 0xc]
jne 0x50bd67
cmp dword [eax + 0x14], edi
je 0x50bd67
mov dword [eax + 0xc], edi
jmp 0x50bd70
push edx
push edi
mov ecx, eax
call fcn.0046a590
mov eax, dword [esp + 0x18]
mov dword [esp + 0x14], 0
test eax, eax
js 0x50bd9a
and eax, 0x3fffffff
mov ecx, 0x7d8954
shl eax, 3
push eax
mov eax, dword [0x7d8954]
push dword [esp + 0x14]
call dword [eax + 0x10]
mov ebp, dword [esp + 0x40]
xor edi, edi
test ebp, ebp
jle 0x50be0d
mov eax, dword [esp + 0x3c]
mov esi, dword [eax + edi*4]
xor eax, eax
mov dword [esi + 8], 0
mov edx, dword [ebx + 0x120]
test edx, edx
jle 0x50bdd0
mov ecx, dword [ebx + 0x11c]
cmp dword [ecx], esi
je 0x50bdd3
inc eax
add ecx, 4
cmp eax, edx
jl 0x50bdc4
or eax, 0xffffffff
dec dword [ebx + 0x120]
mov edx, dword [ebx + 0x120]
cmp edx, eax
je 0x50bdf3
mov ecx, dword [ebx + 0x11c]
lea edx, [ecx + edx*4]
lea ecx, [ecx + eax*4]
mov eax, dword [edx]
mov dword [ecx], eax
cmp word [esi + 4], 0
jne 0x50be01
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x38]
mov ecx, esi
call fcn.0045c160
inc edi
cmp edi, ebp
jl 0x50bda4
add dword [ebx + 0x94], 0xffffffff
pop ebp
jne 0x50be49
cmp byte [ebx + 0x9c], 0
jne 0x50be49
cmp dword [ebx + 0x8c], 0
je 0x50be30
mov ecx, ebx
call fcn.00510540
cmp dword [ebx + 0xa4], 1
jne 0x50be49
cmp dword [ebx + 0x90], 0
je 0x50be49
mov ecx, ebx
call fcn.00510560
mov edi, dword [esp + 0x2c]
xor ecx, ecx
mov eax, dword [esp + 0x24]
cmp edi, dword [esp + 0x20]
push dword [0x884adc]
cmove eax, ecx
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x34]
lea esi, [eax*4 + 0x7f]
and esi, 0xffffff80
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea edx, [esi + 0xf]
and edx, 0xfffffff0
cmp esi, dword [eax + 8]
jg 0x50be95
lea ecx, [edx + edi]
cmp ecx, dword [eax + 0xc]
jne 0x50be95
cmp dword [eax + 0x14], edi
je 0x50be95
mov dword [eax + 0xc], edi
jmp 0x50be9e
push edx
push edi
mov ecx, eax
call fcn.0046a590
mov eax, dword [esp + 0x28]
mov dword [esp + 0x24], 0
pop edi
test eax, eax
js 0x50bec9
and eax, 0x3fffffff
mov ecx, 0x7d8954
shl eax, 2
push eax
mov eax, dword [0x7d8954]
push dword [esp + 0x20]
call dword [eax + 0x10]
pop esi
pop ebx
add esp, 0x28
ret 8