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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x101c
call fcn.4ad0225a
cmp byte [0x4ad3484c], 0
mov dword [ebp - 0x1c], 0x80000002
mov dword [ebp - 0x18], 0x80000001
je 0x4ad049c8
mov byte [0x4ad2fa64], 1
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push esi
lea esi, [ebp - 0x1c]
sub esi, eax
push edi
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x10], 2
mov edi, 0x1000
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0xc]
push 0x4ad04ce0
push dword [esi + eax]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x4ad04bdf
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
xor esi, esi
push esi
push 0x4ad04cc0
push dword [ebp - 8]
mov dword [ebp + 8], esi
mov dword [ebp - 4], edi
call ebx
test eax, eax
je 0x4ad13ae4
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad04c9c
push dword [ebp - 8]
mov dword [ebp - 4], edi
call ebx
test eax, eax
jne 0x4ad04a6b
cmp dword [ebp + 8], 4
jne 0x4ad051ac
cmp dword [ebp - 0x101c], esi
setne al
mov byte [0x4ad2fa64], al
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad04c78
push dword [ebp - 8]
mov dword [ebp - 4], edi
call ebx
test eax, eax
je 0x4ad13b38
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad04c5c
push dword [ebp - 8]
mov dword [ebp - 4], edi
call ebx
test eax, eax
jne 0x4ad04ac8
cmp dword [ebp + 8], 4
jne 0x4ad051bb
mov ax, word [ebp - 0x101c]
mov word [0x4ad2fa88], ax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad04c3c
push dword [ebp - 8]
mov dword [ebp - 4], edi
call ebx
test eax, eax
jne 0x4ad04b1a
cmp dword [ebp + 8], 4
jne 0x4ad13b89
mov ax, word [ebp - 0x101c]
mov word [0x4ad2fa58], ax
cmp ax, si
je 0x4ad04b11
cmp ax, 0xd
je 0x4ad04b11
cmp ax, 0x20
jbe 0x4ad04b1a
mov word [0x4ad2fa58], 0x20
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad04c14
push dword [ebp - 8]
mov dword [ebp - 4], edi
call ebx
test eax, eax
jne 0x4ad051a1
cmp dword [ebp + 8], 4
jne 0x4ad13bb1
mov ax, word [ebp - 0x101c]
mov word [0x4ad2fa5c], ax
cmp ax, si
je 0x4ad04b67
cmp ax, 0xd
je 0x4ad04b67
cmp ax, 0x20
jbe 0x4ad04b71
mov ax, 0x20
mov word [0x4ad2fa5c], ax
mov cx, word [0x4ad2fa58]
push 0x20
pop edx
cmp cx, dx
jne 0x4ad051ca
cmp ax, dx
jb 0x4ad13bd9
jne 0x4ad04b9b
cmp cx, dx
jae 0x4ad04b9b
mov word [0x4ad2fa5c], cx
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad04c04
push dword [ebp - 8]
mov dword [ebp - 4], edi
call ebx
test eax, eax
jne 0x4ad04bd3
cmp dword [ebp + 8], 2
je 0x4ad13be4
cmp word [ebp - 0x101c], si
jne 0x4ad13c2b
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [ebp - 0x14]
add dword [ebp - 0xc], 4
dec dword [ebp - 0x10]
jne 0x4ad049eb
push 0
call dword [sym.imp.msvcrt.dll_time]
push eax
call dword [sym.imp.msvcrt.dll_srand]
pop ecx
pop ecx
pop edi
pop esi
pop ebx
leave
ret 4
mov ax, word [0x4ad2fa5c]
jmp 0x4ad04b71
cmp dword [ebp + 8], 1
je 0x4ad13b1e
jmp 0x4ad04a6b
cmp dword [ebp + 8], 1
je 0x4ad13b72
jmp 0x4ad04ac8
cmp ax, dx
jmp 0x4ad04b8d
cmp dword [ebp + 8], 4
jne 0x4ad13af5
cmp dword [ebp - 0x101c], esi
setne al
jmp 0x4ad13b14
cmp dword [ebp + 8], 1
jne 0x4ad04a32
lea eax, [ebp - 0x101c]
push eax
call dword [sym.imp.msvcrt.dll__wtol]
dec eax
neg eax
sbb al, al
pop ecx
inc al
mov byte [0x4ad3d9fc], al
jmp 0x4ad04a32
lea eax, [ebp - 0x101c]
push eax
call dword [sym.imp.msvcrt.dll__wtol]
dec eax
neg eax
sbb al, al
pop ecx
inc al
jmp 0x4ad04a66
cmp dword [ebp + 8], 4
jne 0x4ad13b49
cmp dword [ebp - 0x101c], esi
setne al
jmp 0x4ad13b68
cmp dword [ebp + 8], 1
jne 0x4ad04a90
lea eax, [ebp - 0x101c]
push eax
call dword [sym.imp.msvcrt.dll__wtol]
dec eax
neg eax
sbb al, al
pop ecx
inc al
mov byte [0x4ad33b7c], al
jmp 0x4ad04a90
push esi
lea eax, [ebp - 0x101c]
push esi
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
jmp 0x4ad04ac2
cmp dword [ebp + 8], 1
jne 0x4ad13ba6
push esi
lea eax, [ebp - 0x101c]
push esi
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
jmp 0x4ad04afa
mov ax, word [0x4ad2fa58]
jmp 0x4ad04b00
cmp dword [ebp + 8], 1
jne 0x4ad13bce
push esi
lea eax, [ebp - 0x101c]
push esi
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
jmp 0x4ad04b50
mov ax, word [0x4ad2fa5c]
jmp 0x4ad04b56
mov word [0x4ad2fa58], ax
jmp 0x4ad04b9b
mov eax, dword [ebp - 4]
mov ecx, edi
sub ecx, dword [ebp - 4]
shr eax, 1
shr ecx, 1
lea esi, [ebp + eax*2 - 0x1018]
push ecx
push esi
lea eax, [ebp - 0x101c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x4ad13c1c
lea eax, [ebp - 0x101c]
push esi
push eax
call dword [sym.imp.msvcrt.dll_wcscpy]
pop ecx
pop ecx
jmp 0x4ad13c24
and word [ebp - 0x101c], 0
xor esi, esi
jmp 0x4ad04bc6
mov esi, dword [sym.imp.msvcrt.dll_wcslen]
lea eax, [ebp - 0x101c]
push eax
call esi
pop ecx
lea eax, [eax + eax + 2]
push eax
call fcn.4ad01711
test eax, eax
je 0x4ad13c69
lea eax, [ebp - 0x101c]
push eax
push eax
call esi
pop ecx
lea eax, [eax + eax + 2]
push eax
call fcn.4ad01711
push eax
call dword [sym.imp.msvcrt.dll_wcscpy]
pop ecx
pop ecx
jmp 0x4ad13c6b
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword [ecx], eax
jmp 0x4ad04bd3