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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push esi
push edi
xor eax, eax
lea edi, [ebp - 0x2c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor ecx, ecx
stosd dword es:[edi], eax
xor edi, edi
inc edi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 4], ecx
mov dword [ebp - 8], ecx
cmp dword [ebx + 0x24], ecx
je 0x407a27
mov edi, 0x101
push ecx
lea eax, [ebp - 0xc]
push eax
push dword [ebx + 0x1c]
push dword [ebp + 8]
call fcn.00408c6a
mov esi, eax
test esi, esi
jns 0x407a47
push str.Failed_to_format_key_string.
jmp 0x407d1a
mov eax, dword [ebx + 0x20]
test eax, eax
je 0x407a6d
push 0
lea ecx, [ebp - 0x10]
push ecx
push eax
push dword [ebp + 8]
call fcn.00408c6a
mov esi, eax
test esi, esi
jns 0x407a6d
push str.Failed_to_format_value_string.
jmp 0x407d1a
lea eax, [ebp - 0x14]
push eax
push edi
push dword [ebp - 0xc]
push dword [ebx + 0x18]
call fcn.00433dfc
mov esi, eax
cmp esi, 0x80070002
jne 0x407ac4
push dword [ebx + 4]
push dword [ebp - 0xc]
push str.Registry_key_not_found._Key___ls__variable___ls
push 2
call fcn.0042fd12
add esp, 0x10
push 0
lea eax, [ebp - 0x2c]
push eax
push dword [ebx + 4]
push dword [ebp + 8]
call fcn.0040a806
mov esi, eax
test esi, esi
jns 0x407abd
push str.Failed_to_clear_variable.
jmp 0x407d1a
xor esi, esi
jmp 0x407d39
test esi, esi
jns 0x407ad2
push str.Failed_to_open_registry_key.
jmp 0x407d1a
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea eax, [ebp - 4]
push eax
push 0
lea eax, [ebp - 0x18]
push eax
push 0
push dword [ebp - 0x10]
push dword [ebp - 0x14]
call esi
push 2
pop edi
cmp eax, edi
jne 0x407b12
push dword [ebp - 0x10]
push dword [ebp - 0xc]
push str.Registry_value_not_found._Key___ls__Value___ls
push edi
call fcn.0042fd12
add esp, 0x10
push 0
lea eax, [ebp - 0x2c]
push eax
push dword [ebx + 4]
jmp 0x407aa5
test eax, eax
je 0x407b47
jle 0x407b22
and eax, 0xffff
or eax, 0x80070000
mov esi, eax
test esi, esi
js 0x407b2d
mov esi, 0x80004005
push esi
push 0x369
push str.search.cpp
call fcn.00432f68
push str.Failed_to_query_registry_key_value_size.
jmp 0x407d1a
mov eax, dword [ebp - 4]
push 1
add eax, 2
push eax
call fcn.00432955
mov dword [ebp - 8], eax
test eax, eax
jne 0x407b83
mov esi, 0x8007000e
push esi
push 0x36c
push str.search.cpp
call fcn.00432f68
push str.Failed_to_allocate_memory_registry_value.
push esi
call fcn.004300f7
pop ecx
pop ecx
jmp 0x407d26
lea ecx, [ebp - 4]
push ecx
push eax
lea eax, [ebp - 0x18]
push eax
push 0
push dword [ebp - 0x10]
push dword [ebp - 0x14]
call esi
test eax, eax
je 0x407bcb
jle 0x407ba6
and eax, 0xffff
or eax, 0x80070000
mov esi, eax
test esi, esi
js 0x407bb1
mov esi, 0x80004005
push esi
push 0x36f
push str.search.cpp
call fcn.00432f68
push str.Failed_to_query_registry_key_value.
jmp 0x407d1a
mov eax, dword [ebp - 0x18]
dec eax
je 0x407cca
dec eax
je 0x407c32
sub eax, edi
je 0x407c22
sub eax, 7
je 0x407bfc
push dword [ebp - 0x18]
mov esi, 0x80004001
push str.Unsupported_registry_key_value_type._Type___u
push esi
call fcn.004300f7
add esp, 0xc
jmp 0x407d26
cmp dword [ebp - 4], 8
je 0x407c0c
mov esi, 0x8000ffff
jmp 0x407d26
mov eax, dword [ebp - 8]
push dword [eax + 4]
push dword [eax]
lea eax, [ebp - 0x2c]
push eax
call fcn.00421602
jmp 0x407cd8
cmp dword [ebp - 4], 4
jne 0x407c02
mov eax, dword [ebp - 8]
mov eax, dword [eax]
cdq
push edx
push eax
jmp 0x407c14
cmp dword [ebx + 0x28], 0
je 0x407cca
push dword [ebp - 4]
lea eax, [ebp - 0x2c]
push eax
call fcn.00430748
mov esi, eax
test esi, esi
jns 0x407c58
push str.Failed_to_allocate_string_buffer.
jmp 0x407d1a
push dword [ebp - 4]
mov dword [ebp - 0x24], edi
push dword [ebp - 0x2c]
mov edi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push dword [ebp - 8]
call edi
mov dword [ebp - 0x1c], eax
cmp eax, dword [ebp - 4]
jbe 0x407cda
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.00430748
mov esi, eax
test esi, esi
js 0x407c4e
push dword [ebp - 0x1c]
push dword [ebp - 0x2c]
push dword [ebp - 8]
call edi
cmp dword [ebp - 0x1c], eax
je 0x407cda
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x407ca8
and eax, 0xffff
or eax, 0x80070000
mov esi, eax
test esi, esi
js 0x407cb3
mov esi, 0x80004005
push esi
push 0x390
push str.search.cpp
call fcn.00432f68
push str.Failed_to_get_expand_environment_string.
jmp 0x407d1a
push 0
push dword [ebp - 8]
lea eax, [ebp - 0x2c]
push eax
call fcn.0042163e
mov esi, eax
test esi, esi
jns 0x407ce5
push str.Failed_to_read_registry_value.
jmp 0x407d1a
push dword [ebx + 0x14]
lea eax, [ebp - 0x2c]
push eax
call fcn.0042173f
mov esi, eax
test esi, esi
jns 0x407cfe
push str.Failed_to_change_value_type.
jmp 0x407d1a
push 0
lea eax, [ebp - 0x2c]
push eax
push dword [ebx + 4]
push dword [ebp + 8]
call fcn.0040a806
mov esi, eax
test esi, esi
jns 0x407d39
push str.Failed_to_set_variable.
push esi
call fcn.004300f7
pop ecx
pop ecx
test esi, esi
jns 0x407d39
push esi
push dword [ebp - 0xc]
push str.RegistrySearchValue_failed:_ID__ls__HRESULT_0x_x
push 2
call fcn.0042fd12
add esp, 0x10
xor edi, edi
cmp dword [ebp - 0xc], edi
je 0x407d48
push dword [ebp - 0xc]
call fcn.00430858
cmp dword [ebp - 0x10], edi
je 0x407d55
push dword [ebp - 0x10]
call fcn.00430858
cmp dword [ebp - 0x14], edi
je 0x407d66
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x14], edi
cmp dword [ebp - 8], edi
je 0x407d73
push dword [ebp - 8]
call fcn.00432b10
lea eax, [ebp - 0x2c]
push eax
call fcn.004214b2
pop edi
mov eax, esi
pop esi
leave
ret 4