Function at 0x405f90
Capabilities:
Persist via appinit_dlls registry key
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51f0c6
mov eax, dword fs:[0]
push eax
mov eax, 0x13b0
call fcn.004fecb0
mov eax, dword [0x5673f0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push 0x13a0
lea eax, [ebp - 0x13b0]
push 0
push eax
mov dword [ebp - 0x13bc], 0x13a0
call fcn.004fc760
add esp, 0xc
lea ecx, [ebp - 0x13b4]
push ecx
push 0xf003f
push 0
push str.SoftwareMicrosoftWindows_NTCurrentVersionWindows
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x40601b
push 0x10
push 0x548e34
push str.RegOpenKeyEx___error
mov ecx, ebx
call fcn.00409a7b
jmp 0x4062d8
cmp byte [ebx + 0x438], 0
jne 0x4061bf
mov ecx, dword [ebp - 0x13b4]
lea edx, [ebp - 0x13bc]
push edx
lea eax, [ebp - 0x13b0]
push eax
push 0
push 0
push str.AppInit_DLLs
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x40619e
push eax
push eax
lea edx, [ebp - 0x13b0]
push edx
mov ecx, ebx
call fcn.00409a7b
lea edi, [ebp - 0x13b0]
dec edi
jmp 0x406070
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x406070
mov ax, word [0x549d94]
mov word [edi], ax
mov eax, dword [ebx + 0x548]
mov ecx, eax
lea esp, [esp]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x406090
lea edi, [ebp - 0x13b0]
sub eax, ecx
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4060a2
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
lea eax, [ebp - 0x13b0]
rep movsb byte es:[edi], byte [esi]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4060c1
sub eax, edx
mov edx, dword [ebp - 0x13b4]
push eax
lea ecx, [ebp - 0x13b0]
push ecx
push 1
push 0
push str.AppInit_DLLs
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
je 0x40619e
call fcn.004108ca
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40610a
push 0x80004005
call fcn.00401a00
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [ebp - 0x13b8], esi
mov dword [ebp - 4], 0
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
jne 0x406139
push 0x10
push eax
push 0x549d98
jmp 0x40615e
call edi
push eax
lea ecx, [ebp - 0x13b8]
push 0x549e00
push ecx
call fcn.00401ad0
mov esi, dword [ebp - 0x13b8]
add esp, 0xc
push 0x10
push 0x548e34
push esi
mov ecx, ebx
call fcn.00409a7b
mov edx, dword [ebp - 0x13b4]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [esi - 0x10]
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4062d8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x4062d8
push 0x549e60
push 1
mov ecx, ebx
call fcn.0040dfa7
mov ecx, eax
call fcn.0040e0bd
mov byte [ebx + 0x438], 1
jmp 0x4062cb
mov eax, dword [ebp - 0x13b4]
lea ecx, [ebp - 0x13bc]
push ecx
lea edx, [ebp - 0x13b0]
push edx
push 0
push 0
push str.AppInit_DLLs
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x4062af
mov eax, dword [ebx + 0x548]
push eax
lea ecx, [ebp - 0x13b0]
push ecx
call fcn.004fb220
add esp, 8
test eax, eax
je 0x4062af
mov byte [eax - 1], 0
lea eax, [ebp - 0x13b0]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406216
sub eax, edx
push eax
mov eax, dword [ebp - 0x13b4]
lea edx, [ebp - 0x13b0]
push edx
push 1
push 0
push str.AppInit_DLLs
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
je 0x4062af
lea ecx, [ebp - 0x13b8]
call fcn.00401820
mov dword [ebp - 4], 1
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
test eax, eax
jne 0x406269
push 0x10
push eax
push 0x549d98
jmp 0x40628e
call esi
push eax
lea ecx, [ebp - 0x13b8]
push 0x549e00
push ecx
call fcn.00401ad0
mov edx, dword [ebp - 0x13b8]
add esp, 0xc
push 0x10
push 0x548e34
push edx
mov ecx, ebx
call fcn.00409a7b
mov eax, dword [ebp - 0x13b4]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea ecx, [ebp - 0x13b8]
call fcn.00401850
jmp 0x4062d8
push 0x549c88
push 1
mov ecx, ebx
call fcn.0040dfa7
mov ecx, eax
call fcn.0040e0bd
mov byte [ebx + 0x438], 0
mov ecx, dword [ebp - 0x13b4]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004fa984
mov esp, ebp
pop ebp
ret