Function at 0x61777780
Capabilities:
Query environment variable
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x28
and dword [ebp - 0xc], 0
push esi
lea eax, [ebp - 0x14]
push eax
push 0x20019
push 0
push 0x61771d88
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov esi, eax
test esi, esi
jne 0x617777d5
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x14]
call fcn.61776e81
mov esi, eax
test esi, esi
je 0x617777f4
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push esi
lea eax, [ebp - 4]
push eax
push 1
push 0x4e84
mov dword [ebp - 4], 0x61771c90
call sub.rtutils.dll_LogErrorW
mov eax, esi
jmp 0x6177797b
mov eax, dword [ebp - 0x18]
push ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
add eax, 2
push eax
push 8
push dword [0x6177d39c]
call edi
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x10], ebx
jne 0x6177783c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [ebp - 8], eax
lea eax, [ebp - 4]
push eax
push 1
push 0x4e83
mov dword [ebp - 4], 0x61771b98
call sub.rtutils.dll_LogErrorW
jmp 0x61777956
lea eax, [ebp - 0x18]
push eax
push ebx
lea eax, [ebp - 0x1c]
push eax
push 0
mov esi, 0x61771b98
push esi
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
mov dword [ebp - 8], eax
jne 0x617778bf
cmp dword [ebp - 0x1c], 2
je 0x61777870
cmp dword [ebp - 0x1c], 1
je 0x61777870
mov eax, 0x3f7
jmp 0x617778bc
push 0
push 0
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
call ebx
test eax, eax
jne 0x61777892
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 8], eax
mov dword [ebp - 4], ecx
jmp 0x617778c2
lea esi, [eax + eax]
lea eax, [esi + esi]
push eax
push 8
push dword [0x6177d39c]
call edi
test eax, eax
mov dword [ebp - 0xc], eax
je 0x61777881
push esi
mov esi, dword [ebp - 0x10]
push eax
push esi
call ebx
test eax, eax
jne 0x617778d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
mov dword [ebp - 4], esi
push eax
lea eax, [ebp - 4]
push eax
push 1
push 0x4e83
call sub.rtutils.dll_LogErrorW
jmp 0x61777945
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test eax, eax
mov dword [0x6177d4ac], eax
je 0x61777918
cmp dword [0x6177d018], 0
je 0x61777945
mov esi, 0x6177d018
mov eax, esi
push dword [eax]
push dword [0x6177d4ac]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov dword [esi + 4], eax
je 0x61777918
add esi, 8
cmp dword [esi], 0
mov eax, esi
jne 0x617778f7
jmp 0x61777945
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [0x6177d38c], 0
mov dword [ebp - 8], eax
jbe 0x61777945
push dword [ebp - 8]
lea eax, [ebp - 0xc]
push eax
push 1
push 0x4e87
push 1
push dword [0x6177d3a0]
call sub.rtutils.dll_RouterLogEventW
push dword [ebp - 0x10]
push 0
push dword [0x6177d39c]
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [ebp - 0xc], 0
pop edi
pop ebx
je 0x6177796f
push dword [ebp - 0xc]
push 0
push dword [0x6177d39c]
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 8]
pop esi
leave
ret