Function at 0x401470
Capabilities:
Persist via winlogon helper dll registry key
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
mov eax, dword [ebp + 0x18]
push ebx
push esi
push edi
xor edi, edi
mov dword [esp + 0x10], 0x208
neg eax
mov dword [esp + 0x14], edi
push 0x208
sbb eax, eax
mov dword [esp + 0x1c], edi
and eax, 6
mov dword [esp + 0x2c], edi
inc eax
mov dword [esp + 0x24], 0x103
movzx eax, ax
push 0x40
mov dword [esp + 0x34], eax
mov dword [esp + 0x2c], edi
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalAlloc]
mov ebx, eax
test ebx, ebx
je 0x40274c
cmp dword [ebp + 0xc], edi
je 0x4014e7
push dword [ebp + 0xc]
mov edx, 0x104
mov ecx, ebx
call fcn.004021d4
mov esi, eax
test esi, esi
js 0x402854
push 0x401118
push dword [ebp + 8]
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x401527
cmp dword [ebp + 0x10], edi
je 0x401527
lea eax, [esp + 0x34]
mov dword [esp + 0x30], edi
push eax
push 0x20019
push edi
push 0x401658
push 0x80000002
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
je 0x402753
lea eax, [esp + 0x1c]
mov dword [esp + 0x10], 0x208
push eax
xor eax, eax
cmp dword [ebp + 0x10], eax
push 0x20019
push edi
setne al
push 0x401128
add eax, 0x80000001
push eax
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x40157e
lea eax, [esp + 0x10]
push eax
push ebx
lea eax, [esp + 0x20]
push eax
push edi
push dword [ebp + 8]
push dword [esp + 0x30]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
push dword [esp + 0x1c]
mov dword [esp + 0x24], eax
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
cmp dword [esp + 0x20], edi
jne 0x4015a9
cmp dword [esp + 0x18], 1
jne 0x40175b
mov eax, dword [esp + 0x10]
cmp eax, 2
jbe 0x40175b
shr eax, 1
cmp word [ebx + eax*2 - 2], di
jne 0x40175b
cmp dword [esp + 0x28], edi
jne 0x4015d7
cmp dword [ebp + 0x10], edi
jne 0x4015d7
lea eax, [esp + 0x1c]
push eax
push 0x20019
push edi
push 0x401f90
push 0x80000001
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
je 0x4027f5
cmp word [ebx], di
je 0x401749
mov esi, ebx
cmp dword [ebp + 0x1c], edi
je 0x4028c6
push 0x401118
push dword [ebp + 8]
mov dword [esp + 0x30], edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x40162f
push 0x4010e8
push ebx
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
je 0x401627
push 0x4010fc
push ebx
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x40162f
mov dword [esp + 0x28], 1
cmp word [ebx], di
je 0x40173b
push 0x2c
pop ecx
push 0x20
pop edx
mov eax, ebx
cmp word [esi], di
je 0x401704
cmp word [esi], cx
je 0x40288a
add esi, 2
jmp 0x401640
cmp word [esi], cx
je 0x40288a
cmp word [eax], dx
je 0x401769
push edi
push dword [esp + 0x30]
push edi
push dword [ebp + 0x14]
push edi
push eax
call fcn.00401780
test eax, eax
je 0x40172a
inc dword [esp + 0x14]
mov eax, esi
push 0x2c
pop ecx
push 0x20
pop edx
cmp word [esi], di
jne 0x401649
cmp dword [esp + 0x28], edi
je 0x402897
mov edi, dword [esp + 0x14]
push ebx
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
cmp dword [ebp + 0xc], edi
jne 0x4027d7
jmp 0x4027eb
add eax, 2
jmp 0x40170d
xor eax, eax
jmp 0x401752
push dword [esp + 0x10]
mov dword [esp + 0x34], 1
push 0x40
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalAlloc]
mov esi, eax
test esi, esi
je 0x40286a
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x14]
push eax
push esi
push ebx
lea eax, [esp + 0x28]
push eax
sub esp, 0x10
call fcn.00403acf
mov dword [esp + 0x20], eax
test eax, eax
jne 0x4027b7
cmp dword [esp + 0x24], edi
je 0x4027b7
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x208
push eax
push ebx
lea edx, [esp + 0x20]
lea ecx, [esp + 0x38]
call fcn.00403c69
mov dword [esp + 0x20], eax
cmp dword [esp + 0x30], edi
je 0x4027cb
push dword [esp + 0x34]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
mov dword [esp + 0x30], edi
push esi
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
jmp 0x40157e
push dword [ebp + 0xc]
mov edx, 0x104
mov ecx, ebx
call fcn.004021d4
jmp 0x4015a9
xor eax, eax
mov word [ebx], ax
jmp 0x4015a9
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x208
push eax
push ebx
lea eax, [esp + 0x20]
push eax
push edi
push dword [ebp + 8]
push dword [esp + 0x30]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
push dword [esp + 0x1c]
mov esi, eax
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
test esi, esi
jne 0x4015d7
cmp dword [esp + 0x18], 1
jne 0x402847
mov eax, dword [esp + 0x10]
cmp eax, 2
jbe 0x402847
shr eax, 1
cmp word [ebx + eax*2 - 2], di
je 0x4015d7
mov dword [esp + 0x28], 1
jmp 0x4014c9
push ebx
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
movzx eax, si
push eax
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError]
jmp 0x40274c
cmp dword [esp + 0x30], edi
je 0x40287e
push dword [esp + 0x34]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
mov dword [esp + 0x30], edi
push ebx
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
jmp 0x40274c
xor ecx, ecx
mov word [esi], cx
add esi, 2
jmp 0x40170d
call fcn.00401995
test al, al
je 0x4028ae
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_IsSubDesktopSession]
test eax, eax
jne 0x401745
call fcn.00401995
test al, al
je 0x401745
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_SetShellDesktopSwitchEvent]
jmp 0x401745
push 0x402900
push dword [ebp + 8]
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x4028dd
inc eax
jmp 0x4028df
mov eax, edi
push edi
push dword [esp + 0x30]
push eax
push dword [ebp + 0x14]
push edi
push ebx
call fcn.00401780
test eax, eax
je 0x401749
xor edi, edi
inc edi
jmp 0x401749