Function at 0x406687
Capabilities:
Set registry value

Disassembly:
mov eax, 0x210c
call fcn.0041e6c0
push ebx
push ebp
lea eax, [esp + 0x114]
mov ebp, ecx
xor ebx, ebx
push eax
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], ebx
call fcn.00406d8a
test eax, eax
js 0x4069cd
lea edx, [esp + 8]
lea ecx, [esp + 0x114]
call fcn.00406598
test eax, eax
jne 0x4066d2
mov eax, 0x80020009
jmp 0x4069cd
mov ecx, ebp
call fcn.00407429
lea eax, [esp + 0x114]
push eax
mov ecx, ebp
call fcn.00406d8a
test eax, eax
js 0x4069cd
movzx eax, word [esp + 8]
push esi
push edi
sub eax, 8
je 0x406963
sub eax, 9
je 0x406831
dec eax
dec eax
je 0x406806
sub eax, 0x3ff5
jne 0x4069b4
lea ecx, [esp + 0x11c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x406726
sub ecx, edx
sar ecx, 1
add ecx, 2
xor eax, eax
shld eax, ecx, 1
add ecx, ecx
mov dword [esp + 0x18], ebx
cmp eax, ebx
ja 0x4069d8
cmp ecx, 0xffffffff
ja 0x4069d8
cmp ecx, 0x100
jbe 0x40676d
push ecx
lea ecx, [esp + 0x1c]
call fcn.0040609c
mov esi, dword [esp + 0x18]
jmp 0x406775
lea esi, [esp + 0x1c]
mov dword [esp + 0x18], esi
test esi, esi
je 0x4067e9
lea edi, [esp + 0x11c]
cmp word [esp + 0x11c], bx
je 0x4067c6
mov ebx, dword [sym.imp.USER32.dll_CharNextW]
push 0x30
pop ebp
push edi
call ebx
movzx ecx, word [edi]
cmp ecx, 0x5c
jne 0x4067b2
cmp word [eax], bp
jne 0x4067b2
xor ecx, ecx
mov word [esi], cx
push eax
add esi, 2
call ebx
mov edi, eax
jmp 0x4067bb
mov word [esi], cx
add esi, 2
add edi, 2
xor eax, eax
cmp word [edi], ax
jne 0x406793
mov ebp, dword [esp + 0x14]
mov ecx, dword [esp + 0x2120]
xor eax, eax
mov dword [esi], eax
push dword [esp + 0x18]
push dword [esp + 0x2128]
call fcn.0040662e
mov esi, dword [esp + 0x18]
mov edi, eax
jmp 0x4067ec
push 0xe
pop edi
lea eax, [esp + 0x1c]
cmp esi, eax
je 0x4069a7
lea ecx, [esp + 0x18]
call fcn.00406093
jmp 0x4069a7
lea eax, [esp + 0x14]
push eax
push ebx
push ebx
lea eax, [esp + 0x128]
push eax
call dword [sym.imp.OLEAUT32.dll_VarUI4FromDisp]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], eax
push 4
lea eax, [esp + 0x14]
push eax
push 4
jmp 0x40698e
lea ebx, [esp + 0x11c]
xor edx, edx
lea ecx, [ebx + 2]
mov ax, word [ebx]
add ebx, 2
cmp ax, dx
jne 0x40683d
sub ebx, ecx
sar ebx, 1
test bl, 1
jne 0x4068a8
mov eax, ebx
cdq
sub eax, edx
mov esi, eax
xor ecx, ecx
sar esi, 1
mov dword [esp + 0x18], ecx
cmp ecx, ecx
ja 0x4069d8
cmp esi, 0xffffffff
ja 0x4069d8
cmp esi, 0x100
jbe 0x40688b
push esi
lea ecx, [esp + 0x1c]
call fcn.0040609c
mov eax, dword [esp + 0x18]
xor ecx, ecx
jmp 0x406893
lea eax, [esp + 0x1c]
mov dword [esp + 0x18], eax
test eax, eax
jne 0x4068b2
lea eax, [esp + 0x1c]
test eax, eax
je 0x4068a8
lea ecx, [esp + 0x18]
call fcn.00406093
mov eax, 0x80004005
jmp 0x4069cb
push esi
push ecx
push eax
call fcn.004127f0
xor ecx, ecx
add esp, 0xc
mov edi, ecx
test ebx, ebx
jle 0x40692e
push 0x30
pop ebp
mov eax, edi
cdq
sub eax, edx
movzx edx, word [esp + edi*2 + 0x11c]
sar eax, 1
add eax, dword [esp + 0x18]
mov dword [esp + 0x10], eax
mov eax, edx
cmp eax, ebp
jl 0x40690b
cmp eax, 0x39
jle 0x406906
cmp eax, 0x40
jle 0x40690b
cmp eax, 0x46
jle 0x406901
add eax, 0xffffff9f
cmp eax, 5
ja 0x40690b
sub dl, 0x57
jmp 0x40690d
sub dl, 0x37
jmp 0x40690d
sub dl, 0x30
jmp 0x40690d
mov dl, cl
mov eax, edi
and eax, 1
push 4
shl eax, 2
pop ecx
sub ecx, eax
mov eax, dword [esp + 0x10]
shl dl, cl
push 0
pop ecx
or byte [eax], dl
inc edi
cmp edi, ebx
jl 0x4068c8
mov ebp, dword [esp + 0x14]
mov eax, dword [esp + 0x2120]
push esi
push dword [esp + 0x1c]
push 3
push ecx
push dword [esp + 0x2134]
push dword [eax]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
lea eax, [esp + 0x1c]
cmp dword [esp + 0x18], eax
je 0x4069a7
lea ecx, [esp + 0x18]
call fcn.00406093
jmp 0x4069a7
lea ecx, [esp + 0x11c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x40696d
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
lea eax, [esp + 0x120]
push eax
push 1
mov eax, dword [esp + 0x212c]
push ebx
push dword [esp + 0x2134]
push dword [eax]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
test edi, edi
je 0x4069b4
mov ecx, edi
call fcn.00406d7c
jmp 0x4069cb
push dword [esp + 0x2128]
mov ecx, ebp
call fcn.00406d8a
xor ecx, ecx
test eax, eax
cmovs ecx, eax
mov eax, ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x210c
ret 0xc
push 0x80070216
call fcn.004069e3
int3