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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4d82f8
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push esi
mov eax, dword [0x523f10]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor ebx, ebx
mov dword [ebp - 4], 1
mov dword [ebp - 0x18], ebx
cmp dword [ebp + 0x1c], ebx
je 0x46c856
call fcn.0046f180
test eax, eax
mov eax, 0x20119
jne 0x46c85b
mov eax, 0x20019
mov edx, dword [ebp + 0xc]
lea ecx, [ebp - 0x18]
push ecx
push eax
mov eax, dword [ebp + 8]
push ebx
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x46ca2c
mov eax, dword [ebp + 0x10]
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea ecx, [ebp + 0x1c]
push ecx
mov ecx, dword [ebp - 0x18]
push ebx
lea edx, [ebp - 0x10]
push edx
push ebx
push eax
push ecx
mov dword [ebp - 0x10], ebx
mov dword [ebp + 0x1c], ebx
call esi
mov edx, dword [ebp + 0x1c]
test edx, edx
jbe 0x46ca07
mov eax, dword [edi]
sub eax, 0x10
mov ecx, 1
sub ecx, dword [eax + 0xc]
mov eax, dword [eax + 8]
sub eax, edx
or eax, ecx
jge 0x46c8c0
push edx
mov ecx, edi
call fcn.00422527
mov eax, dword [edi]
mov ecx, dword [ebp + 0x10]
lea edx, [ebp + 0x1c]
push edx
mov edx, dword [ebp - 0x18]
push eax
lea eax, [ebp - 0x10]
push eax
push 0
push ecx
push edx
call esi
test eax, eax
jne 0x46c9dc
mov eax, dword [ebp - 0x10]
cmp eax, 1
je 0x46c8f0
cmp eax, 2
jne 0x46c9dc
mov eax, dword [edi]
mov ecx, dword [eax - 8]
test eax, eax
je 0x46c90b
push ecx
push eax
call fcn.004b9b5b
add esp, 8
test eax, eax
jl 0x46c9d2
mov ecx, dword [edi]
cmp eax, dword [ecx - 8]
jg 0x46c9d2
mov dword [ecx - 0xc], eax
mov ecx, dword [edi]
xor edx, edx
mov word [ecx + eax*2], dx
cmp dword [ebp - 0x10], 2
lea ebx, [edx + 1]
jne 0x46ca22
cmp dword [ebp + 0x14], edx
je 0x46ca22
lea ecx, [ebp - 0x14]
call fcn.0042248a
mov byte [ebp - 4], 2
mov edx, dword [ebp + 0x1c]
mov esi, dword [ebp - 0x14]
add edx, 0x208
mov dword [ebp + 0x1c], edx
mov eax, dword [esi - 8]
mov ecx, ebx
sub ecx, dword [esi - 4]
sub eax, edx
or eax, ecx
jge 0x46c96f
push edx
lea ecx, [ebp - 0x14]
call fcn.00422527
mov edx, dword [ebp + 0x1c]
mov esi, dword [ebp - 0x14]
mov eax, dword [edi]
push edx
push esi
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
xor ecx, ecx
cmp ecx, eax
mov eax, dword [esi - 8]
push eax
sbb ebx, ebx
push esi
neg ebx
call fcn.004b9b5b
add esp, 8
test eax, eax
jl 0x46c9d2
cmp eax, dword [esi - 8]
jg 0x46c9d2
xor edx, edx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], dx
test ebx, ebx
je 0x46c9b0
lea eax, [ebp - 0x14]
push eax
mov ecx, edi
call fcn.00424ef9
lea eax, [esi - 0x10]
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x46ca22
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x46ca22
push 0x80070057
call fcn.00422000
mov eax, dword [edi]
mov ecx, dword [eax - 8]
test eax, eax
je 0x46c9f3
push ecx
push eax
call fcn.004b9b5b
add esp, 8
test eax, eax
jl 0x46c9d2
mov ecx, dword [edi]
cmp eax, dword [ecx - 8]
jg 0x46c9d2
mov dword [ecx - 0xc], eax
mov ecx, dword [edi]
xor edx, edx
mov word [ecx + eax*2], dx
jmp 0x46ca22
cmp dword [ebp + 0x18], ebx
je 0x46ca22
test eax, eax
jne 0x46ca22
mov eax, dword [ebp - 0x10]
cmp eax, 1
je 0x46ca1d
cmp eax, 2
jne 0x46ca22
mov ebx, 1
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov byte [ebp - 4], 0
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x46ca4f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x46ca75
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret