Function at 0x50a5c0
Capabilities:
Execute anti-debugging instructions
Get thread local storage value
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x4c
push ebx
push esi
mov esi, dword [esp + 0x5c]
mov ebx, ecx
test esi, esi
jle 0x50abe1
cmp dword [ebx + 0x94], 0
je 0x50a608
mov eax, dword [esp + 0x58]
mov dword [esp + 0x38], eax
mov al, byte [esp + 0x60]
mov byte [esp + 0x3e], al
lea eax, [esp + 0x34]
push eax
mov byte [esp + 0x38], 7
mov word [esp + 0x40], si
call fcn.00510450
pop esi
pop ebx
add esp, 0x4c
ret 0xc
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_TlsGetValue]
push edi
push dword [0x884c50]
call ebp
mov edi, eax
mov ecx, dword [edi + 4]
cmp ecx, dword [edi + 0xc]
jae 0x50a642
mov dword [ecx], str.LtAddEntities
mov dword [ecx + 0xc], str.Stinit
rdtsc
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x14]
mov dword [ecx + 4], eax
lea eax, [ecx + 0x10]
mov dword [edi + 4], eax
inc dword [ebx + 0x94]
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], connect
test esi, esi
jle 0x50a679
push 4
push esi
lea eax, [esp + 0x38]
push eax
push 0x7d8950
call fcn.00467b80
add esp, 0x10
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], connect
test esi, esi
jle 0x50a6aa
push 0x20
push esi
lea eax, [esp + 0x2c]
push eax
push 0x7d8950
call fcn.00467b80
add esp, 0x10
cmp byte [ebx + 0xcc], 0
mov edi, dword [esp + 0x68]
mov byte [esp + 0x13], 0
je 0x50a717
push dword [0x884adc]
call ebp
push 0x84
mov ecx, dword [eax + 0x2c]
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, 0x84
push ebx
mov word [eax + 4], cx
mov ecx, eax
call fcn.00535bf0
mov ebp, eax
mov cl, byte [ebp + 0x25]
and cl, 0xfd
or cl, 1
mov byte [ebp + 0x25], cl
cmp edi, 1
jne 0x50a709
mov al, byte [ebp + 0x26]
mov cx, word [ebx + 0x2c]
and al, 0xf5
or al, 5
mov word [ebp + 0x20], cx
mov byte [ebp + 0x26], al
jmp 0x50a748
mov ax, word [ebx + 0x38]
and byte [ebp + 0x26], 0xf0
mov word [ebp + 0x20], ax
jmp 0x50a748
mov eax, dword [ebx + 0x28]
mov ebp, dword [eax]
mov eax, dword [ebp + 0x54]
and eax, 0x3fffffff
mov ecx, dword [ebp + 0x50]
lea edx, [ebp + 0x4c]
add ecx, esi
cmp eax, ecx
jge 0x50a748
add eax, eax
cmp ecx, eax
push 4
cmovl ecx, eax
push ecx
push edx
push 0x7d8954
call fcn.00467b80
add esp, 0x10
mov eax, dword [ebx + 0x78]
movss xmm0, dword [eax + 0xc]
xor eax, eax
mulss xmm0, dword [0x719760]
mov dword [esp + 0x14], eax
movss dword [esp + 0x20], xmm0
test esi, esi
jle 0x50a8d0
nop dword [eax]
mov ecx, dword [esp + 0x60]
mov edi, dword [ecx + eax*4]
mov ecx, edi
inc dword [ebx + 0x110]
mov eax, dword [ebx + 0x110]
mov dword [edi + 0xd4], eax
call fcn.0045c0c0
cmp dword [edi + 0x18], 0
jne 0x50a7a0
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x14]
mov dword [edi + 0x18], eax
lea eax, [edi + 0xf0]
push eax
sub esp, 8
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.00650d40
xor eax, eax
add esp, 0xc
mov dword [edi + 0xea], eax
mov dword [edi + 8], ebx
movzx eax, byte [ebx + 0x317]
movzx ecx, byte [edi + 0xe9]
movzx edx, byte [ebx + 0x316]
movzx esi, byte [ebx + 0x315]
mov dword [esp + 0x1c], eax
and eax, 3
mov dword [esp + 0x18], ecx
and ecx, 3
cmp al, cl
jae 0x50a7fc
not esi
mov eax, dword [esp + 0x18]
shl esi, 0xe
cmp dword [esp + 0x1c], eax
jge 0x50a80b
not edx
movzx eax, word [edi + 0xea]
mov ecx, 0x3fff
and ax, cx
shl edx, 0xe
or ax, si
mov word [edi + 0xea], ax
movzx eax, word [edi + 0xec]
and ax, cx
or ax, dx
mov word [edi + 0xec], ax
cmp byte [edi + 0xe8], 5
push edi
jne 0x50a84a
mov ecx, dword [ebx + 0x20]
jmp 0x50a851
mov byte [esp + 0x17], 1
mov ecx, ebp
call fcn.00535dd0
mov eax, dword [edi + 0x10]
mov dword [esp + 0x1c], eax
mov dword [edi + 0x30], 1
mov dword [edi + 0x40], 0
test eax, eax
je 0x50a8b7
mov eax, dword [esp + 0x28]
mov edx, eax
movss xmm0, dword [esp + 0x20]
inc eax
mov dword [esp + 0x28], eax
mov ecx, dword [edi + 0x10]
shl edx, 5
add edx, dword [esp + 0x24]
push edx
mov eax, dword [ecx]
push ecx
movss dword [esp], xmm0
push dword [edi + 0x18]
call dword [eax + 0x1c]
mov eax, dword [esp + 0x34]
lea esi, [edi + 0x24]
mov edx, dword [esp + 0x30]
mov ecx, edi
push dword [esp + 0x1c]
push ebx
mov dword [edx + eax*4], esi
inc dword [esp + 0x3c]
call fcn.00507d80
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x64]
inc eax
mov dword [esp + 0x14], eax
cmp eax, esi
jl 0x50a770
mov edi, dword [esp + 0x68]
cmp byte [ebx + 0xcc], 0
je 0x50a92c
cmp byte [esp + 0x13], 0
je 0x50a923
mov eax, dword [ebp + 0x4c]
cmp edi, 1
lea edi, [ebx + 0x28]
mov eax, dword [eax]
mov al, byte [eax + 0xd4]
mov byte [ebp + 0x24], al
je 0x50a8f9
lea edi, [ebx + 0x34]
mov eax, dword [edi + 8]
and eax, 0x3fffffff
cmp dword [edi + 4], eax
jne 0x50a916
push 4
push edi
push 0x7d8954
call fcn.00467c00
add esp, 0xc
mov ecx, dword [edi + 4]
mov eax, dword [edi]
mov dword [eax + ecx*4], ebp
inc dword [edi + 4]
jmp 0x50a92c
mov eax, dword [ebp]
mov ecx, ebp
push 1
call dword [eax]
mov edi, dword [ebx + 0x348]
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], connect
mov dword [esp + 0x58], edi
test edi, edi
je 0x50a987
push dword [0x884adc]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, eax
lea edx, [edi*8 + 0x7f]
and edx, 0xffffff80
mov eax, dword [ecx + 0xc]
lea ebp, [eax + edx]
cmp edx, dword [ecx + 8]
jg 0x50a97f
cmp ebp, dword [ecx + 0x10]
ja 0x50a97f
mov dword [ecx + 0xc], ebp
jmp 0x50a989
push edx
call fcn.0046a3c0
jmp 0x50a989
xor eax, eax
push dword [0x884c50]
or edi, 0x80000000
mov dword [esp + 0x4c], eax
mov dword [esp + 0x54], edi
mov dword [esp + 0x58], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebp, eax
mov edi, dword [ebp + 4]
cmp edi, dword [ebp + 0xc]
jae 0x50a9ca
mov dword [edi], str.StBroadphase
rdtsc
mov dword [esp + 0x68], eax
mov ecx, dword [esp + 0x68]
lea eax, [edi + 0xc]
mov dword [edi + 4], ecx
mov dword [ebp + 4], eax
mov ecx, dword [ebx + 0x58]
lea edx, [esp + 0x48]
push edx
lea edx, [esp + 0x28]
push edx
mov eax, dword [ecx]
lea edx, [esp + 0x38]
push edx
call dword [eax + 0x1c]
push dword [0x884c50]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebp, eax
mov edi, dword [ebp + 4]
cmp edi, dword [ebp + 0xc]
jae 0x50aa10
mov dword [edi], str.StCreateAgents
rdtsc
mov dword [esp + 0x68], eax
mov ecx, dword [esp + 0x68]
lea eax, [edi + 0xc]
mov dword [edi + 4], ecx
mov dword [ebp + 4], eax
mov eax, dword [ebx + 0x7c]
test eax, eax
je 0x50aa1c
add eax, 8
jmp 0x50aa1e
xor eax, eax
mov ecx, dword [ebx + 0x64]
push eax
push dword [esp + 0x50]
push dword [esp + 0x50]
call fcn.006af2d0
push dword [0x884c50]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebp, eax
mov edi, dword [ebp + 4]
cmp edi, dword [ebp + 0xc]
jae 0x50aa5e
mov dword [edi], str.StAddedCb
rdtsc
mov dword [esp + 0x68], eax
mov ecx, dword [esp + 0x68]
lea eax, [edi + 0xc]
mov dword [edi + 4], ecx
mov dword [ebp + 4], eax
xor edi, edi
test esi, esi
jle 0x50aa84
mov ebp, dword [esp + 0x64]
mov eax, dword [esp + 0x60]
mov esi, dword [eax + edi*4]
push esi
push ebx
call fcn.00527b30
push esi
call fcn.00534bc0
inc edi
add esp, 0xc
cmp edi, ebp
jl 0x50aa68
add dword [ebx + 0x94], 0xffffffff
jne 0x50aabf
cmp byte [ebx + 0x9c], 0
jne 0x50aabf
cmp dword [ebx + 0x8c], 0
je 0x50aaa6
mov ecx, ebx
call fcn.00510540
cmp dword [ebx + 0xa4], 1
jne 0x50aabf
cmp dword [ebx + 0x90], 0
je 0x50aabf
mov ecx, ebx
call fcn.00510560
push dword [0x884c50]
mov ebx, dword [sym.imp.KERNEL32.dll_TlsGetValue]
call ebx
mov edi, eax
mov esi, dword [edi + 4]
cmp esi, dword [edi + 0xc]
jae 0x50aaf0
mov dword [esi], 0x77f784
rdtsc
mov dword [esp + 0x68], eax
mov ecx, dword [esp + 0x68]
lea eax, [esi + 0xc]
mov dword [esi + 4], ecx
mov dword [edi + 4], eax
mov edi, dword [esp + 0x54]
xor ecx, ecx
mov eax, dword [esp + 0x4c]
cmp edi, dword [esp + 0x48]
push dword [0x884adc]
cmove eax, ecx
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x5c]
lea esi, [eax*8 + 0x7f]
and esi, 0xffffff80
call ebx
lea edx, [esi + 0xf]
and edx, 0xfffffff0
cmp esi, dword [eax + 8]
jg 0x50ab38
lea ecx, [edx + edi]
cmp ecx, dword [eax + 0xc]
jne 0x50ab38
cmp dword [eax + 0x14], edi
je 0x50ab38
mov dword [eax + 0xc], edi
jmp 0x50ab41
push edx
push edi
mov ecx, eax
call fcn.0046a590
mov eax, dword [esp + 0x50]
mov dword [esp + 0x4c], 0
pop edi
pop ebp
test eax, eax
js 0x50ab6d
and eax, 0x3fffffff
mov ecx, 0x7d8954
shl eax, 3
push eax
mov eax, dword [0x7d8954]
push dword [esp + 0x44]
call dword [eax + 0x10]
mov eax, dword [esp + 0x24]
mov dword [esp + 0x40], 0
mov dword [esp + 0x48], connect
mov dword [esp + 0x20], 0
test eax, eax
js 0x50aba7
and eax, 0x3fffffff
mov ecx, 0x7d8950
shl eax, 5
push eax
mov eax, dword [0x7d8950]
push dword [esp + 0x20]
call dword [eax + 0x10]
mov eax, dword [esp + 0x30]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x24], connect
mov dword [esp + 0x2c], 0
test eax, eax
js 0x50abe1
and eax, 0x3fffffff
mov ecx, 0x7d8950
shl eax, 2
push eax
mov eax, dword [0x7d8950]
push dword [esp + 0x2c]
call dword [eax + 0x10]
pop esi
pop ebx
add esp, 0x4c
ret 0xc