Function at 0x401646
Capabilities:
Query or enumerate registry value
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x224
mov eax, dword [0x4050b4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
push edi
lea eax, reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError
push eax
push 0x20019
xor ebx, ebx
push ebx
push 0x401718
push 0x80000002
mov dword [ebp - reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError], ebx
call esi
test eax, eax
je 0x402cd0
push ebx
push 0x401490
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
test eax, eax
je 0x402da0
call fcn.00401c97
xor esi, esi
inc esi
test al, al
je 0x4016bb
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_IsTSAppCompatOn]
test eax, eax
jne 0x402db9
cmp dword [ebp - reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError], 0
jne 0x402de1
mov ecx, dword fs:[0x30]
mov eax, dword [reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError]
cmp eax, dword [ecx + reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError]
jne 0x402e02
push esi
push ebx
push ebx
push ebx
push ebx
mov edi, 0x401410
push edi
call fcn.0040177f
test eax, eax
jne 0x401703
push esi
push ebx
push ebx
push esi
push 0x4013fc
push edi
call fcn.0040177f
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004013ef
leave
ret
lea eax, reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError
push eax
lea eax, reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError
push eax
lea eax, reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError
push eax
push ebx
mov ebx, dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
push 0x402e20
push dword [ebp - 0x218]
mov dword [ebp - reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError], 4
call ebx
push dword [ebp - 0x218]
mov edi, dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
call edi
cmp dword [ebp - reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError], 0
je 0x402d99
lea eax, reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError
push eax
push 0x20019
push 0
push 0x402e48
push 0x80000002
call esi
test eax, eax
jne 0x402d8c
lea eax, reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError
push eax
lea eax, reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError
push eax
lea eax, reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError
push eax
push 0
push 0x402e9c
push dword [ebp - 0x218]
mov dword [ebp - reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError], 0x208
call ebx
test eax, eax
jne 0x402d73
cmp word [ebp - 0x210], ax
jne 0x402d7d
xor ebx, ebx
mov dword [ebp - reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError], ebx
jmp 0x402d7f
xor ebx, ebx
push dword [ebp - 0x218]
call edi
jmp 0x40168d
xor ebx, ebx
mov dword [ebp - reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError], ebx
jmp 0x40168d
xor ebx, ebx
jmp 0x40168d
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
cmp eax, 0xcb
je 0x4016a1
xor eax, eax
inc eax
jmp 0x401705
push esi
push esi
push esi
push ebx
push ebx
mov edi, 0x402ebc
push edi
call fcn.0040177f
test eax, eax
jne 0x4016bb
push esi
push esi
push esi
push esi
push ebx
push edi
call fcn.0040177f
jmp 0x4016bb
push ebx
push 3
push ebx
push ebx
push ebx
lea eax, reloc.api_ms_win_core_errorhandling_l1_1_1.dll_SetLastError
push eax
call fcn.00401a65
test eax, eax
je 0x4016e0
xor eax, eax
jmp 0x401705
call fcn.00401c97
test al, al
je 0x4016e0
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_ProcesRemoteSessionInitialCommand]
test al, al
je 0x402dfb
jmp 0x4016e0