Function at 0x403e40
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_l2_1_0.dll_LocalAlloc]
mov ebx, eax
test ebx, ebx
jne 0x403e9c
xor eax, eax
jmp 0x4041eb
cmp dword [ebp + 0xc], edi
je 0x403eba
push dword [ebp + 0xc]
mov edx, 0x104
mov ecx, ebx
call fcn.004024e0
mov esi, eax
test esi, esi
js 0x4040a1
push 0x401600
push dword [ebp + 8]
call dword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x403f83
cmp dword [ebp + 0x10], edi
je 0x403f83
lea eax, [esp + 0x34]
mov dword [esp + 0x30], edi
push eax
push 0x20019
push edi
push 0x401610
push 0x80000002
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x403f83
push dword [esp + 0x10]
mov dword [esp + 0x34], 1
push 0x40
call dword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalAlloc]
mov esi, eax
test esi, esi
je 0x4040b7
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.0040789e
mov dword [esp + 0x20], eax
test eax, eax
jne 0x403f66
cmp dword [esp + 0x24], edi
je 0x403f66
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x208
push eax
push ebx
lea edx, [esp + 0x20]
lea ecx, [esp + 0x38]
call fcn.00407982
mov dword [esp + 0x20], eax
cmp dword [esp + 0x30], edi
je 0x403f7a
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_l2_1_0.dll_LocalFree]
jmp 0x403fda
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 0x401768
add eax, 0x80000001
push eax
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x403fda
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 0x404014
cmp dword [esp + 0x18], 1
jne 0x403ff9
mov eax, dword [esp + 0x10]
cmp eax, 2
jbe 0x403ff9
shr eax, 1
cmp word [ebx + eax*2 - 2], di
je 0x404014
cmp dword [ebp + 0xc], edi
je 0x40400f
push dword [ebp + 0xc]
mov edx, 0x104
mov ecx, ebx
call fcn.004024e0
jmp 0x404014
xor eax, eax
mov word [ebx], ax
cmp dword [esp + 0x28], edi
jne 0x4040d7
cmp dword [ebp + 0x10], edi
jne 0x4040d7
lea eax, [esp + 0x1c]
push eax
push 0x20019
push edi
push 0x4017d8
push 0x80000001
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x4040d7
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 0x4040d7
cmp dword [esp + 0x18], 1
jne 0x404094
mov eax, dword [esp + 0x10]
cmp eax, 2
jbe 0x404094
shr eax, 1
cmp word [ebx + eax*2 - 2], di
je 0x4040d7
mov dword [esp + 0x28], 1
jmp 0x403e9c
push ebx
call dword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
movzx eax, si
push eax
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_SetLastError]
jmp 0x403e95
cmp dword [esp + 0x30], edi
je 0x4040cb
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_l2_1_0.dll_LocalFree]
jmp 0x403e95
cmp word [ebx], di
je 0x4041e2
mov esi, ebx
cmp dword [ebp + 0x1c], edi
je 0x4041f4
push 0x401600
push dword [ebp + 8]
mov dword [esp + 0x30], edi
call dword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x404141
push 0x401574
push ebx
call dword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__wcsicmp]
pop ecx
pop ecx
test eax, eax
je 0x404139
push 0x401588
push ebx
call dword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__wcsicmp]
pop ecx
pop ecx
test eax, eax
je 0x404139
push 0x40184c
push ebx
call dword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x404141
mov dword [esp + 0x28], 1
movzx eax, word [ebx]
test ax, ax
je 0x4041b6
mov edx, eax
mov ecx, ebx
movzx eax, dx
test dx, dx
je 0x404175
movzx eax, dx
push 0x2c
pop edx
cmp ax, dx
je 0x40417d
add esi, 2
movzx eax, word [esi]
mov edx, eax
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], edx
test ax, ax
jne 0x404158
push 0x2c
pop edx
cmp ax, dx
jne 0x404185
xor eax, eax
mov word [esi], ax
add esi, 2
push 0x20
pop eax
jmp 0x40418d
add ecx, 2
cmp word [ecx], ax
je 0x40418a
push edi
push dword [esp + 0x30]
push edi
push dword [ebp + 0x14]
push edi
push ecx
call fcn.00403920
test eax, eax
je 0x4041aa
inc dword [esp + 0x14]
movzx eax, word [esi]
mov ecx, esi
mov edx, eax
test ax, ax
jne 0x40414d
cmp dword [esp + 0x28], edi
jne 0x4041de
call fcn.00407b4a
test al, al
je 0x4041cf
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_IsSubDesktopSession]
test eax, eax
jne 0x4041de
call fcn.00407b4a
test al, al
je 0x4041de
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_SetShellDesktopSwitchEvent]
mov edi, dword [esp + 0x14]
push ebx
call dword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
push 0x401868
push dword [ebp + 8]
call dword [sym.imp.api_ms_win_crt_private_l1_1_0.dll__o__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x40420b
inc eax
jmp 0x40420d
mov eax, edi
push edi
push dword [esp + 0x30]
push eax
push dword [ebp + 0x14]
push edi
push ebx
call fcn.00403920
test eax, eax
je 0x4041e2
xor edi, edi
inc edi
jmp 0x4041e2