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.00417f80
mov eax, dword [0x42e0b4]
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 [0x436755], 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 0x41b0f1
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 0x41b139
cmp dword [ebp - 0x1004], eax
setne byte [0x436755]
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 0x41b165
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 0x41b1ad
mov ax, word [ebp - 0x1004]
mov word [0x436764], 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 0x41b1d3
mov ax, word [ebp - 0x1004]
mov word [0x42e0d0], ax
test ax, ax
je 0x41b200
push 0xd
pop ecx
push 0x20
cmp ax, cx
pop ecx
je 0x41b203
cmp ax, cx
ja 0x41b203
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 0x41b24c
cmp dword [ebp - 0x1008], 4
jne 0x41b20f
mov ax, word [ebp - 0x1004]
mov word [0x42e0cc], ax
test ax, ax
je 0x41b23c
push 0xd
pop ecx
push 0x20
pop edx
cmp ax, cx
je 0x41b23f
cmp ax, dx
ja 0x41b23f
mov cx, word [0x42e0d0]
cmp cx, dx
je 0x41b25a
cmp ax, dx
je 0x41b26e
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 0x41b283
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.00416b30
leave
ret
cmp dword [ebp - 0x1008], 4
jne 0x41b10d
cmp dword [ebp - 0x1004], 0
setne byte [0x449051]
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 [0x449051], 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 [0x436755], al
jmp 0x408371
cmp dword [ebp - 0x1008], 4
jne 0x41b181
cmp dword [ebp - 0x1004], 0
setne byte [0x436754]
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 [0x436754], 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 0x41b1f5
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 [0x42e0d0]
jmp 0x40844b
push 0x20
pop ecx
mov word [0x42e0d0], cx
jmp 0x40846c
cmp dword [ebp - 0x1008], 1
jne 0x41b231
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 [0x42e0cc]
jmp 0x4084c0
push 0x20
pop edx
mov eax, edx
mov word [0x42e0cc], ax
jmp 0x4084e1
mov ax, word [0x42e0cc]
push 0x20
pop edx
jmp 0x4084e1
cmp ax, dx
jae 0x4084f4
mov word [0x42e0d0], ax
jmp 0x4084fa
cmp cx, dx
jae 0x4084fa
mov word [0x42e0cc], cx
jmp 0x4084fa
cmp dword [ebp - 0x1008], 2
jne 0x41b2d9
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 0x41b2ca
push esi
mov edx, 0x800
lea ecx, [ebp - 0x1004]
call fcn.0040f3a0
jmp 0x41b2d3
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