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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x778ff0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x30
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x14], ebx
mov edi, ecx
push 0
call fcn.00650390
mov esi, dword [ebp + 8]
movzx eax, al
test eax, eax
je 0x650221
xor eax, eax
mov dword [ebp - 0x20], eax
test esi, esi
mov dword [ebp - 0x24], eax
je 0x6501ba
movzx eax, word [esi]
test eax, eax
jne 0x6501c1
mov edx, 1
jmp 0x6501c3
xor edx, edx
lea ecx, [ebp - 0x20]
xor eax, eax
cmp edx, 0
lea edx, [ebp - 0x24]
mov ebx, esi
cmovne ebx, eax
push edx
push eax
push ecx
push eax
push ebx
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov dword [edi + 0x10], eax
test eax, eax
jne 0x650221
mov edx, dword [ebp - 0x24]
test edx, edx
jne 0x650270
mov ecx, dword [ebp + 0xc]
push 0
call fcn.00620e80
mov eax, dword [edi + 0x10]
test eax, eax
jne 0x650221
mov edi, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 0xc
call fcn.00629330
test eax, eax
je 0x650269
push 0
push str.Cant_read_value_of__s
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 8]
mov ebx, eax
push esi
push edi
call fcn.00650c20
push eax
push ebx
push dword [edi + 0x10]
call fcn.00630510
add esp, 0x14
mov edi, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 0xc
mov ebx, str.Cant_read_value_of__s
jmp 0x65023a
test esi, esi
je 0x65027b
movzx eax, word [esi]
test eax, eax
jne 0x650282
mov ecx, 1
jmp 0x650284
xor ecx, ecx
push edx
xor eax, eax
mov dword [ebp - 0x28], eax
cmp ecx, 0
mov ebx, esi
cmovne ebx, eax
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x2c], ecx
call fcn.0061f9e0
mov dword [ebp - 4], 2
mov dword [ebp - 0x28], eax
lea ecx, [ebp - 0x20]
lea edx, [ebp - 0x24]
push edx
push eax
push ecx
push 0
push ebx
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x2c]
mov dword [edi + 0x10], eax
call fcn.0061fa10
mov eax, dword [ebp - 0x20]
cmp eax, 2
jne 0x6501fc
movzx eax, byte [ebp + 0x10]
test eax, eax
jne 0x6501fc
mov edx, dword [ebp + 0xc]
xor eax, eax
push eax
push eax
push dword [edx]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ebx, eax
test ebx, ebx
je 0x6501fc
mov dword [ebp - 4], 0
mov eax, dword [0x83b878]
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], eax
lea ecx, [ebp - 0x34]
mov eax, dword [edx]
mov dword [ebp - 0x30], eax
push ebx
mov dword [ebp - 0x3c], ecx
call fcn.0061f9e0
mov dword [ebp - 4], 1
mov dword [ebp - 0x38], eax
push ebx
push eax
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x3c]
call fcn.0061fa10
mov ecx, dword [ebp + 0xc]
lea eax, [ebp - 0x34]
push eax
call fcn.00620770
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x34]
add ecx, 0xfffffff4
mov eax, dword [ecx]
cmp eax, 0xffffffff
je 0x6501fc
dec eax
mov dword [ecx], eax
jne 0x6501fc
call fcn.0061ff50
jmp 0x6501fc