Function at 0x401b51
Capabilities:
Create thread
Query or enumerate registry value
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x9c
mov eax, dword [0x405030]
xor eax, esp
mov dword [esp + 0x98], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor edi, edi
mov dword [esp + 0x2c], eax
push edi
push edi
push 1
push edi
mov dword [esp + 0x28], edi
mov ebx, edi
mov dword [esp + 0x20], edi
call dword [sym.imp.api_ms_win_core_heap_l1_2_0.dll_HeapSetInformation]
call fcn.00401995
test al, al
je 0x401ba9
push fcn.00401470
push fcn.00401780
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_ImmWorker]
mov ebx, eax
mov ecx, 0x401c84
call fcn.00401e30
mov ecx, 0x401cac
mov dword [esp + 0x14], eax
call fcn.00401e30
mov ecx, 0x401cd4
mov dword [esp + 0x1c], eax
call fcn.00401e30
mov esi, eax
mov dword [esp + 0x24], esi
test esi, esi
jne 0x401d0d
mov esi, edi
push edi
push 0x401c84
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
push edi
push 0x401cac
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
push edi
push 0x401cd4
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
call fcn.00401e89
mov edi, eax
call fcn.00401995
test al, al
je 0x401c19
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_SetupHotKeyForKeyboardLayout]
call fcn.00401995
test al, al
je 0x401c32
push esi
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_ProcessTermSrvIniFiles]
cmp eax, 1
je 0x403159
call fcn.00401995
test al, al
je 0x401c41
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_CreateExplorerSessionKey]
test edi, edi
jne 0x403161
call fcn.00402e7b
push 0x401194
push 0x401198
mov dword [esp + 0x18], eax
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
mov edx, dword [esp + 0x1c]
xor edi, edi
push ecx
mov ecx, dword [esp + 0x18]
push edi
call fcn.004011c9
xor edx, edx
mov ecx, esi
call fcn.00401222
jmp 0x403193
mov dword [esp + 0x10], eax
xor edi, edi
jmp 0x403193
mov ecx, esi
mov edx, esi
cmp word [esi], di
jne 0x403116
jmp 0x401bdf
push dword [esp + 0x1c]
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
push esi
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
push 0xfffffffffffffffe
call dword [sym.imp.api_ms_win_core_processthreads_l1_1_2.dll_GetCurrentThread]
push eax
call dword [sym.imp.api_ms_win_core_processthreads_l1_1_2.dll_SetThreadPriority]
call fcn.00401995
test al, al
je 0x401d6b
mov ecx, dword fs:[0x30]
mov eax, dword [0x7ffe02d8]
cmp eax, dword [ecx + 0x1d4]
sete al
movzx eax, al
push eax
push dword [esp + 0x30]
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_LoadRemoteFontsAndInitMiscWorker]
lea eax, [esp + 0x34]
push eax
push edi
lea eax, [esp + 0x18]
push eax
push 0x401030
push edi
push edi
call dword [sym.imp.api_ms_win_core_processthreads_l1_1_2.dll_CreateThread]
mov esi, eax
test esi, esi
je 0x401d9c
push 0x493e0
push esi
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_WaitForSingleObject]
push esi
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
lea eax, [esp + 0x18]
push eax
push 0x20019
push edi
push 0x401f90
push 0x80000001
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
jmp 0x4031a2
push 0x2c
pop esi
cmp word [ecx], si
jne 0x40312e
add ecx, 2
cmp word [ecx], si
je 0x40312e
sub ecx, 2
xor eax, eax
mov word [ecx], ax
cmp ecx, edx
je 0x403138
mov ax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
cmp word [ecx], di
jne 0x403119
mov esi, dword [esp + 0x24]
cmp edx, ecx
je 0x401bdf
xor eax, eax
mov word [edx], ax
jmp 0x401bdf
xor edi, edi
inc edi
jmp 0x401c32
push 0x401194
push 0x401198
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
mov edx, dword [esp + 0x1c]
push ecx
mov ecx, dword [esp + 0x18]
push edi
call fcn.004011c9
mov edx, edi
mov ecx, esi
call fcn.00401222
call fcn.00402e7b
jmp 0x401d02
push dword [esp + 0x14]
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
jmp 0x401d1f
test eax, eax
jne 0x40320d
push 4
pop esi
lea eax, [esp + 0x30]
mov dword [esp + 0x20], edi
push eax
lea eax, [esp + 0x24]
mov dword [esp + 0x34], esi
push eax
lea eax, [esp + 0x30]
push eax
push edi
push 0x403234
push dword [esp + 0x2c]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
test eax, eax
jne 0x403203
cmp dword [esp + 0x28], esi
jne 0x403203
cmp dword [esp + 0x20], eax
je 0x403203
push ecx
push 0x40325c
push ecx
push 0x32
pop edx
lea ecx, [esp + 0x44]
call fcn.0040220e
push edi
push 1
push edi
push edi
push edi
lea eax, [esp + 0x4c]
push eax
call fcn.00401780
push dword [esp + 0x18]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
test ebx, ebx
je 0x403218
push ebx
call dword [sym.imp.api_ms_win_core_libraryloader_l1_2_0.dll_FreeLibrary]
mov ecx, dword [esp + 0xa4]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00401940
mov esp, ebp
pop ebp
ret 0x10