Function at 0x406a64
Capabilities:
Create process on windows
Get common file path
Write and execute a file
Write file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
sub rsp, 0x8d8
lea rbp, [rsp + 0x40]
mov qword [rbp + 0x38], 0xfffffffffffffffe
mov rax, qword [0x004583d0]
mov qword [rbp + 0x880], rax
lea rdx, str.:RepeatDEL___s_if_exist___s__goto_RepeatDEL___s_
lea rcx, [rbp + 0x10]
call sub.MFC42u.dll_CDaoException::CDaoException
nop
mov dword [rbp + 0x670], 0
xor edx, edx
mov r8d, 0x206
lea rcx, [rbp + 0x674]
call sub.msvcrt.dll_memset
mov ebx, 0x104
mov r8d, ebx
lea rdx, [rbp + 0x670]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea rdx, [rbp + 0x670]
lea rcx, [rbp + 0x30]
call sub.MFC42u.dll_CDaoException::CDaoException
mov rdx, rax
lea rcx, [rbp + 0x18]
call fcn.00420200
nop
lea r8, str._selfdestruct.bat
lea rdx, [rbp + 0x18]
lea rcx, [rbp + 8]
call sub.MFC42u.dll_AfxThrowOleException
nop
mov dword [rbp + 0x250], 0
mov edi, 0x204
mov r8, rdi
xor edx, edx
lea rcx, [rbp + 0x254]
call sub.msvcrt.dll_memset
mov dword [rbp + 0x40], 0
mov r8, rdi
xor edx, edx
lea rcx, [rbp + 0x44]
call sub.msvcrt.dll_memset
mov dword [rbp + 0x460], 0
mov r8, rdi
xor edx, edx
lea rcx, [rbp + reloc.MFC42u.dll_AfxDaoTerm]
call sub.msvcrt.dll_memset
lea rdx, [rbp + 0x40]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
lea rdx, [rbp + 0x460]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
lea rdi, [rbp + 0x40]
xor eax, eax
lea rcx, [rax - 1]
repne scasw ax, word [rdi]
mov rdx, qword [rbp + 8]
xor ecx, ecx
movzx eax, word [rdx + rcx]
mov word [rdi + rcx - 2], ax
add rcx, 2
test ax, ax
jne 0x406b81
mov r8d, ebx
lea rdx, [rbp + 0x250]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea rdx, [rbp + 0x250]
lea rcx, [rbp + 0x20]
call sub.MFC42u.dll_CDaoException::CDaoException
nop
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
lea rcx, [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x406cff
lea rcx, [rbp]
call sub.MFC42u.dll_CDaoIndexFieldInfo::CDaoIndexFieldInfo
nop
mov rcx, qword [rbp + 8]
mov qword [rsp + 0x20], rcx
mov r8, qword [rbp + 0x20]
mov r9, r8
mov rdx, qword [rbp + 0x10]
lea rcx, [rbp]
call sub.MFC42u.dll_CPtrList::FreeNode
lea r8, [0x00433c48]
lea rdx, [0x00433c40]
lea rcx, [rbp]
call sub.MFC42u.dll_COleControl::SetFont
mov rdi, qword [rbp]
test rdi, rdi
jne 0x406c3c
xor edx, edx
jmp 0x406ca7
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [rax + rax + 2]
movsxd rax, ecx
add rax, 0xf
and rax, 0xfffffffffffffff0
call fcn.0042ec50
sub rsp, rax
lea rbx, [rsp + 0x40]
test rbx, rbx
je 0x406ca1
mov byte [rbx], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], ecx
mov qword [rsp + 0x20], rbx
mov r9d, 0xffffffff
mov r8, rdi
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
neg eax
sbb rdx, rdx
and rdx, rbx
jmp 0x406ca3
xor edx, edx
mov rdi, qword [rbp]
mov qword [rsp + 0x20], 0
lea r9, [rbp + 0x28]
mov r8d, dword [rdi - 8]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [rsp + 0x28], 0
lea rax, [rbp + 0x460]
mov qword [rsp + 0x20], rax
xor r9d, r9d
lea r8, [rbp + 0x40]
lea rdx, [0x00433c30]
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_ShellExecuteW]
nop
lea rcx, [rbp]
call sub.MFC42u.dll_CDocObjectServer::XOleDocument::AddRef
nop
lea rcx, [rbp + 0x20]
call sub.MFC42u.dll_CDocObjectServer::XOleDocument::AddRef
nop
lea rcx, [rbp + 8]
call sub.MFC42u.dll_CDocObjectServer::XOleDocument::AddRef
nop
lea rcx, [rbp + 0x18]
call sub.MFC42u.dll_CDocObjectServer::XOleDocument::AddRef
nop
lea rcx, [rbp + 0x10]
call sub.MFC42u.dll_CDocObjectServer::XOleDocument::AddRef
mov rcx, qword [rbp + 0x880]
call fcn.0042ec20
lea rsp, [rbp + 0x898]
pop rdi
pop rsi
pop rbx
pop rbp
ret