Function at 0x401766
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 0x40268c
cmp dword [ebp + 0xc], edi
je 0x4017dd
push dword [ebp + 0xc]
mov edx, 0x104
mov ecx, ebx
call fcn.00401c1b
mov esi, eax
test esi, esi
js 0x402794
push 0x401400
push dword [ebp + 8]
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x40181d
cmp dword [ebp + 0x10], edi
je 0x40181d
lea eax, [esp + 0x34]
mov dword [esp + 0x30], edi
push eax
push 0x20019
push edi
push 0x401950
push 0x80000002
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
je 0x402693
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 0x401410
add eax, 0x80000001
push eax
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x401874
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 0x40189f
cmp dword [esp + 0x18], 1
jne 0x401a53
mov eax, dword [esp + 0x10]
cmp eax, 2
jbe 0x401a53
shr eax, 1
cmp word [ebx + eax*2 - 2], di
jne 0x401a53
cmp dword [esp + 0x28], edi
jne 0x4018cd
cmp dword [ebp + 0x10], edi
jne 0x4018cd
lea eax, [esp + 0x1c]
push eax
push 0x20019
push edi
push 0x401098
push 0x80000001
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
je 0x402735
cmp word [ebx], di
je 0x401a41
mov esi, ebx
cmp dword [ebp + 0x1c], edi
je 0x402806
push 0x401400
push dword [ebp + 8]
mov dword [esp + 0x30], edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x401925
push 0x4013ec
push ebx
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
je 0x40191d
push 0x401b2c
push ebx
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x401925
mov dword [esp + 0x28], 1
cmp word [ebx], di
je 0x401a33
push 0x2c
pop ecx
push 0x20
pop edx
mov eax, ebx
cmp word [esi], di
je 0x4019fc
cmp word [esi], cx
je 0x4027ca
add esi, 2
jmp 0x401936
cmp word [esi], cx
je 0x4027ca
cmp word [eax], dx
je 0x401a61
push edi
push dword [esp + 0x30]
push edi
push dword [ebp + 0x14]
push edi
push eax
call fcn.00401a6b
test eax, eax
je 0x401a22
inc dword [esp + 0x14]
mov eax, esi
push 0x2c
pop ecx
push 0x20
pop edx
cmp word [esi], di
jne 0x40193f
cmp dword [esp + 0x28], edi
je 0x4027d7
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 0x402717
jmp 0x40272b
add eax, 2
jmp 0x401a05
xor eax, eax
jmp 0x401a4a
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 0x4027aa
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.0040391b
mov dword [esp + 0x20], eax
test eax, eax
jne 0x4026f7
cmp dword [esp + 0x24], edi
je 0x4026f7
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x208
push eax
push ebx
lea edx, [esp + 0x20]
lea ecx, [esp + 0x38]
call fcn.00403ab1
mov dword [esp + 0x20], eax
cmp dword [esp + 0x30], edi
je 0x40270b
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 0x401874
push dword [ebp + 0xc]
mov edx, 0x104
mov ecx, ebx
call fcn.00401c1b
jmp 0x40189f
xor eax, eax
mov word [ebx], ax
jmp 0x40189f
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 0x4018cd
cmp dword [esp + 0x18], 1
jne 0x402787
mov eax, dword [esp + 0x10]
cmp eax, 2
jbe 0x402787
shr eax, 1
cmp word [ebx + eax*2 - 2], di
je 0x4018cd
mov dword [esp + 0x28], 1
jmp 0x4017bf
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 0x40268c
cmp dword [esp + 0x30], edi
je 0x4027be
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 0x40268c
xor ecx, ecx
mov word [esi], cx
add esi, 2
jmp 0x401a05
call fcn.0040200e
test al, al
je 0x4027ee
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_IsSubDesktopSession]
test eax, eax
jne 0x401a3d
call fcn.0040200e
test al, al
je 0x401a3d
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_SetShellDesktopSwitchEvent]
jmp 0x401a3d
push 0x402840
push dword [ebp + 8]
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x40281d
inc eax
jmp 0x40281f
mov eax, edi
push edi
push dword [esp + 0x30]
push eax
push dword [ebp + 0x14]
push edi
push ebx
call fcn.00401a6b
test eax, eax
je 0x401a41
xor edi, edi
inc edi
jmp 0x401a41