Function at 0x421c95
Capabilities:
Check if file exists
Get common file path
Get file attributes
Persist via run registry key
Set current directory
Set registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x8c8
mov eax, dword [0x4434f4]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov ebx, edx
mov esi, 0x80070002
push edi
mov dword [ebp - 0x8b8], ebx
mov edi, ecx
call fcn.0041f47f
test eax, eax
je 0x422140
push edi
xor eax, eax
push 0x405290
push 4
mov dword [ebp - 0x8b4], eax
mov ebx, eax
mov esi, eax
call fcn.0041ea5f
xor eax, eax
add esp, 0xc
inc eax
inc eax
cmp dword [ebp + 8], 0
mov dword [ebp - 0x8c8], eax
je 0x421f54
push 0x208
lea eax, [ebp - 0x494]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x422126
push ecx
lea eax, [ebp - 0x8bc]
mov edx, 0x208
push eax
lea ecx, [ebp - 0x494]
call fcn.0040c131
test eax, eax
js 0x421d51
mov eax, dword [ebp - 0x8bc]
mov edx, 0x208
push ecx
push 0x4052ac
push ecx
lea ecx, [ebp - 0x494]
sub edx, eax
lea ecx, [ecx + eax*2]
call fcn.0040c197
lea eax, [ebp - 0x494]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x421d6c
test al, 0x10
jne 0x421d6c
xor eax, eax
inc eax
jmp 0x421d6e
xor eax, eax
test eax, eax
je 0x421f33
test edi, edi
je 0x421d9e
push 0x5c
push edi
call dword [sym.imp.msvcrt.dll_wcsrchr]
pop ecx
pop ecx
lea ecx, [ebp - 0x84]
test eax, eax
je 0x421d95
add eax, 2
push eax
jmp 0x421d96
push edi
push 0x3c
pop edx
call fcn.0040c010
cmp dword [ebp - 0x8b8], 0
mov eax, 0x4052c8
jne 0x421db1
mov eax, 0x4052d4
mov ebx, 0x208
lea ecx, [ebp - 0x494]
push eax
mov edx, ebx
call fcn.0040c045
push edi
mov edx, ebx
lea ecx, [ebp - 0x494]
call fcn.0040c045
push ecx
lea eax, [ebp - 0x8c0]
mov edx, ebx
push eax
lea ecx, [ebp - 0x494]
call fcn.0040c131
test eax, eax
js 0x421e0a
mov eax, dword [ebp - 0x8c0]
mov edx, ebx
push ecx
push 0x4052e8
push ecx
lea ecx, [ebp - 0x494]
sub edx, eax
lea ecx, [ecx + eax*2]
call fcn.0040c197
lea eax, [ebp - 0x8a8]
xor ebx, ebx
push eax
push 3
push ebx
push 0x401848
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x8a8], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x421e54
lea eax, [ebp - 0x8a8]
push eax
push 3
push ebx
push 0x401848
push SysReAllocStringLen
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov ebx, eax
test ebx, ebx
jne 0x421ed5
mov ecx, dword [ebp - 0x8a8]
lea eax, [ebp - 0x494]
push eax
call fcn.0042246a
mov edx, eax
mov dword [ebp - 0x8ac], edx
test edx, edx
je 0x421ec0
lea ecx, [ebp - 0x494]
lea ebx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x8b4]
jne 0x421e7b
sub ecx, ebx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
lea eax, [ebp - 0x494]
push eax
push 1
xor eax, eax
push eax
push edx
push dword [ebp - 0x8a8]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [ebp - 0x8ac]
mov ebx, eax
call dword [sym.imp.msvcrt.dll_free]
pop ecx
jmp 0x421ec5
mov ebx, 0x80004005
push dword [ebp - 0x8a8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test ebx, ebx
je 0x421efb
jle 0x421ee0
movzx ebx, bx
or ebx, 0x80070000
push ebx
lea eax, [ebp - 0x84]
push eax
push 0x405010
push 2
pop eax
push eax
call fcn.0041ea5f
add esp, 0x10
jmp 0x421f26
cmp dword [0x443534], 0xffffffff
jne 0x421f0d
push ecx
push 4
pop edx
call fcn.0041e530
push 4
mov edx, 0x405054
pop ecx
call fcn.0041e988
or dword [0x443678], 1
mov ebx, 0xd2af9
not ebx
shr ebx, 0x1f
test ebx, ebx
jne 0x42211e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x421f48
movzx esi, si
or esi, 0x80070000
push esi
push edi
push 0x405328
jmp 0x4220f4
xor eax, eax
push eax
mov dword [ebp - 0x8ac], eax
call dword [sym.imp.ole32.dll_OleInitialize]
mov esi, eax
test esi, esi
js 0x422135
lea eax, [ebp - 0x8a4]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
je 0x421fc5
push edi
mov edx, 0x103
lea ecx, [ebp - 0x69c]
call fcn.0040c010
lea eax, [ebp - 0x69c]
push 0x5c
push eax
call dword [sym.imp.msvcrt.dll_wcsrchr]
pop ecx
pop ecx
test eax, eax
je 0x421fc5
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x69c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov dword [ebp - 0x8ac], 1
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x8b4]
jne 0x421fca
sub ecx, edx
sar ecx, 1
push 2
pop edx
lea eax, [ecx + 5]
xor ecx, ecx
mov dword [ebp - 0x8b0], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0044183a
mov dword [ebp - 0x8a8], eax
pop ecx
test eax, eax
je 0x4220ab
test edi, edi
je 0x422022
push dword [ebp - 0x8b0]
mov edx, eax
mov ecx, edi
call fcn.0041ec55
mov eax, dword [ebp - 0x8a8]
push 8
xor ecx, ecx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [ebp - 0x8c4], eax
cmp eax, 0x20
jbe 0x422083
cmp dword [ebp - 0x8b8], 0
mov ecx, 0x40536c
jne 0x42204c
mov ecx, 0x405380
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x8b0], eax
test eax, eax
je 0x422075
mov ecx, eax
call dword [0x446624]
call dword [ebp - 0x8b0]
mov esi, eax
xor ebx, ebx
test esi, esi
setns bl
push dword [ebp - 0x8c4]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x42209f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jne 0x422094
push 0x57
pop esi
test esi, esi
jle 0x42209f
movzx esi, si
or esi, 0x80070000
push dword [ebp - 0x8a8]
call fcn.00441807
pop ecx
cmp dword [ebp - 0x8ac], 0
je 0x4220c1
lea eax, [ebp - 0x8a4]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
call dword [sym.imp.ole32.dll_OleUninitialize]
test ebx, ebx
jne 0x42212d
test esi, esi
jne 0x4220ed
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x4220e6
movzx esi, si
or esi, 0x80070000
test esi, esi
jne 0x4220ed
mov esi, 0x80004005
push esi
push edi
push 0x4053c8
push 2
pop eax
push eax
call fcn.0041ea5f
xor eax, eax
add esp, 0x10
cmp dword [ebp + 8], eax
sete al
push 2
mov dword [ebp + 8], eax
mov eax, dword [ebp - 0x8c8]
pop ecx
cmp eax, ecx
jl 0x421ce8
jmp 0x422167
push edi
push 0x4052ec
jmp 0x42215d
mov esi, 0x80004005
jmp 0x422167
push edi
push 0x405394
jmp 0x42215d
push esi
push 0x40466c
xor eax, eax
push eax
jmp 0x42215f
test ebx, ebx
je 0x422157
push esi
push edi
push 0x405404
push 2
call fcn.0041ea5f
add esp, 0x10
jmp 0x422167
push edi
push 0x405444
push 4
call fcn.0041ea5f
add esp, 0xc
mov ecx, dword [ebp - 8]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00441b90
mov esp, ebp
pop ebp
ret 4