Function at 0x50b870
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5a6beb
mov eax, dword fs:[0]
push eax
sub esp, 0x42c
mov eax, dword [0x60f520]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, edx
mov eax, dword [ebp + 8]
mov ecx, dword [ecx]
mov dword [ebp - 0x430], eax
sub ecx, 0x10
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x438], eax
call fcn.0040c3c0
lea esi, [eax + 0x10]
mov dword [ebp - 0x42c], esi
mov dword [ebp - 4], 0
mov edi, dword [esi - 0xc]
test edi, edi
jns 0x50b8dd
push 0x80070057
call fcn.0040c390
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x50b900
push edi
lea ecx, [ebp - 0x42c]
call fcn.0040c110
mov esi, dword [ebp - 0x42c]
lea eax, [edi + 1]
push eax
push esi
call fcn.005527a0
add esp, 8
cmp edi, dword [esi - 8]
jg 0x50b8d3
xor eax, eax
mov dword [esi - 0xc], edi
mov word [esi + edi*2], ax
cmp dword [esi - 0xc], eax
jl 0x50bac7
push 0x5b5504
push esi
call fcn.00552a08
add esp, 8
test eax, eax
je 0x50bac7
sub eax, esi
sar eax, 1
cmp eax, 0xffffffff
je 0x50bac7
lea eax, [ebp - 0x424]
mov dword [ebp - 0x424], 0
push eax
push 0x5abb98
push 1
push 0
push 0x5abc98
call dword [sym.imp.ole32.dll_CoCreateInstance]
test eax, eax
js 0x50bac0
mov ecx, dword [ebp - 0x424]
test ecx, ecx
je 0x50bac0
lea edx, [ebp - 0x428]
mov dword [ebp - 0x428], 0
mov eax, dword [ecx]
push edx
push 0x5abcb8
push ecx
call dword [eax]
test eax, eax
js 0x50bab4
mov ecx, dword [ebp - 0x428]
test ecx, ecx
je 0x50bab4
mov eax, dword [ecx]
push 0
push esi
push ecx
call dword [eax + 0x14]
test eax, eax
js 0x50baa8
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x216]
push eax
call fcn.00559380
mov eax, dword [ebp - 0x424]
lea ecx, [ebp - 0x218]
add esp, 0xc
mov edx, dword [eax]
push 2
push 0
push 0x104
push ecx
push eax
call dword [edx + 0xc]
lea eax, [ebp - 0x218]
mov ecx, ebx
push eax
call fcn.0040c280
mov eax, dword [ebp - 0x424]
lea ecx, [ebp - 0x218]
push 0x104
push ecx
push eax
mov edx, dword [eax]
call dword [edx + 0x28]
mov ecx, dword [ebp - 0x430]
lea eax, [ebp - 0x218]
push eax
call fcn.0040c280
mov eax, dword [ebp - 0x424]
lea edx, [ebp - 0x434]
push edx
push 0x104
mov dword [ebp - 0x434], 0
lea edx, [ebp - 0x218]
mov ecx, dword [eax]
push edx
push eax
call dword [ecx + 0x40]
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x420], ax
lea eax, [ebp - 0x41e]
push eax
call fcn.00559380
add esp, 0xc
lea eax, [ebp - 0x420]
push 0x104
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ecx, dword [ebp - 0x438]
lea eax, [ebp - 0x420]
push eax
call fcn.0040c280
mov eax, dword [ebp - 0x428]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov eax, dword [ebp - 0x424]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov edi, 1
jmp 0x50bac9
xor edi, edi
add esi, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x50baea
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0055199a
mov esp, ebp
pop ebp
ret