Function at 0x487700
Capabilities:
Query environment variable

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4e6a65
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x40
mov eax, dword [0x51c100]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, edx
mov dword [ebp - 0x4c], eax
mov esi, ecx
mov ecx, dword [ebx + 8]
mov dword [ebp - 0x50], ecx
cmp eax, 1
je 0x487755
cmp eax, 2
jne 0x48775e
mov eax, dword [esi + 4]
sub eax, dword [esi]
test al, 1
je 0x487768
mov eax, 0xd
jmp 0x487958
xorps xmm0, xmm0
mov dword [ebp - 0x1c], 0
xor ecx, ecx
mov dword [ebp - 0x18], 7
movups xmmword [ebp - 0x2c], xmm0
mov word [ebp - 0x2c], cx
shr eax, 1
mov dword [ebp - 4], ecx
jne 0x487794
mov dword [ebp - 0x1c], eax
mov word [ebp + eax*2 - 0x2c], cx
jmp 0x48779f
push 0
push eax
lea ecx, [ebp - 0x2c]
call fcn.0040c260
mov edi, dword [ebp - 0x1c]
test edi, edi
je 0x4877c6
mov edx, dword [esi]
lea eax, [ebp - 0x2c]
mov ecx, dword [esi + 4]
sub ecx, edx
cmp dword [ebp - 0x18], 8
push ecx
cmovae eax, dword [ebp - 0x2c]
push edx
push eax
call fcn.004a3000
mov edi, dword [ebp - 0x1c]
add esp, 0xc
cmp dword [ebp - 0x18], 8
lea eax, [ebp - 0x2c]
cmovae eax, dword [ebp - 0x2c]
mov dword [ebp - 0x48], eax
test edi, edi
je 0x48783b
mov ecx, edi
xor edx, edx
mov esi, eax
test ecx, ecx
je 0x487807
movzx eax, word [eax]
test ax, ax
je 0x487802
nop word [eax + eax]
cmp ecx, 1
je 0x487804
movzx eax, word [esi + 2]
add esi, 2
dec ecx
test ax, ax
jne 0x4877f0
mov edx, esi
mov eax, dword [ebp - 0x48]
test edx, edx
je 0x48783b
sub edx, eax
sar edx, 1
cmp edx, 0xffffffff
je 0x48783b
cmp edx, edi
ja 0x48782e
cmp dword [ebp - 0x18], 8
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x1c], edx
cmovae eax, dword [ebp - 0x2c]
xor ecx, ecx
mov word [eax + edx*2], cx
jmp 0x48783b
push 0
sub edx, edi
lea ecx, [ebp - 0x2c]
push edx
call fcn.0040c260
cmp dword [ebp - 0x4c], 2
jne 0x487916
xor edx, edx
xorps xmm0, xmm0
mov eax, 7
mov dword [ebp - 0x34], edx
xor ecx, ecx
mov dword [ebp - 0x30], eax
movups xmmword [ebp - 0x44], xmm0
mov word [ebp - 0x44], cx
mov byte [ebp - 4], 1
cmp eax, 8
lea ecx, [ebp - 0x44]
push edx
cmovae ecx, dword [ebp - 0x44]
lea eax, [ebp - 0x2c]
cmp dword [ebp - 0x18], 8
push ecx
cmovae eax, dword [ebp - 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ecx, dword [ebp - 0x34]
cmp eax, ecx
jbe 0x48789d
sub eax, ecx
lea ecx, [ebp - 0x44]
push 0
push eax
call fcn.0040c260
mov eax, dword [ebp - 0x30]
mov edx, dword [ebp - 0x34]
jmp 0x487863
test eax, eax
jne 0x4878b6
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [ebp - 0x44]
mov esi, eax
call fcn.0040a590
jmp 0x48794e
lea edx, [eax - 1]
cmp edx, ecx
ja 0x4878d3
cmp dword [ebp - 0x30], 8
lea eax, [ebp - 0x44]
mov dword [ebp - 0x34], edx
cmovae eax, dword [ebp - 0x44]
xor ecx, ecx
mov word [eax + edx*2], cx
jmp 0x4878e0
sub edx, ecx
lea ecx, [ebp - 0x44]
push 0
push edx
call fcn.0040c260
lea ecx, [ebp - 0x2c]
call fcn.0040a590
movups xmm0, xmmword [ebp - 0x44]
xor eax, eax
lea ecx, [ebp - 0x44]
mov word [ebp - 0x44], ax
movups xmmword [ebp - 0x2c], xmm0
movq xmm0, qword [ebp - 0x34]
movq qword [ebp - 0x1c], xmm0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 7
call fcn.0040a590
mov esi, dword [ebp - 0x50]
lea eax, [ebp - 0x2c]
cmp esi, eax
je 0x48794c
mov ecx, esi
call fcn.0040a590
movups xmm0, xmmword [ebp - 0x2c]
xor eax, eax
mov word [ebp - 0x2c], ax
movups xmmword [esi], xmm0
movq xmm0, qword [ebp - 0x1c]
movq qword [esi + 0x10], xmm0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 7
xor esi, esi
lea ecx, [ebp - 0x2c]
call fcn.0040a590
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004a057b
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret