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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x101c
call fcn.00417f40
mov eax, dword [0x42d0b4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 2
mov edi, ecx
mov dword [ebp - 0x101c], 0x80000002
lea ebx, [ebp - 0x101c]
mov dword [ebp - 0x1018], 0x80000001
pop esi
mov byte [0x435755], 1
sub ebx, edi
mov dword [ebp - 0x1014], esi
lea eax, [ebp - 0x1010]
push eax
push 0x2000000
push 0
push 0x4021b0
push dword [ebx + edi]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x408540
and dword [ebp - 0x1008], eax
lea eax, [ebp - 0x100c]
push eax
lea eax, [ebp - 0x1004]
mov dword [ebp - 0x100c], 0x1000
push eax
lea eax, [ebp - 0x1008]
push eax
push 0
push 0x4020d4
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
je 0x41b0af
lea eax, [ebp - 0x100c]
mov dword [ebp - 0x100c], 0x1000
push eax
lea eax, [ebp - 0x1004]
push eax
lea eax, [ebp - 0x1008]
push eax
push 0
push 0x4020f4
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
jne 0x408371
cmp dword [ebp - 0x1008], 4
jne 0x41b0f7
cmp dword [ebp - 0x1004], eax
setne byte [0x435755]
lea eax, [ebp - 0x100c]
mov dword [ebp - 0x100c], 0x1000
push eax
lea eax, [ebp - 0x1004]
push eax
lea eax, [ebp - 0x1008]
push eax
push 0
push 0x402118
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
je 0x41b123
lea eax, [ebp - 0x100c]
mov dword [ebp - 0x100c], 0x1000
push eax
lea eax, [ebp - 0x1004]
push eax
lea eax, [ebp - 0x1008]
push eax
push 0
push 0x40213c
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
jne 0x4083fb
cmp dword [ebp - 0x1008], 4
jne 0x41b16b
mov ax, word [ebp - 0x1004]
mov word [0x435764], ax
lea eax, [ebp - 0x100c]
mov dword [ebp - 0x100c], 0x1000
push eax
lea eax, [ebp - 0x1004]
push eax
lea eax, [ebp - 0x1008]
push eax
push 0
push 0x402158
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
jne 0x40846c
cmp dword [ebp - 0x1008], 4
jne 0x41b191
mov ax, word [ebp - 0x1004]
mov word [0x42d0d0], ax
test ax, ax
je 0x41b1be
push 0xd
pop ecx
push 0x20
cmp ax, cx
pop ecx
je 0x41b1c1
cmp ax, cx
ja 0x41b1c1
lea eax, [ebp - 0x100c]
mov dword [ebp - 0x100c], 0x1000
push eax
lea eax, [ebp - 0x1004]
push eax
lea eax, [ebp - 0x1008]
push eax
push 0
push 0x402178
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
jne 0x41b20a
cmp dword [ebp - 0x1008], 4
jne 0x41b1cd
mov ax, word [ebp - 0x1004]
mov word [0x42d0cc], ax
test ax, ax
je 0x41b1fa
push 0xd
pop ecx
push 0x20
pop edx
cmp ax, cx
je 0x41b1fd
cmp ax, dx
ja 0x41b1fd
mov cx, word [0x42d0d0]
cmp cx, dx
je 0x41b218
cmp ax, dx
je 0x41b22c
lea eax, [ebp - 0x100c]
mov dword [ebp - 0x100c], 0x1000
push eax
lea eax, [ebp - 0x1004]
push eax
lea eax, [ebp - 0x1008]
push eax
push 0
push 0x4021a0
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
je 0x41b241
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
add edi, 4
sub esi, 1
mov dword [ebp - 0x1014], esi
jne 0x4082bd
push 0
call dword [sym.imp.msvcrt.dll_time]
push eax
call dword [sym.imp.msvcrt.dll_srand]
pop ecx
pop ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00416b50
leave
ret
cmp dword [ebp - 0x1008], 4
jne 0x41b0cb
cmp dword [ebp - 0x1004], 0
setne byte [0x448051]
jmp 0x408321
cmp dword [ebp - 0x1008], 1
jne 0x408321
lea eax, [ebp - 0x1004]
push eax
call dword [sym.imp.msvcrt.dll__wtol]
dec eax
neg eax
pop ecx
sbb al, al
inc al
mov byte [0x448051], al
jmp 0x408321
cmp dword [ebp - 0x1008], 1
jne 0x408371
lea eax, [ebp - 0x1004]
push eax
call dword [sym.imp.msvcrt.dll__wtol]
dec eax
neg eax
pop ecx
sbb al, al
inc al
mov byte [0x435755], al
jmp 0x408371
cmp dword [ebp - 0x1008], 4
jne 0x41b13f
cmp dword [ebp - 0x1004], 0
setne byte [0x435754]
jmp 0x4083ab
cmp dword [ebp - 0x1008], 1
jne 0x4083ab
lea eax, [ebp - 0x1004]
push eax
call dword [sym.imp.msvcrt.dll__wtol]
dec eax
neg eax
pop ecx
sbb al, al
inc al
mov byte [0x435754], al
jmp 0x4083ab
cmp dword [ebp - 0x1008], 1
jne 0x4083fb
push 0
lea eax, [ebp - 0x1004]
push 0
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
jmp 0x4083f5
cmp dword [ebp - 0x1008], 1
jne 0x41b1b3
push 0
lea eax, [ebp - 0x1004]
push 0
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
jmp 0x408445
mov ax, word [0x42d0d0]
jmp 0x40844b
push 0x20
pop ecx
mov word [0x42d0d0], cx
jmp 0x40846c
cmp dword [ebp - 0x1008], 1
jne 0x41b1ef
push 0
lea eax, [ebp - 0x1004]
push 0
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
jmp 0x4084ba
mov ax, word [0x42d0cc]
jmp 0x4084c0
push 0x20
pop edx
mov eax, edx
mov word [0x42d0cc], ax
jmp 0x4084e1
mov ax, word [0x42d0cc]
push 0x20
pop edx
jmp 0x4084e1
cmp ax, dx
jae 0x4084f4
mov word [0x42d0d0], ax
jmp 0x4084fa
cmp cx, dx
jae 0x4084fa
mov word [0x42d0cc], cx
jmp 0x4084fa
cmp dword [ebp - 0x1008], 2
jne 0x41b297
mov ecx, dword [ebp - 0x100c]
lea esi, [ebp - 0x1000]
shr ecx, 1
mov eax, 0x7fe
sub eax, ecx
push eax
lea eax, [ebp - 0x1004]
lea esi, [esi + ecx*2]
push esi
push eax
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x41b288
push esi
mov edx, 0x800
lea ecx, [ebp - 0x1004]
call fcn.0040f3a0
jmp 0x41b291
xor eax, eax
mov word [ebp - 0x1004], ax
mov esi, dword [ebp - 0x1014]
cmp word [ebp - 0x1004], 0
je 0x408534
lea ecx, [ebp - 0x1004]
call fcn.0040acb0
mov dword [edi], eax
jmp 0x408534