Function at 0x51ed80
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x575c9c
mov eax, dword fs:[0]
push eax
sub esp, 0x268
mov eax, dword [0x5d6b80]
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 eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x26c], ebx
mov dword [ebp - 0x268], eax
call fcn.0045adc0
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x51eddc
push 0x80004005
call fcn.0045a8f0
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x264], esi
push 0x208
mov dword [ebp - 4], 0
call fcn.005243ff
add esp, 4
mov edi, eax
push 0x104
push edi
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x51ee43
test edi, edi
jne 0x51ee1c
xor ecx, ecx
jmp 0x51ee30
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x51ee21
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [ebp - 0x264]
call fcn.0045b6e0
mov esi, dword [ebp - 0x264]
push edi
call fcn.00525873
add esp, 4
or ebx, 0xffffffff
cmp dword [esi - 0xc], 0
je 0x51ee7d
push 0x208
call fcn.005243ff
push 0x104
mov edi, eax
push esi
push edi
call fcn.0052cd2f
add esp, 0x10
test eax, eax
jne 0x51eebb
push edi
call fcn.00525873
add esp, 4
xor edi, edi
add esi, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea eax, [esi + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x51ee9d
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.00525878
mov esp, ebp
pop ebp
ret
test edi, edi
jne 0x51eec3
xor ecx, ecx
jmp 0x51eedf
mov ecx, edi
lea edx, [ecx + 2]
jmp 0x51eed0
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x51eed0
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [ebp - 0x264]
call fcn.0045b6e0
push edi
call fcn.00525873
push 0x24c
lea eax, [ebp - 0x25c]
mov dword [ebp - 0x260], 0
push 0
push eax
call fcn.00525ee0
mov esi, dword [ebp - 0x264]
lea eax, [ebp - 0x260]
add esp, 0x10
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x51ef48
mov edi, dword [ebp - 0x268]
test edi, edi
je 0x51ee7d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi], eax
jmp 0x51ee7d
lea eax, [ebp - 0x264]
push eax
lea eax, [ebp - 0x270]
push eax
call fcn.0051f060
push 0x57e140
push eax
lea eax, [ebp - 0x274]
mov byte [ebp - 4], 1
push eax
call fcn.00480bb0
lea ecx, [ebp - 0x234]
mov byte [ebp - 4], 2
push ecx
push eax
lea eax, [ebp - 0x268]
push eax
call fcn.00480bb0
add esp, 0x20
mov ecx, dword [ebp - 0x26c]
push eax
mov byte [ebp - 4], 3
call fcn.0045a580
mov edx, dword [ebp - 0x268]
mov ecx, ebx
add edx, 0xfffffff0
mov byte [ebp - 4], 2
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x51efbf
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x274]
mov ecx, ebx
add edx, 0xfffffff0
mov byte [ebp - 4], 1
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x51efe2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x270]
mov ecx, ebx
add edx, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x51f005
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push edi
call dword [sym.imp.KERNEL32.dll_FindClose]
push 0x208
call fcn.005243ff
add esp, 4
mov edi, eax
mov eax, dword [ebp - 0x26c]
push 0x104
push edi
push dword [eax]
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x51f03f
mov ecx, dword [ebp - 0x26c]
push edi
call fcn.0045a5f0
push edi
call fcn.00525873
add esp, 4
mov edi, 1
jmp 0x51ee7f