Function at 0x405959
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4b7457
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x2120
call fcn.00497500
mov eax, dword [0x5002b0]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
and dword [ebp - 0x211c], 0
mov dword [ebp - 0x212c], eax
lea eax, [ebp - 0x2014]
mov ebx, ecx
push eax
mov dword [ebp - 0x2130], ebx
mov dword [ebp - 0x2124], esi
mov dword [ebp - 0x2120], edi
call fcn.00404dea
test eax, eax
js 0x405c86
lea eax, [ebp - 0x211c]
push eax
lea eax, [ebp - 0x2014]
push eax
call fcn.00404c7b
pop ecx
pop ecx
test eax, eax
jne 0x4059f0
mov eax, 0x80020009
jmp 0x405c86
mov ecx, ebx
call fcn.00404dc8
lea eax, [ebp - 0x2014]
push eax
mov ecx, ebx
call fcn.00404dea
xor ebx, ebx
cmp eax, ebx
jl 0x405c86
movzx eax, word [ebp - 0x211c]
sub eax, 8
je 0x405c4d
sub eax, 9
je 0x405b3e
dec eax
dec eax
je 0x405b02
sub eax, 0x3ff5
jne 0x405c6f
lea eax, [ebp - 0x2014]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrlenW]
add eax, 2
mov dword [ebp - 0x2118], ebx
mov dword [ebp - 4], ebx
push eax
lea ecx, [ebp - 0x2118]
mov byte [ebp - 4], 1
call fcn.0040566d
mov esi, dword [ebp - 0x2118]
test esi, esi
je 0x405add
cmp word [ebp - 0x2014], 0
lea edi, [ebp - 0x2014]
je 0x405ab9
mov ebx, dword [sym.imp.USER32.dll_CharNextW]
push edi
call ebx
movzx ecx, word [edi]
cmp ecx, 0x5c
jne 0x405aaa
cmp word [eax], 0x30
jne 0x405aaa
xor ecx, ecx
mov word [esi], cx
push eax
add esi, 2
call ebx
mov edi, eax
jmp 0x405ab3
mov word [esi], cx
add esi, 2
add edi, 2
cmp word [edi], 0
jne 0x405a84
mov ecx, dword [ebp - 0x2124]
xor eax, eax
mov word [esi], ax
mov word [esi + 2], ax
push dword [ebp - 0x2118]
push dword [ebp - 0x2120]
call fcn.00404b4a
mov esi, eax
jmp 0x405ae0
push 0xe
pop esi
lea eax, [ebp - 0x2114]
cmp dword [ebp - 0x2118], eax
je 0x405c60
lea ecx, [ebp - 0x2118]
call fcn.00405038
jmp 0x405c60
lea eax, [ebp - 0x2120]
push eax
push ebx
push ebx
lea eax, [ebp - 0x2014]
push eax
call dword [sym.imp.OLEAUT32.dll_VarUI4FromDisp]
mov eax, dword [ebp - 0x2120]
push 4
mov dword [ebp - 0x211c], eax
lea eax, [ebp - 0x211c]
push eax
push 4
push ebx
push edi
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
jmp 0x405c5e
lea eax, [ebp - 0x2014]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrlenW]
mov dword [ebp - 0x211c], eax
test al, 1
je 0x405b5f
mov eax, 0x80004005
jmp 0x405c86
and dword [ebp - 0x2118], 0
cdq
sub eax, edx
mov ebx, eax
sar ebx, 1
mov dword [ebp - 0x2128], ebx
mov dword [ebp - 4], 3
push ebx
lea ecx, [ebp - 0x2118]
mov byte [ebp - 4], 4
call fcn.0040569c
jmp 0x405b9e
xor edi, edi
cmp dword [ebp - 0x2118], edi
jne 0x405bbf
lea eax, [ebp - 0x2114]
test eax, eax
je 0x405b55
lea ecx, [ebp - 0x2118]
call fcn.00405038
jmp 0x405b55
push ebx
push edi
push dword [ebp - 0x2118]
call fcn.00495b20
add esp, 0xc
cmp dword [ebp - 0x211c], edi
jle 0x405c16
mov ecx, dword [ebp - 0x2118]
mov eax, edi
cdq
sub eax, edx
sar eax, 1
lea esi, [eax + ecx]
movzx eax, word [ebp + edi*2 - 0x2014]
push eax
call fcn.00404d11
pop ecx
mov edx, edi
and edx, 1
shl edx, 2
push 4
pop ecx
sub ecx, edx
shl al, cl
or byte [esi], al
inc edi
cmp edi, dword [ebp - 0x211c]
jl 0x405bd7
mov esi, dword [ebp - 0x2124]
mov esi, dword [esi]
push ebx
push dword [ebp - 0x2118]
push 3
push 0
push dword [ebp - 0x2120]
push esi
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov esi, eax
lea eax, [ebp - 0x2114]
cmp dword [ebp - 0x2118], eax
je 0x405c60
lea ecx, [ebp - 0x2118]
call fcn.00405038
jmp 0x405c60
push 1
lea eax, [ebp - 0x2014]
push eax
push edi
mov ecx, esi
call fcn.00404b13
mov esi, eax
xor ebx, ebx
cmp esi, ebx
je 0x405c6f
push esi
call fcn.004047f3
pop ecx
jmp 0x405c86
push dword [ebp - 0x212c]
mov ecx, dword [ebp - 0x2130]
call fcn.00404dea
cmp eax, ebx
jl 0x405c86
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004959f8
leave
ret 0xc