Function at 0x4022a0
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc
push ebx
push esi
push edi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, dword [0x419058]
cmp eax, 0x419058
je 0x4022e4
test byte [eax + 0x1c], 8
je 0x4022e4
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0x10]
push 0x414d50
push 0xa
push ecx
push edx
mov esi, str.RegWriteBinaryValue
call fcn.00401c60
add esp, 0x10
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor esi, esi
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], esi
mov eax, dword [0x419058]
cmp eax, 0x419058
je 0x402320
test byte [eax + 0x1c], 4
je 0x402320
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0x10]
push 0x414d40
push 0x28
push ecx
push edx
mov edx, ebx
call fcn.00401b70
add esp, 0x10
lea eax, [esp + 0x14]
push eax
push 0xf003f
push esi
push ebx
push SysStringLen
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
cmp eax, esi
je 0x40239c
jle 0x402347
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
cmp edi, esi
jge 0x402364
mov eax, dword [0x419058]
cmp eax, 0x419058
je 0x402393
test byte [eax + 0x1c], 2
je 0x402393
push edi
push 0xd
jmp 0x402379
mov eax, dword [0x419058]
cmp eax, 0x419058
je 0x402393
test byte [eax + 0x1c], 4
je 0x402393
push edi
push 0xe
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0x10]
push ecx
push edx
mov edx, str.RegOpenKeyEx_FAILED.
call fcn.00401be0
mov eax, dword [0x419058]
add esp, 0x10
cmp edi, esi
jge 0x4023a1
jmp 0x40244b
mov eax, dword [0x419058]
cmp eax, 0x419058
je 0x4023c8
test byte [eax + 0x1c], 4
je 0x4023c8
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0x10]
push 0x414d40
push 0x29
push ecx
push edx
mov edx, dword [ebp + 8]
call fcn.00401b70
add esp, 0x10
mov ecx, dword [ebp + 8]
mov edx, dword [esp + 0x14]
push esi
lea eax, [esp + 0x14]
push eax
push esi
push 0x2001f
push esi
push 0x415108
push esi
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
cmp eax, esi
je 0x40240c
jle 0x4023fa
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
mov ecx, edi
mov edx, str.RegCreateKeyEx_FAILED.
call fcn.00401d80
cmp edi, esi
jl 0x40244b
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
mov edx, dword [esp + 0x10]
push eax
push ecx
push 3
push esi
push str.Blob
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
cmp eax, esi
je 0x402449
jle 0x402437
and eax, 0xffff
or eax, 0x80070000
mov edi, eax
mov ecx, edi
mov edx, str.RegSetValueEx_FAILED.
call fcn.00401d80
cmp edi, esi
jl 0x40244b
xor edi, edi
mov eax, dword [esp + 0x10]
cmp eax, esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
je 0x402464
push eax
call esi
mov dword [esp + 0x10], 0
mov eax, dword [esp + 0x14]
test eax, eax
je 0x402477
push eax
call esi
mov dword [esp + 0x14], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov eax, dword [0x419058]
cmp eax, 0x419058
je 0x4024ad
test byte [eax + 0x1c], 8
je 0x4024ad
mov ecx, dword [eax + 0x14]
mov edx, dword [eax + 0x10]
push 0x414d50
push 0xb
push ecx
push edx
mov esi, str.RegWriteBinaryValue
call fcn.00401c60
add esp, 0x10
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret