Function at 0x521330
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2120
call fcn.0053a250
mov eax, dword [0x5b46a4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x2120], eax
xor eax, eax
push esi
mov esi, dword [ebp + 0xc]
push edi
mov dword [ebp - 0x210c], eax
mov edi, ecx
lea eax, [ebp - 0x2004]
mov dword [ebp - 0x211c], edi
push eax
mov dword [ebp - 0x2114], ebx
mov dword [ebp - 0x2110], esi
call fcn.00521e5e
test eax, eax
js 0x52164f
lea eax, [ebp - 0x210c]
push eax
lea eax, [ebp - 0x2004]
push eax
call fcn.005233d1
pop ecx
pop ecx
test eax, eax
jne 0x5213ac
mov eax, 0x80020009
jmp 0x52164f
mov ecx, edi
call fcn.00522e34
lea eax, [ebp - 0x2004]
mov ecx, edi
push eax
call fcn.00521e5e
test eax, eax
js 0x52164f
movzx eax, word [ebp - 0x210c]
sub eax, 8
je 0x521613
sub eax, 9
je 0x521504
dec eax
sub eax, 1
je 0x5214be
sub eax, 0x3ff5
jne 0x521639
lea ecx, [ebp - 0x2004]
xor esi, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, si
jne 0x521402
sub ecx, edx
mov dword [ebp - 0x2108], esi
sar ecx, 1
lea eax, [ecx + 2]
push eax
lea ecx, [ebp - 0x2108]
call fcn.00521691
mov esi, dword [ebp - 0x2108]
test esi, esi
je 0x52149d
cmp word [ebp - 0x2004], 0
lea edi, [ebp - 0x2004]
je 0x52147c
mov ebx, dword [sym.imp.USER32.dll_CharNextW]
push edi
call ebx
movzx ecx, word [edi]
cmp ecx, 0x5c
jne 0x521466
cmp word [eax], 0x30
jne 0x521466
xor ecx, ecx
mov word [esi], cx
add esi, 2
push eax
call ebx
mov edi, eax
jmp 0x52146f
mov word [esi], cx
add esi, 2
add edi, 2
xor eax, eax
cmp word [edi], ax
jne 0x521446
mov ebx, dword [ebp - 0x2114]
xor eax, eax
mov ecx, ebx
mov dword [esi], eax
push dword [ebp - 0x2108]
push dword [ebp - 0x2110]
call fcn.00522d26
mov esi, dword [ebp - 0x2108]
mov edi, eax
jmp 0x5214a0
push 0xe
pop edi
lea eax, [ebp - 0x2104]
cmp esi, eax
je 0x521626
lea ecx, [ebp - 0x2108]
call fcn.00521be9
jmp 0x521626
lea eax, [ebp - 0x2114]
xor edi, edi
push eax
push edi
push edi
lea eax, [ebp - 0x2004]
push eax
call dword [sym.imp.OLEAUT32.dll_VarUI4FromDisp]
test eax, eax
js 0x52164f
mov eax, dword [ebp - 0x2114]
push 4
mov dword [ebp - 0x2110], eax
lea eax, [ebp - 0x2110]
push eax
push 4
push edi
push esi
push dword [ebx]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
jmp 0x521624
lea ebx, [ebp - 0x2004]
xor edi, edi
lea ecx, [ebx + 2]
mov ax, word [ebx]
add ebx, 2
cmp ax, di
jne 0x52150f
sub ebx, ecx
sar ebx, 1
test bl, 1
je 0x52152d
mov eax, 0x80004005
jmp 0x52164f
mov eax, ebx
mov dword [ebp - 0x2108], edi
cdq
lea ecx, [ebp - 0x2108]
sub eax, edx
mov esi, eax
sar esi, 1
push esi
mov dword [ebp - 0x2118], esi
call fcn.00521662
cmp dword [ebp - 0x2108], edi
jne 0x52156d
lea eax, [ebp - 0x2104]
test eax, eax
je 0x521523
lea ecx, [ebp - 0x2108]
call fcn.00521be9
jmp 0x521523
push esi
push edi
push dword [ebp - 0x2108]
call fcn.0053bcd0
add esp, 0xc
mov eax, edi
mov dword [ebp - 0x210c], eax
test ebx, ebx
jle 0x5215d8
mov edi, eax
test edi, edi
jns 0x521592
add edi, 1
sar edi, 1
movzx eax, word [ebp + eax*2 - 0x2004]
mov esi, dword [ebp - 0x2108]
push eax
call fcn.005219a1
mov edx, dword [ebp - 0x210c]
pop ecx
and edx, 1
shl edx, 2
push 4
pop ecx
sub ecx, edx
shl al, cl
or byte [edi + esi], al
mov eax, dword [ebp - 0x210c]
inc eax
mov dword [ebp - 0x210c], eax
cmp eax, ebx
jl 0x521589
mov esi, dword [ebp - 0x2118]
xor edi, edi
mov eax, dword [ebp - 0x2114]
push esi
push dword [ebp - 0x2108]
push 3
push edi
push dword [ebp - 0x2110]
push dword [eax]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
lea eax, [ebp - 0x2104]
cmp dword [ebp - 0x2108], eax
je 0x521626
lea ecx, [ebp - 0x2108]
call fcn.00521be9
jmp 0x521626
push 1
lea eax, [ebp - 0x2004]
mov ecx, ebx
push eax
push esi
call fcn.00522d84
mov edi, eax
test edi, edi
je 0x521633
push edi
call fcn.005218b5
pop ecx
jmp 0x52164f
mov edi, dword [ebp - 0x211c]
push dword [ebp - 0x2120]
mov ecx, edi
call fcn.00521e5e
xor ecx, ecx
test eax, eax
cmovs ecx, eax
mov eax, ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0053a230
mov esp, ebp
pop ebp
ret 0xc