Function at 0x52d8d0
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x57765b
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push edi
mov eax, dword [0x5d52e0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [esi]
mov ecx, dword [eax - 0xc]
test ecx, ecx
jle 0x52db05
push 0x40
push eax
call fcn.005003bb
add esp, 8
test eax, eax
je 0x52db05
sub eax, dword [esi]
sar eax, 1
jne 0x52db05
push 1
push 0
mov ecx, esi
call fcn.00406aa0
mov eax, dword [esi]
push 0x2d
push eax
call fcn.00500a5a
add esp, 8
test eax, eax
jne 0x52d942
or edi, 0xffffffff
jmp 0x52d948
sub eax, dword [esi]
sar eax, 1
mov edi, eax
mov eax, dword [esi]
mov eax, dword [eax - 0xc]
sub eax, edi
dec eax
push eax
lea ecx, [ebp - 0x18]
push ecx
mov ecx, esi
call fcn.00406d20
mov eax, dword [eax]
push eax
call fcn.00501fe3
mov ebx, eax
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
add esp, 4
mov dword [ebp - 0x1c], ebx
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x52d98b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test ebx, ebx
je 0x52db13
dec edi
push edi
lea ecx, [ebp - 0x14]
push ecx
mov ecx, esi
call fcn.00406da0
mov dword [ebp - 4], 0
call fcn.0040c84f
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x52d9c1
push 0x80004005
call fcn.004010a0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [ebp - 0x10], edi
mov byte [ebp - 4], 1
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, 0x104
or eax, ecx
jge 0x52d9f8
push 0x104
lea ecx, [ebp - 0x10]
call fcn.004019b0
mov edi, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
push 0x104
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov eax, dword [edi - 8]
push eax
push edi
call fcn.004ff818
add esp, 8
test eax, eax
js 0x52dafb
cmp eax, dword [edi - 8]
jg 0x52dafb
xor edx, edx
push 3
push edx
mov dword [edi - 0xc], eax
push edi
mov word [edi + eax*2], dx
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov ebx, eax
test ebx, ebx
je 0x52daa4
mov eax, dword [esi]
mov ecx, 1
sub ecx, dword [eax - 4]
mov eax, dword [eax - 8]
sub eax, 0x100
or eax, ecx
jge 0x52da61
push 0x100
mov ecx, esi
call fcn.004019b0
mov eax, dword [esi]
push 0x100
push eax
mov eax, dword [ebp - 0x1c]
push eax
push ebx
call dword [sym.imp.USER32.dll_LoadStringW]
mov eax, dword [esi]
mov ecx, dword [eax - 8]
test eax, eax
je 0x52da8b
push ecx
push eax
call fcn.004ff818
add esp, 8
test eax, eax
js 0x52dafb
mov ecx, dword [esi]
cmp eax, dword [ecx - 8]
jg 0x52dafb
mov dword [ecx - 0xc], eax
mov ecx, dword [esi]
xor edx, edx
push ebx
mov word [ecx + eax*2], dx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea eax, [edi - 0x10]
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x52dac4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x52db13
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.004010a0
push 5
push str.Error
mov ecx, esi
call fcn.00401900
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov esp, ebp
pop ebp
ret