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

Disassembly:
sub esp, 0x24
mov eax, dword [0x45e068]
xor eax, esp
mov dword [esp + 0x20], eax
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
push ebx
push ebp
mov ebp, dword [esp + 0x34]
mov ebx, ecx
mov dword [esp + 0x14], ebp
mov dword [esp + 8], edx
mov dword [esp + 0x10], eax
push esi
mov esi, dword [esp + 0x3c]
push edi
mov edi, dword [esp + 0x38]
test ebp, ebp
je 0x411fb5
xor eax, eax
cmp word [ebp], ax
cmove ebp, eax
mov dword [esp + 0x1c], ebp
test edx, edx
je 0x411fc2
mov eax, dword [esi + 0x20]
mov dword [esp + 0x14], eax
jmp 0x411ffe
lea eax, [esp + 0x10]
push eax
push 0
lea eax, [esp + 0x1c]
push eax
push 0
push ebp
push edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x411ff3
mov ecx, dword [esp + 0x18]
push 0
push dword [ebx + 4]
push eax
call fcn.00414ca0
test al, al
je 0x4121f6
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov dword [esi + 0x20], eax
cmp eax, 1
je 0x412019
cmp eax, 2
je 0x412019
cmp eax, 7
je 0x412019
xor bl, bl
test edx, edx
je 0x412100
jmp 0x412028
mov bl, 1
test edx, edx
jne 0x412028
mov edx, 2
mov dword [esp + 0x10], edx
test bl, bl
je 0x41203a
mov eax, edx
add edx, 2
and eax, 1
add edx, eax
mov dword [esp + 0x10], edx
push edx
mov ecx, esi
call fcn.00409190
test al, al
je 0x4121f6
lea eax, [esp + 0x10]
push eax
push dword [esi + 0x28]
push 0
push 0
push ebp
push edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x41209f
cmp eax, 0xea
jne 0x4121f6
cmp edi, 0x80000004
je 0x412083
cmp edi, 0x80000050
je 0x412083
mov edx, dword [esp + 0x10]
jmp 0x412099
mov edx, dword [esp + 0x10]
cmp edx, 0x100000
jae 0x4121f6
add edx, edx
mov dword [esp + 0x10], edx
test edx, edx
jne 0x412028
jmp 0x4120fc
mov edx, dword [esp + 0x10]
test bl, bl
je 0x4120fc
mov eax, dword [esi + 0x28]
cmp word [eax + edx - 2], 0
je 0x4120fc
lea ebp, [edx + 2]
cmp ebp, 0x10
jbe 0x4120f0
push ebp
mov ecx, esi
call fcn.00409190
test al, al
je 0x4121f6
mov eax, dword [esp + 0x10]
mov dword [esp + 0x18], eax
lea eax, [esp + 0x18]
push eax
push dword [esi + 0x28]
push 0
push 0
push dword [esp + 0x2c]
push edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov eax, dword [esi + 0x28]
mov edx, dword [esp + 0x10]
xor ecx, ecx
mov word [edx + eax], cx
mov edx, ebp
mov dword [esp + 0x10], edx
mov eax, dword [esp + 0x14]
mov dword [esi + 0x1c], edx
test edx, edx
je 0x412283
test bl, bl
je 0x412283
cmp eax, 7
jne 0x41218b
mov esi, dword [esi + 0x28]
shr edx, 1
dec edx
test esi, esi
je 0x412283
test edx, edx
je 0x412283
cmp edx, 3
jb 0x412283
lea edx, [esi + edx*2]
cmp esi, edx
jae 0x412283
lea ebx, [eax + 3]
test esi, esi
je 0x412161
mov eax, esi
lea edi, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x412150
sub eax, edi
sar eax, 1
jmp 0x412163
xor eax, eax
lea esi, [esi + eax*2]
cmp esi, edx
jae 0x41216d
mov word [esi], bx
add esi, 2
cmp esi, edx
jb 0x412145
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
mov ecx, dword [esp + 0x20]
xor ecx, esp
call fcn.00420bdf
add esp, 0x24
ret 0x18
cmp eax, 2
jne 0x412283
test byte [esp + 0x4c], 1
jne 0x412283
mov ebx, dword [esi + 0x28]
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov dword [esp + 0x18], eax
lea edi, [eax + eax]
cmp edi, 0x10
jbe 0x41220d
push edi
call fcn.00426f66
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x412213
mov edx, dword [0x4e23f4]
mov ecx, dword fs:[0x2c]
mov ecx, dword [ecx + edx*4]
mov ecx, dword [ecx + 8]
test ecx, ecx
je 0x4121f2
mov ecx, dword [ecx + 0x104]
test ecx, ecx
je 0x4121f2
mov eax, dword [ecx]
push edi
call dword [eax + 0x14]
test ebp, ebp
jne 0x412213
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x20]
xor ecx, esp
call fcn.00420bdf
add esp, 0x24
ret 0x18
lea ebp, [esp + 0x20]
jmp 0x412217
mov eax, dword [esp + 0x18]
push eax
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ecx, dword [esi + 0x28]
lea ebx, [esi + 0x2c]
cmp ecx, ebx
je 0x41223f
mov eax, dword [esi + 0x14]
shr eax, 0xa
not al
test al, 1
je 0x41223f
push ecx
call fcn.00426f61
add esp, 4
mov dword [esi + 0x1c], 0
mov dword [esi + 0x28], ebx
mov dword [ebx], 0
cmp edi, 0x10
jbe 0x412271
mov dword [esi + 0x1c], edi
mov al, 1
pop edi
mov dword [esi + 0x28], ebp
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x20]
xor ecx, esp
call fcn.00420bdf
add esp, 0x24
ret 0x18
push edi
lea eax, [esp + 0x24]
push eax
push ebx
call fcn.00422b90
add esp, 0xc
mov dword [esi + 0x1c], edi
mov ecx, dword [esp + 0x30]
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00420bdf
add esp, 0x24
ret 0x18