Function at 0x403fa0
Capabilities:
Delete registry value
Persist via run registry key
Query or enumerate registry key
Query or enumerate registry value
Set registry value

Disassembly:
mov eax, 0x141c
call fcn.00405550
mov al, byte [0x408021]
push ebx
push ebp
push esi
cmp al, 0x32
mov esi, 1
je 0x4042fb
mov ebp, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea eax, [esp + 0xc]
push eax
push 2
push 0
push 0x408758
push 0x80000002
call ebp
test eax, eax
jne 0x40401d
mov ecx, dword [esp + 0xc]
push 0x408024
push ecx
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
test eax, eax
mov bl, 0x31
je 0x403ffe
cmp byte [0x408021], bl
jne 0x403ffe
xor esi, esi
mov edx, dword [esp + 0xc]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp byte [0x408021], bl
jne 0x404034
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x141c
ret
cmp byte [0x408021], 0x31
jne 0x404034
xor esi, esi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x141c
ret
lea eax, [esp + 0xc]
push eax
push 8
push 0
push 0x4086f8
push 0x80000002
call ebp
test eax, eax
jne 0x4042fb
push edi
mov edi, 0x408828
or ecx, 0xffffffff
mov dword [esp + 0x20], eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x82c]
mov eax, ecx
mov esi, edi
mov edi, edx
mov edx, dword [esp + 0x10]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0x400
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x430]
push ecx
push 0
push edx
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
jne 0x4042ef
mov ebx, dword [sym.imp.MSVCRT.dll_sprintf]
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x1c]
push eax
push 1
lea ecx, [esp + 0x434]
push 0
push ecx
push edx
call ebp
test eax, eax
jne 0x4042c5
lea eax, [esp + 0x24]
lea ecx, [esp + 0xc2c]
push eax
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x2c]
push ecx
push edx
push 0
push 0x408788
push eax
mov dword [esp + 0x3c], 0x400
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x4042ba
lea esi, [esp + 0x82c]
lea eax, [esp + 0xc2c]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40412b
test cl, cl
je 0x404127
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40412b
add eax, 2
add esi, 2
test cl, cl
jne 0x404107
xor eax, eax
jmp 0x404130
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jle 0x4042ba
lea eax, [esp + 0x42c]
lea ecx, [esp + 0x102c]
push eax
push 0x408718
push 0x408820
push ecx
call ebx
add esp, 0x10
lea edx, [esp + 0x14]
lea eax, [esp + 0x102c]
push edx
push 1
push 0
push eax
push 0x80000002
call ebp
test eax, eax
je 0x404191
lea ecx, [esp + 0x42c]
lea edx, [esp + 0x2c]
push ecx
push 0x409608
push 0x408810
push edx
call ebx
add esp, 0x10
jmp 0x4041fb
lea eax, [esp + 0x18]
lea ecx, [esp + 0x2c]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x2c]
push ecx
push edx
push 0
push 0x40874c
push eax
mov dword [esp + 0x30], 0x400
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x4041dc
lea ecx, [esp + 0x42c]
lea edx, [esp + 0x2c]
push ecx
push 0x409608
push 0x408810
push edx
call ebx
add esp, 0x10
jmp 0x4041f0
lea eax, [esp + 0x2c]
push 0x5c
push eax
call dword [sym.imp.MSVCRT.dll_strrchr]
add esp, 8
mov byte [eax + 1], 0
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, 0x4087a0
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x2c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x30]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.MSVCRT.dll__access]
add esp, 8
test eax, eax
jne 0x4042ba
lea edi, [esp + 0x2c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x18], ecx
lea ecx, [esp + 0x14]
push ecx
push 6
push eax
push 0x408758
push 0x80000002
call ebp
test eax, eax
jne 0x4042ba
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x2c]
push edx
push eax
push 1
push 0
push 0x408024
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
jne 0x4042af
lea edi, [esp + 0xc2c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x82c]
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x42c]
inc eax
push 0x400
push ecx
push eax
push edx
mov dword [esp + 0x30], eax
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
je 0x4040a5
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x141c
ret