Function at 0x403140
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 0x40319c
xor eax, eax
jmp 0x4034eb
cmp dword [ebp + 0xc], edi
je 0x4031ba
push dword [ebp + 0xc]
mov edx, 0x104
mov ecx, ebx
call fcn.00402430
mov esi, eax
test esi, esi
js 0x4033a1
push 0x4015a0
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 0x403283
cmp dword [ebp + 0x10], edi
je 0x403283
lea eax, [esp + 0x34]
mov dword [esp + 0x30], edi
push eax
push 0x20019
push edi
push 0x4015b0
push 0x80000002
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x403283
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 0x4033b7
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.00406b6e
mov dword [esp + 0x20], eax
test eax, eax
jne 0x403266
cmp dword [esp + 0x24], edi
je 0x403266
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x208
push eax
push ebx
lea edx, [esp + 0x20]
lea ecx, [esp + 0x38]
call fcn.00406c52
mov dword [esp + 0x20], eax
cmp dword [esp + 0x30], edi
je 0x40327a
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 0x4032da
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 0x401708
add eax, 0x80000001
push eax
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x4032da
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 0x403314
cmp dword [esp + 0x18], 1
jne 0x4032f9
mov eax, dword [esp + 0x10]
cmp eax, 2
jbe 0x4032f9
shr eax, 1
cmp word [ebx + eax*2 - 2], di
je 0x403314
cmp dword [ebp + 0xc], edi
je 0x40330f
push dword [ebp + 0xc]
mov edx, 0x104
mov ecx, ebx
call fcn.00402430
jmp 0x403314
xor eax, eax
mov word [ebx], ax
cmp dword [esp + 0x28], edi
jne 0x4033d7
cmp dword [ebp + 0x10], edi
jne 0x4033d7
lea eax, [esp + 0x1c]
push eax
push 0x20019
push edi
push 0x401778
push 0x80000001
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x4033d7
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 0x4033d7
cmp dword [esp + 0x18], 1
jne 0x403394
mov eax, dword [esp + 0x10]
cmp eax, 2
jbe 0x403394
shr eax, 1
cmp word [ebx + eax*2 - 2], di
je 0x4033d7
mov dword [esp + 0x28], 1
jmp 0x40319c
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 0x403195
cmp dword [esp + 0x30], edi
je 0x4033cb
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 0x403195
cmp word [ebx], di
je 0x4034e2
mov esi, ebx
cmp dword [ebp + 0x1c], edi
je 0x4034f4
push 0x4015a0
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 0x403441
push 0x401514
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 0x403439
push 0x401528
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 0x403439
push 0x4017ec
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 0x403441
mov dword [esp + 0x28], 1
movzx eax, word [ebx]
test ax, ax
je 0x4034b6
mov edx, eax
mov ecx, ebx
movzx eax, dx
test dx, dx
je 0x403475
movzx eax, dx
push 0x2c
pop edx
cmp ax, dx
je 0x40347d
add esi, 2
movzx eax, word [esi]
mov edx, eax
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], edx
test ax, ax
jne 0x403458
push 0x2c
pop edx
cmp ax, dx
jne 0x403485
xor eax, eax
mov word [esi], ax
add esi, 2
push 0x20
pop eax
jmp 0x40348d
add ecx, 2
cmp word [ecx], ax
je 0x40348a
push edi
push dword [esp + 0x30]
push edi
push dword [ebp + 0x14]
push edi
push ecx
call fcn.00402c20
test eax, eax
je 0x4034aa
inc dword [esp + 0x14]
movzx eax, word [esi]
mov ecx, esi
mov edx, eax
test ax, ax
jne 0x40344d
cmp dword [esp + 0x28], edi
jne 0x4034de
call fcn.00406e1a
test al, al
je 0x4034cf
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_IsSubDesktopSession]
test eax, eax
jne 0x4034de
call fcn.00406e1a
test al, al
je 0x4034de
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 0x401808
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 0x40350b
inc eax
jmp 0x40350d
mov eax, edi
push edi
push dword [esp + 0x30]
push eax
push dword [ebp + 0x14]
push edi
push ebx
call fcn.00402c20
test eax, eax
je 0x4034e2
xor edi, edi
inc edi
jmp 0x4034e2