Function at 0x479520
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4dfce4
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x520078]
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 + 8]
xorps xmm0, xmm0
mov esi, dword [ebp + 0xc]
movq qword [ebp - 0x34], xmm0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
push dword [ebp + 0x10]
lea edi, [ebp - 0x3c]
mov dword [ebp - 4], 0
push edi
lea edi, [ebp - 0x34]
mov dword [ebp - 0x3c], 0
push edi
push eax
call fcn.00479450
add esp, 0x10
test al, al
jne 0x4795af
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, edi
mov ebx, eax
call fcn.00416f60
jmp 0x479822
mov eax, dword [ebp - 0x3c]
cmp eax, 1
je 0x4795bc
cmp eax, 2
jne 0x4795c9
mov ebx, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x34]
sub ebx, ecx
test bl, 1
je 0x4795db
lea ecx, [ebp - 0x34]
mov ebx, 0xd
call fcn.00416f60
jmp 0x479822
xor eax, eax
mov dword [ebp - 0x14], 7
mov dword [ebp - 0x18], 0
mov word [ebp - 0x28], ax
mov eax, ebx
mov byte [ebp - 4], 1
shr eax, 1
jne 0x479605
xor edx, edx
mov dword [ebp - 0x18], eax
mov word [ebp + eax*2 - 0x28], dx
jmp 0x479613
push 0
push eax
lea ecx, [ebp - 0x28]
call fcn.00419bc0
mov ecx, dword [ebp - 0x34]
mov edi, dword [ebp - 0x18]
test edi, edi
je 0x479633
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
push ebx
cmovae eax, dword [ebp - 0x28]
push ecx
push eax
call fcn.004acc80
mov edi, dword [ebp - 0x18]
add esp, 0xc
xor eax, eax
lea ecx, [ebp - 0x28]
push 1
push eax
mov word [ebp - 0x38], ax
lea eax, [ebp - 0x38]
push eax
call fcn.00417190
cmp eax, 0xffffffff
je 0x479671
lea ecx, [ebp - 0x28]
cmp eax, edi
ja 0x479667
cmp dword [ebp - 0x14], 8
mov dword [ebp - 0x18], eax
cmovae ecx, dword [ebp - 0x28]
xor edx, edx
mov word [ecx + eax*2], dx
jmp 0x479671
push 0
sub eax, edi
push eax
call fcn.00419bc0
cmp dword [ebp - 0x3c], 2
jne 0x4797ab
xor edx, edx
mov eax, 7
xor ecx, ecx
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x44], edx
mov word [ebp - 0x54], cx
mov byte [ebp - 4], 2
cmp eax, 8
lea ecx, [ebp - 0x54]
push edx
cmovae ecx, dword [ebp - 0x54]
lea eax, [ebp - 0x28]
cmp dword [ebp - 0x14], 8
push ecx
cmovae eax, dword [ebp - 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ecx, dword [ebp - 0x44]
cmp eax, ecx
jbe 0x4796cc
sub eax, ecx
lea ecx, [ebp - 0x54]
push 0
push eax
call fcn.00419bc0
mov eax, dword [ebp - 0x40]
mov edx, dword [ebp - 0x44]
jmp 0x479692
test eax, eax
jne 0x479737
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov eax, dword [ebp - 0x40]
cmp eax, 8
jb 0x4796ed
inc eax
lea ecx, [ebp - 0x54]
push eax
push dword [ebp - 0x54]
call fcn.004155f0
xor eax, eax
mov dword [ebp - 0x40], 7
mov word [ebp - 0x54], ax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x44], 0
cmp eax, 8
jb 0x479716
inc eax
lea ecx, [ebp - 0x28]
push eax
push dword [ebp - 0x28]
call fcn.004155f0
xor eax, eax
mov dword [ebp - 0x14], 7
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x18], 0
mov word [ebp - 0x28], ax
call fcn.00416f60
jmp 0x479822
lea edx, [eax - 1]
cmp edx, ecx
ja 0x479754
cmp dword [ebp - 0x40], 8
lea eax, [ebp - 0x54]
mov dword [ebp - 0x44], edx
cmovae eax, dword [ebp - 0x54]
xor ecx, ecx
mov word [eax + edx*2], cx
jmp 0x479761
sub edx, ecx
lea ecx, [ebp - 0x54]
push 0
push edx
call fcn.00419bc0
mov eax, dword [ebp - 0x14]
cmp eax, 8
jb 0x479776
inc eax
lea ecx, [ebp - 0x28]
push eax
push dword [ebp - 0x28]
call fcn.004155f0
xor eax, eax
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
lea ecx, [ebp - 0x28]
lea eax, [ebp - 0x54]
mov dword [ebp - 0x18], 0
push eax
call fcn.00414f20
mov eax, dword [ebp - 0x40]
cmp eax, 8
jb 0x4797ab
inc eax
lea ecx, [ebp - 0x54]
push eax
push dword [ebp - 0x54]
call fcn.004155f0
lea eax, [ebp - 0x28]
cmp esi, eax
je 0x4797ef
mov eax, dword [esi + 0x14]
cmp eax, 8
jb 0x4797c5
inc eax
mov ecx, esi
push eax
push dword [esi]
call fcn.004155f0
mov dword [esi + 0x14], 7
cmp dword [esi + 0x14], 8
mov dword [esi + 0x10], 0
jb 0x4797dd
mov eax, dword [esi]
jmp 0x4797df
mov eax, esi
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x28]
push eax
mov ecx, esi
call fcn.00414f20
mov eax, dword [ebp - 0x14]
cmp eax, 8
jb 0x479804
inc eax
lea ecx, [ebp - 0x28]
push eax
push dword [ebp - 0x28]
call fcn.004155f0
xor eax, eax
mov dword [ebp - 0x14], 7
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x18], 0
mov word [ebp - 0x28], ax
call fcn.00416f60
xor ebx, ebx
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
test ebx, ebx
sete al
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.0049384c
mov esp, ebp
pop ebp
ret