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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x101c
call fcn.4ad1a580
cmp byte [0x4ad1c7e0], 0
push ebx
push esi
push edi
mov dword [ebp - 0x1c], 0x80000002
mov dword [ebp - 0x18], 0x80000001
je 0x4ad09fe2
mov byte [0x4ad1cf7c], 1
mov ecx, dword [ebp + 8]
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea eax, [ebp - 0x1c]
mov dword [ebp - 0xc], ecx
sub eax, ecx
mov dword [ebp - 0x10], 2
mov dword [ebp - 0x14], eax
mov ebx, 0x1000
jmp 0x4ad0a007
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 8]
push ecx
mov ecx, dword [ebp - 0xc]
push 0x4ad0195c
push dword [eax + ecx]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
xor esi, esi
cmp eax, esi
jne 0x4ad0a34e
lea eax, [ebp - 4]
mov dword [ebp + 8], esi
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad0193c
mov dword [ebp - 4], ebx
push dword [ebp - 8]
call edi
cmp eax, esi
jne 0x4ad0a07c
cmp dword [ebp + 8], 4
jne 0x4ad0a05d
xor eax, eax
cmp dword [ebp - 0x101c], esi
setne al
jmp 0x4ad0a077
cmp dword [ebp + 8], 1
jne 0x4ad0a07c
lea eax, [ebp - 0x101c]
push eax
call dword [sym.imp.MSVCRT.dll__wtol]
dec eax
pop ecx
neg eax
sbb eax, eax
inc eax
mov byte [0x4ad1cf68], al
lea eax, [ebp - 4]
mov dword [ebp - 4], ebx
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad01918
push dword [ebp - 8]
call edi
cmp eax, esi
jne 0x4ad0a0cf
cmp dword [ebp + 8], 4
jne 0x4ad0a0b0
xor eax, eax
cmp dword [ebp - 0x101c], esi
setne al
jmp 0x4ad0a0ca
cmp dword [ebp + 8], 1
jne 0x4ad0a0cf
lea eax, [ebp - 0x101c]
push eax
call dword [sym.imp.MSVCRT.dll__wtol]
dec eax
pop ecx
neg eax
sbb eax, eax
inc eax
mov byte [0x4ad1cf7c], al
lea eax, [ebp - 4]
mov dword [ebp - 4], ebx
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad018f4
push dword [ebp - 8]
call edi
cmp eax, esi
jne 0x4ad0a122
cmp dword [ebp + 8], 4
jne 0x4ad0a103
xor eax, eax
cmp dword [ebp - 0x101c], esi
setne al
jmp 0x4ad0a11d
cmp dword [ebp + 8], 1
jne 0x4ad0a122
lea eax, [ebp - 0x101c]
push eax
call dword [sym.imp.MSVCRT.dll__wtol]
dec eax
pop ecx
neg eax
sbb eax, eax
inc eax
mov byte [0x4ad1cf80], al
lea eax, [ebp - 4]
mov dword [ebp - 4], ebx
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad018d8
push dword [ebp - 8]
call edi
cmp eax, esi
jne 0x4ad0a170
cmp dword [ebp + 8], 4
jne 0x4ad0a152
mov ax, word [ebp - 0x101c]
jmp 0x4ad0a16a
cmp dword [ebp + 8], 1
jne 0x4ad0a170
push esi
lea eax, [ebp - 0x101c]
push esi
push eax
call dword [sym.imp.MSVCRT.dll_wcstol]
add esp, 0xc
mov word [0x4ad1cf8c], ax
lea eax, [ebp - 4]
mov dword [ebp - 4], ebx
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad018b8
push dword [ebp - 8]
call edi
cmp eax, esi
jne 0x4ad0a1d8
cmp dword [ebp + 8], 4
jne 0x4ad0a1a0
mov ax, word [ebp - 0x101c]
jmp 0x4ad0a1b8
cmp dword [ebp + 8], 1
jne 0x4ad0a1be
push esi
lea eax, [ebp - 0x101c]
push esi
push eax
call dword [sym.imp.MSVCRT.dll_wcstol]
add esp, 0xc
mov word [0x4ad1c7e4], ax
mov ax, word [0x4ad1c7e4]
cmp ax, si
je 0x4ad0a1cf
cmp ax, 0x20
jbe 0x4ad0a1d8
mov word [0x4ad1c7e4], 0x20
lea eax, [ebp - 4]
mov dword [ebp - 4], ebx
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad01890
push dword [ebp - 8]
call edi
cmp eax, esi
jne 0x4ad0a245
cmp dword [ebp + 8], 4
jne 0x4ad0a208
mov ax, word [ebp - 0x101c]
jmp 0x4ad0a220
cmp dword [ebp + 8], 1
jne 0x4ad0a228
push esi
lea eax, [ebp - 0x101c]
push esi
push eax
call dword [sym.imp.MSVCRT.dll_wcstol]
add esp, 0xc
mov word [0x4ad1c7e8], ax
jmp 0x4ad0a22e
mov ax, word [0x4ad1c7e8]
cmp ax, si
je 0x4ad0a239
cmp ax, 0x20
jbe 0x4ad0a24b
mov ax, 0x20
mov word [0x4ad1c7e8], ax
jmp 0x4ad0a24b
mov ax, word [0x4ad1c7e8]
mov cx, word [0x4ad1c7e4]
push 0x20
pop edx
cmp cx, dx
jne 0x4ad0a267
cmp ax, dx
jae 0x4ad0a26a
mov word [0x4ad1c7e4], ax
jmp 0x4ad0a278
cmp ax, dx
jne 0x4ad0a278
cmp cx, dx
jae 0x4ad0a278
mov word [0x4ad1c7e8], cx
lea eax, [ebp - 4]
mov dword [ebp - 4], ebx
push eax
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp + 8]
push eax
push esi
push 0x4ad01880
push dword [ebp - 8]
call edi
cmp eax, esi
jne 0x4ad0a345
cmp dword [ebp + 8], 2
jne 0x4ad0a2e5
mov eax, dword [ebp - 4]
shr eax, 1
lea esi, [ebp + eax*2 - 0x1018]
mov eax, ebx
sub eax, dword [ebp - 4]
shr eax, 1
push eax
lea eax, [ebp - 0x101c]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x4ad0a2db
lea eax, [ebp - 0x101c]
push esi
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
pop ecx
pop ecx
jmp 0x4ad0a2e3
and word [ebp - 0x101c], 0
xor esi, esi
cmp word [ebp - 0x101c], si
je 0x4ad0a345
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.4ad0d9ca
test eax, eax
je 0x4ad0a33c
lea eax, [ebp - 0x101c]
test eax, eax
je 0x4ad0a33c
lea eax, [ebp - 0x101c]
push eax
lea eax, [ebp - 0x101c]
push eax
call esi
pop ecx
lea eax, [eax + eax + 2]
push eax
call fcn.4ad0d9ca
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
pop ecx
pop ecx
jmp 0x4ad0a33e
xor eax, eax
mov ecx, dword [ebp - 0xc]
xor esi, esi
mov dword [ecx], eax
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
add dword [ebp - 0xc], 4
dec dword [ebp - 0x10]
jne 0x4ad0a004
push esi
call dword [sym.imp.MSVCRT.dll_time]
pop ecx
push eax
call dword [sym.imp.MSVCRT.dll_srand]
pop ecx
pop edi
pop esi
pop ebx
leave
ret 4