Function at 0x50872d13
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2014
call fcn.508744f0
push ebx
push esi
push edi
lea eax, [ebp - 0x2014]
mov edi, ecx
xor esi, esi
push eax
mov dword [ebp - 0x14], edi
mov dword [ebp - 0xc], esi
call fcn.508723fb
cmp eax, esi
jl 0x50872f72
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x2014]
push eax
call fcn.50872fb6
test eax, eax
jne 0x50872d5f
mov eax, 0x80020009
jmp 0x50872f72
mov ecx, edi
call fcn.508723d3
lea eax, [ebp - 0x1014]
push eax
mov ecx, edi
call fcn.508723fb
cmp eax, esi
jl 0x50872f72
movzx eax, word [ebp - 0xc]
sub eax, 8
je 0x50872f2e
sub eax, 9
je 0x50872e91
dec eax
dec eax
je 0x50872e33
sub eax, 0x3ff5
jne 0x50872f61
lea eax, [ebp - 0x1014]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 3
and eax, 0xfffffffc
call fcn.508744f0
mov edi, esp
cmp edi, esi
mov dword [ebp - 4], edi
je 0x50872e2b
cmp byte [ebp - 0x1014], 0
lea esi, [ebp - 0x1014]
je 0x50872e13
mov ebx, dword [sym.imp.USER32.dll_CharNextA]
push esi
call ebx
mov cl, byte [esi]
cmp cl, 0x5c
jne 0x50872df5
cmp byte [eax], 0x30
jne 0x50872df5
and byte [edi], 0
push eax
inc edi
call ebx
mov esi, eax
jmp 0x50872e0e
xor eax, eax
mov byte [edi], cl
mov al, byte [esi]
push eax
call dword [sym.imp.KERNEL32.dll_IsDBCSLeadByte]
test eax, eax
je 0x50872e0c
inc edi
inc esi
mov al, byte [esi]
mov byte [edi], al
inc edi
inc esi
cmp byte [esi], 0
jne 0x50872ddb
push dword [ebp - 4]
mov ecx, dword [ebp + 8]
push dword [ebp + 0xc]
and byte [edi], 0
call fcn.50872f7f
xor esi, esi
jmp 0x50872f55
push 0xe
pop eax
jmp 0x50872f55
lea eax, [ebp - 0x1014]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, eax
inc edi
lea eax, [edi + edi]
add eax, 3
and eax, 0xfffffffc
call fcn.508744f0
mov ebx, esp
cmp ebx, esi
jne 0x50872e5b
xor ebx, ebx
jmp 0x50872e71
push edi
push ebx
push 0xffffffffffffffff
lea eax, [ebp - 0x1014]
push eax
push esi
push esi
mov word [ebx], si
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [ebp - 0x10]
push eax
push esi
push esi
push ebx
call dword [sym.imp.OLEAUT32.dll_VarUI4FromDisp]
mov eax, dword [ebp - 0x10]
mov dword [ebp - 4], eax
push 4
lea eax, [ebp - 4]
push eax
push 4
jmp 0x50872f46
lea eax, [ebp - 0x1014]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test al, 1
mov dword [ebp - 4], eax
jne 0x50872ed4
cdq
sub eax, edx
mov ebx, eax
sar ebx, 1
mov eax, ebx
add eax, 3
and eax, 0xfffffffc
call fcn.508744f0
mov ecx, ebx
mov edx, ecx
shr ecx, 2
mov edi, esp
xor eax, eax
mov dword [ebp - 8], edi
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
cmp esp, esi
rep stosb byte es:[edi], al
jne 0x50872ede
mov eax, 0x80004005
jmp 0x50872f72
xor edi, edi
cmp dword [ebp - 4], esi
jle 0x50872f1c
mov ecx, dword [ebp - 8]
mov eax, edi
cdq
sub eax, edx
sar eax, 1
lea esi, [eax + ecx]
xor eax, eax
mov al, byte [ebp + edi - 0x1014]
push eax
call fcn.5087304a
mov ecx, edi
and ecx, 1
shl ecx, 2
mov edx, ecx
push 4
pop ecx
sub ecx, edx
shl al, cl
or byte [esi], al
inc edi
cmp edi, dword [ebp - 4]
jl 0x50872ee5
xor esi, esi
mov eax, dword [ebp + 8]
mov eax, dword [eax]
push ebx
push dword [ebp - 8]
push 3
push esi
push dword [ebp + 0xc]
push eax
jmp 0x50872f4f
lea eax, [ebp - 0x1014]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
inc eax
push eax
lea eax, [ebp - 0x1014]
push eax
push 1
mov eax, dword [ebp + 8]
push esi
push dword [ebp + 0xc]
push dword [eax]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
cmp eax, esi
je 0x50872f61
push eax
call fcn.50872cb2
jmp 0x50872f72
push dword [ebp + 0x10]
mov ecx, dword [ebp - 0x14]
call fcn.508723fb
cmp eax, esi
jl 0x50872f72
xor eax, eax
lea esp, [ebp - 0x2020]
pop edi
pop esi
pop ebx
leave
ret 0xc