Function at 0x505010
Capabilities:
Delete registry value
Read .ini file
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x524096
mov eax, dword fs:[0]
push eax
sub esp, 0x244
mov eax, dword [0x53120c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
call fcn.005048a0
mov ecx, eax
test ecx, ecx
je 0x5054cb
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x224], eax
xor ebx, ebx
mov dword [ebp - 4], 0
mov dword [ebp - 0x23c], ebx
mov dword [ebp - 0x238], ebx
mov dword [ebp - 0x234], ebx
push 0x531e28
lea ecx, [ebp - 0x244]
mov byte [ebp - 4], 1
call fcn.00504cf0
push str.VESModule.ini
lea ecx, [ebp - 0x244]
mov byte [ebp - 4], 2
call fcn.00504e60
lea eax, [ebp - 0x21c]
mov dword [ebp - 0x21c], ebx
push eax
push 0x2001f
push ebx
push str.SOFTWAREVAIO_CorporationVAIO_Control_CenterModules
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x5050d9
mov ebx, dword [ebp - 0x21c]
mov dword [ebp - 0x23c], ebx
mov dword [ebp - 0x238], eax
jmp 0x5050de
cmp eax, 2
je 0x5050ea
push str.Modules
push ebx
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
mov edi, dword [ebp - 0x244]
mov dword [ebp - str.01919BA5_25F8_408E_9909_37039607E9A4], 0x531060
nop word [eax + eax]
push 0x36
push str.SOFTWAREVAIO_CorporationVAIO_Control_CenterModules_
lea ecx, [ebp - 0x224]
call fcn.00504b10
mov eax, dword [ebp - 0x228]
mov edx, dword [eax]
mov dword [ebp - 0x240], edx
test edx, edx
jne 0x50514b
mov esi, dword [ebp - 0x224]
mov eax, edx
sub eax, esi
sar eax, 1
mov dword [ebp - 0x220], eax
xor eax, eax
mov ecx, dword [esi - 0xc]
mov edx, ecx
mov dword [ebp - 0x230], ecx
mov dword [ebp - 0x22c], edx
jmp 0x5051a2
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x505150
sub ecx, esi
mov eax, edx
mov esi, dword [ebp - 0x224]
sub eax, esi
sar eax, 1
sar ecx, 1
mov dword [ebp - 0x220], eax
mov eax, dword [esi - 0xc]
mov dword [ebp - 0x230], eax
mov dword [ebp - 0x22c], eax
js 0x5054c1
push ecx
push edx
call fcn.00512b72
mov ecx, dword [ebp - 0x240]
add esp, 8
mov edx, dword [ebp - 0x22c]
mov dword [ebp - 0x240], ecx
mov ecx, SysReAllocString
mov dword [ebp - 0x21c], eax
sub ecx, eax
cmp ecx, dword [ebp - 0x230]
jl 0x5054c1
add edx, eax
js 0x5054c1
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edx
or eax, ecx
jge 0x5051e6
push edx
lea ecx, [ebp - 0x224]
call fcn.005049d0
mov esi, dword [ebp - 0x224]
mov eax, dword [ebp - 0x220]
mov ecx, dword [ebp - 0x22c]
cmp eax, ecx
lea eax, [esi + eax*2]
jbe 0x5051ff
mov eax, dword [ebp - 0x240]
mov edx, dword [ebp - 0x21c]
lea ecx, [esi + ecx*2]
add edx, edx
je 0x50523c
test ecx, ecx
je 0x50522c
push edx
test eax, eax
je 0x505221
push eax
push ecx
call fcn.00510350
add esp, 0xc
jmp 0x50523c
push 0
push ecx
call fcn.005108d0
add esp, 0xc
call fcn.005128b0
mov dword [eax], 0x16
call fcn.005127cf
mov eax, dword [ebp - 0x22c]
add eax, dword [ebp - 0x21c]
cmp eax, dword [esi - 8]
jg 0x5054c1
mov dword [esi - 0xc], eax
xor ecx, ecx
mov word [esi + eax*2], cx
mov eax, 0x5310a0
mov dword [ebp - 0x21c], eax
nop word [eax + eax]
push edi
push 0x104
lea ecx, [ebp - 0x218]
push ecx
push 0
push dword [eax]
mov eax, dword [ebp - 0x228]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [ebp - 0x24c]
mov dword [ebp - 0x220], 0
push eax
lea eax, [ebp - 0x220]
push eax
push 0
push 0xf023f
push 0
push 0
push 0
push esi
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x50534f
test ebx, ebx
je 0x5052d3
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ebx, dword [ebp - 0x220]
mov dword [ebp - 0x23c], ebx
mov dword [ebp - 0x238], 0x200
test eax, eax
jne 0x50534f
mov eax, dword [ebp - 0x21c]
mov edx, dword [eax]
lea eax, [ebp - 0x218]
lea ecx, [eax + 2]
mov dword [ebp - 0x220], ecx
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x505304
sub eax, dword [ebp - 0x220]
sar eax, 1
lea eax, [eax*2 + 2]
push eax
lea eax, [ebp - 0x218]
push eax
push 1
push 0
push edx
push ebx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test ebx, ebx
je 0x505345
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor ebx, ebx
mov dword [ebp - 0x23c], ebx
mov dword [ebp - 0x238], 0
mov eax, dword [ebp - 0x21c]
add eax, 4
mov dword [ebp - 0x21c], eax
cmp eax, 0x5310ac
jl 0x505270
mov eax, 0x5310ac
mov dword [ebp - 0x21c], eax
push edi
push 0
push dword [eax]
mov eax, dword [ebp - 0x228]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
mov dword [ebp - 0x230], eax
lea eax, [ebp - 0x250]
push eax
lea eax, [ebp - 0x220]
mov dword [ebp - 0x220], 0
push eax
push 0
push 0xf023f
push 0
push 0
push 0
push esi
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x50542c
test ebx, ebx
je 0x5053cd
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ebx, dword [ebp - 0x220]
mov dword [ebp - 0x23c], ebx
mov dword [ebp - 0x238], 0x200
test eax, eax
jne 0x50542c
mov eax, dword [ebp - 0x230]
push 4
mov dword [ebp - 0x248], eax
lea eax, [ebp - 0x248]
push eax
mov eax, dword [ebp - 0x21c]
push 4
push 0
push dword [eax]
push ebx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test ebx, ebx
je 0x505422
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor ebx, ebx
mov dword [ebp - 0x23c], ebx
mov dword [ebp - 0x238], 0
mov eax, dword [ebp - 0x21c]
add eax, 4
mov dword [ebp - 0x21c], eax
cmp eax, 0x5310bc
jl 0x505374
mov eax, dword [ebp - 0x228]
add eax, 4
mov dword [ebp - 0x228], eax
cmp eax, 0x5310a0
jl 0x505100
lea edx, [edi - 0x10]
mov byte [ebp - 4], 1
or edi, 0xffffffff
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x50547e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test ebx, ebx
je 0x505489
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], edi
dec edi
test edi, edi
jg 0x5054a5
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0050f225
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.005046e0
push 0x80004005
call fcn.005046e0
int3