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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x101c
call fcn.0041c080
mov eax, dword [0x4310b4]
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 [0x4397cd], 1
sub ebx, edi
mov dword [ebp - 0x1014], esi
lea eax, [ebp - 0x1010]
push eax
push 0x2000000
push 0
push 0x402298
push dword [ebx + edi]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x407a95
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 0x4021bc
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
je 0x41e23f
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 0x4021dc
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
jne 0x4078c6
cmp dword [ebp - 0x1008], 4
jne 0x41e287
cmp dword [ebp - 0x1004], eax
setne byte [0x4397cd]
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 0x402200
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
je 0x41e2b3
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 0x402224
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
jne 0x407950
cmp dword [ebp - 0x1008], 4
jne 0x41e2fb
mov ax, word [ebp - 0x1004]
mov word [0x4397dc], 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 0x402240
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
jne 0x4079c1
cmp dword [ebp - 0x1008], 4
jne 0x41e321
mov ax, word [ebp - 0x1004]
mov word [0x4310d0], ax
test ax, ax
je 0x41e34e
push 0xd
pop ecx
push 0x20
cmp ax, cx
pop ecx
je 0x41e351
cmp ax, cx
ja 0x41e351
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 0x402260
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
jne 0x41e39a
cmp dword [ebp - 0x1008], 4
jne 0x41e35d
mov ax, word [ebp - 0x1004]
mov word [0x4310cc], ax
test ax, ax
je 0x41e38a
push 0xd
pop ecx
push 0x20
pop edx
cmp ax, cx
je 0x41e38d
cmp ax, dx
ja 0x41e38d
mov cx, word [0x4310d0]
cmp cx, dx
je 0x41e3a8
cmp ax, dx
je 0x41e3bc
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 0x402288
push dword [ebp - 0x1010]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
je 0x41e3d1
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 0x407812
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.00417b90
leave
ret
cmp dword [ebp - 0x1008], 4
jne 0x41e25b
cmp dword [ebp - 0x1004], 0
setne byte [0x44c129]
jmp 0x407876
cmp dword [ebp - 0x1008], 1
jne 0x407876
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 [0x44c129], al
jmp 0x407876
cmp dword [ebp - 0x1008], 1
jne 0x4078c6
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 [0x4397cd], al
jmp 0x4078c6
cmp dword [ebp - 0x1008], 4
jne 0x41e2cf
cmp dword [ebp - 0x1004], 0
setne byte [0x4397cc]
jmp 0x407900
cmp dword [ebp - 0x1008], 1
jne 0x407900
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 [0x4397cc], al
jmp 0x407900
cmp dword [ebp - 0x1008], 1
jne 0x407950
push 0
lea eax, [ebp - 0x1004]
push 0
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
jmp 0x40794a
cmp dword [ebp - 0x1008], 1
jne 0x41e343
push 0
lea eax, [ebp - 0x1004]
push 0
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
jmp 0x40799a
mov ax, word [0x4310d0]
jmp 0x4079a0
push 0x20
pop ecx
mov word [0x4310d0], cx
jmp 0x4079c1
cmp dword [ebp - 0x1008], 1
jne 0x41e37f
push 0
lea eax, [ebp - 0x1004]
push 0
push eax
call dword [sym.imp.msvcrt.dll_wcstol]
add esp, 0xc
jmp 0x407a0f
mov ax, word [0x4310cc]
jmp 0x407a15
push 0x20
pop edx
mov eax, edx
mov word [0x4310cc], ax
jmp 0x407a36
mov ax, word [0x4310cc]
push 0x20
pop edx
jmp 0x407a36
cmp ax, dx
jae 0x407a49
mov word [0x4310d0], ax
jmp 0x407a4f
cmp cx, dx
jae 0x407a4f
mov word [0x4310cc], cx
jmp 0x407a4f
cmp dword [ebp - 0x1008], 2
jne 0x41e427
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 0x41e418
push esi
mov edx, 0x800
lea ecx, [ebp - 0x1004]
call fcn.0040dfe0
jmp 0x41e421
xor eax, eax
mov word [ebp - 0x1004], ax
mov esi, dword [ebp - 0x1014]
cmp word [ebp - 0x1004], 0
je 0x407a89
lea ecx, [ebp - 0x1004]
call fcn.00409880
mov dword [edi], eax
jmp 0x407a89