Function at 0x4a9179
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x4c
cmp dword [0x4def0c], 0
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
push esi
push edi
jne 0x4a9310
or ecx, 0xffffffff
mov edi, 0x4def08
xor eax, eax
lock cmpxchg dword [edi], ecx
test eax, eax
je 0x4a91c1
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x14
call esi
or ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edi], ecx
test eax, eax
jne 0x4a91b0
cmp dword [0x4def0c], 0
jne 0x4a9306
push 0xc00
push 8
push dword [0x4e05c4]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
mov dword [esp + 0x14], eax
test esi, esi
je 0x4a9218
mov edx, 0x100
lea ecx, [esi + 8]
lea ebx, [ebx]
mov dword [ecx - 8], 0
lea ecx, [ecx + 0xc]
mov dword [ecx - 0x10], 0
mov dword [ecx - 0xc], 0
sub edx, 1
jne 0x4a91f9
jmp 0x4a921e
xor esi, esi
mov dword [esp + 0x14], esi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov edi, eax
mov dword [esp + 0x18], edi
test edi, edi
je 0x4a92fd
xor eax, eax
mov dword [esp + 0xc], eax
cmp word [edi], ax
je 0x4a92ee
mov dword [esp + 0x10], esi
lea esp, [esp]
push edi
call ebx
xor ecx, ecx
test eax, eax
je 0x4a92c4
lea esp, [esp]
cmp word [edi + ecx*2], 0x3d
lea ebx, [edi + ecx*2]
je 0x4a927b
inc ecx
cmp ecx, eax
jb 0x4a9259
inc dword [esp + 0xc]
add esi, 0xc
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [esp + 0x10], esi
jmp 0x4a92d7
test ecx, ecx
je 0x4a92d1
cmp ecx, 0xffffffff
je 0x4a92be
push ecx
push edi
call dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push esi
lea ecx, [esp + 0x24]
call fcn.004ba98a
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
mov dword [esi], eax
lea eax, [ebx + 2]
push eax
mov dword [esi + 4], ecx
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov dword [esi + 8], eax
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
inc dword [esp + 0xc]
add esi, 0xc
mov dword [esp + 0x10], esi
jmp 0x4a92d7
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
push edi
call ebx
lea edi, [edi + eax*2]
add edi, 2
cmp word [edi], 0
jne 0x4a9249
mov eax, dword [esp + 0xc]
push dword [esp + 0x18]
mov dword [0x4def04], eax
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, dword [esp + 0x14]
mov dword [0x4def0c], eax
mov dword [0x4def08], 0
mov eax, dword [ebp + 8]
xor ecx, ecx
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], ecx
movzx edx, word [eax]
mov dword [esp + 0x50], ecx
cmp edx, 9
je 0x4a9339
mov esi, 0x4009
mov ecx, edx
cmp dx, si
jne 0x4a939b
mov ecx, dword [eax + 8]
test edx, 0x4000
je 0x4a9346
mov ecx, dword [ecx]
test ecx, ecx
je 0x4a95a2
push 0
push 0
lea edx, [esp + 0x4c]
xor eax, eax
push edx
lea edx, [esp + 0x30]
mov word [esp + 0x50], ax
push edx
push 3
push 0
push 0x556a40
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov eax, dword [ecx]
push 0
push ecx
call dword [eax + 0x18]
mov esi, eax
mov dword [esp + 0x54], esi
test esi, esi
js 0x4a95ab
movzx ecx, word [esp + 0x44]
lea eax, [esp + 0x44]
mov edx, 0x4008
cmp cx, dx
jne 0x4a93ba
mov ecx, 8
mov word [esp + 0x34], cx
mov eax, dword [eax + 8]
mov esi, dword [eax]
mov dword [esp + 0x3c], esi
jmp 0x4a942d
cmp cx, 8
jne 0x4a93d3
mov ecx, 8
mov word [esp + 0x34], cx
mov esi, dword [eax + 8]
mov dword [esp + 0x3c], esi
jmp 0x4a942d
cmp cx, 1
jne 0x4a93e3
mov esi, 0x800a005e
jmp 0x4a95a7
xor ecx, ecx
mov word [esp + 0x34], cx
mov ecx, 0x400c
cmp word [eax], cx
jne 0x4a9401
jmp 0x4a93f9
mov eax, dword [eax + 8]
cmp word [eax], cx
je 0x4a93f9
push 3
push 2
push 0x400
push eax
lea eax, [esp + 0x44]
push eax
call dword [sym.imp.OLEAUT32.dll_SafeArrayPtrOfIndex]
mov esi, eax
mov dword [esp + 0x54], esi
test esi, esi
js 0x4a95ab
mov esi, dword [esp + 0x3c]
mov cx, word [esp + 0x34]
mov dword [esp + 0x54], 0
cmp cx, 8
jne 0x4a94f9
test esi, esi
je 0x4a959b
cmp word [esi], 0
je 0x4a959b
push esi
call ebx
push eax
push esi
lea ecx, [esp + 0x24]
call fcn.004ba98a
mov edx, dword [0x4def04]
xor edi, edi
test edx, edx
jle 0x4a94e0
mov esi, dword [0x4def0c]
mov ebx, dword [esp + 0x20]
lea esp, [esp]
test esi, esi
jne 0x4a94a0
test ebx, 0x1fff
jne 0x4a94d8
test esi, esi
je 0x4a94e0
push dword [esi + 8]
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov ecx, eax
xor esi, esi
mov eax, dword [ebp + 0xc]
mov dword [eax], ecx
jmp 0x4a95ab
mov ecx, dword [esi + 4]
mov eax, ecx
xor eax, ebx
test eax, 0xffffe000
jne 0x4a94d8
mov eax, ebx
and ecx, 0x1fff
and eax, 0x1fff
cmp eax, ecx
jne 0x4a94d8
push ecx
push dword [esi]
push dword [esp + 0x24]
call fcn.004ba935
add esp, 0xc
test eax, eax
je 0x4a9485
mov edx, dword [0x4def04]
inc edi
add esi, 0xc
cmp edi, edx
jl 0x4a9479
push 0x55c75e
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov ecx, eax
xor esi, esi
mov eax, dword [ebp + 0xc]
mov dword [eax], ecx
jmp 0x4a95ab
lea eax, [esi - 1]
cmp eax, 0xfe
ja 0x4a959b
dec esi
cmp esi, dword [0x4def04]
jge 0x4a9587
mov eax, dword [0x4def0c]
lea ecx, [esi + esi*2]
lea ebx, [eax + ecx*4]
test ebx, ebx
je 0x4a9587
mov esi, dword [ebx + 4]
mov eax, dword [ebx + 8]
and esi, 0x1fff
test eax, eax
je 0x4a9539
mov eax, dword [eax - 4]
cdq
sub eax, edx
sar eax, 1
jmp 0x4a953b
xor eax, eax
mov dword [esp + 0x14], eax
inc eax
add eax, esi
push eax
push 0
call dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
mov edi, dword [ebp + 0xc]
add esi, esi
push esi
mov dword [edi], eax
push dword [ebx]
push eax
call fcn.004d634d
mov eax, dword [edi]
mov ecx, 0x3d
add esp, 0xc
mov word [esi + eax], cx
mov eax, dword [esp + 0x14]
add eax, eax
push eax
mov eax, dword [edi]
push dword [ebx + 8]
add eax, 2
add eax, esi
push eax
call fcn.004d634d
add esp, 0xc
xor esi, esi
jmp 0x4a95ab
push 0x55c75e
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov ecx, dword [ebp + 0xc]
xor esi, esi
mov dword [ecx], eax
jmp 0x4a95ab
mov esi, 0x80004005
jmp 0x4a95ab
mov esi, 0x800a005b
mov dword [esp + 0x54], esi
cmp word [esp + 0x44], 0
je 0x4a95be
lea eax, [esp + 0x44]
push eax
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8