Function at 0x140013490
Capabilities:
Check if file exists
Create process on windows
Delete file
Query environment variable
Self delete

Disassembly:
sub rsp, 0x6a8
mov qword [rsp + 0x568], 0xfffffffffffffffe
mov dword [rsp + 0x9c], 0
mov dword [rsp + 0x7c], 1
mov dword [rsp + 0x78], 2
mov dword [rsp + 0x88], 3
mov dword [rsp + 0x64], 4
mov dword [rsp + 0x54], 5
mov dword [rsp + 0x90], 6
mov dword [rsp + 0x34], 7
mov dword [rsp + 0x6c], 8
mov dword [rsp + 0x98], 9
mov dword [rsp + 0x60], 0xa
mov dword [rsp + 0x5c], VariantTimeToDosDateTime
mov dword [rsp + 0x74], reloc.OLEAUT32.dll_VariantTimeToDosDateTime
mov dword [rsp + 0xa0], reloc.WS2_32.dll_listen
mov dword [rsp + 0x30], reloc.WS2_32.dll_ntohl
mov dword [rsp + 0x94], reloc.WS2_32.dll_ntohs
mov dword [rsp + 0x8c], reloc.WS2_32.dll_recv
mov dword [rsp + 0x70], reloc.WS2_32.dll_recvfrom
mov dword [rsp + 0x80], send
mov dword [rsp + 0x4c], reloc.WS2_32.dll_send
mov dword [rsp + 0x84], reloc.WS2_32.dll_sendto
mov dword [rsp + 0x50], reloc.WS2_32.dll_setsockopt
mov dword [rsp + 0x48], reloc.WS2_32.dll_shutdown
mov dword [rsp + 0x44], reloc.WS2_32.dll_socket
mov dword [rsp + 0x40], 0x18
mov dword [rsp + 0x58], 0x19
mov dword [rsp + 0x3c], 0x1a
mov dword [rsp + 0x38], 0x1b
mov dword [rsp + 0x68], 0x1c
lea rcx, str.TEMP
call fcn.140059510
mov qword [rsp + 0xd8], rax
lea rax, str.upgrader.exe
mov qword [rsp + 0xd0], rax
mov rdx, qword [rsp + 0xd0]
lea rcx, [rsp + 0x470]
call fcn.140013f30
mov qword [rsp + 0x570], rax
mov rax, qword [rsp + 0x570]
mov qword [rsp + 0x578], rax
mov rdx, qword [rsp + 0xd8]
lea rcx, [rsp + 0x498]
call fcn.140013f30
mov qword [rsp + 0x580], rax
mov rax, qword [rsp + 0x580]
mov qword [rsp + 0x588], rax
lea r8, [0x14008d1fc]
mov rdx, qword [rsp + 0x588]
lea rcx, [rsp + 0x4c0]
call fcn.14001c880
mov qword [rsp + 0x590], rax
mov rax, qword [rsp + 0x590]
mov qword [rsp + 0x598], rax
mov r8, qword [rsp + 0x578]
mov rdx, qword [rsp + 0x598]
lea rcx, [rsp + 0xe0]
call fcn.14001c8e0
mov qword [rsp + 0x5a0], rax
lea rcx, [rsp + 0x4c0]
call fcn.140004070
nop
lea rcx, [rsp + 0x498]
call fcn.140004070
nop
lea rcx, [rsp + 0x470]
call fcn.140004070
xor r8d, r8d
mov edx, 0x104
lea rcx, [rsp + 0xa8]
call fcn.14001c9f0
mov qword [rsp + 0x5a8], rax
xor edx, edx
lea rcx, [rsp + 0xa8]
call fcn.140013fd0
mov qword [rsp + 0x5b0], rax
mov r8d, 0x104
mov rdx, qword [rsp + 0x5b0]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea rdx, [rsp + 0xe0]
lea rcx, [rsp + 0xa8]
call fcn.14001ca70
mov byte [rsp + 0x5b8], al
movzx eax, byte [rsp + 0x5b8]
test eax, eax
je 0x140013bf2
lea rcx, [rsp + 0xe0]
call fcn.1400040b0
mov qword [rsp + 0x5c0], rax
mov rcx, qword [rsp + 0x5c0]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x140013770
lea rcx, [rsp + 0xe0]
call fcn.1400040b0
mov qword [rsp + 0x5c8], rax
mov rcx, qword [rsp + 0x5c8]
call qword [sym.imp.KERNEL32.dll_DeleteFileA]
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
mov dword [rsp + 0x20], 1
mov r9d, 0x40
mov r8d, 0x20
lea rdx, [rsp + 0xa8]
lea rcx, [rsp + 0x110]
call fcn.140017160
mov qword [rsp + 0x5d0], rax
mov dword [rsp + 0x20], 1
mov r9d, 0x40
mov r8d, 0x20
lea rdx, [rsp + 0xe0]
lea rcx, [rsp + 0x220]
call fcn.140018290
mov qword [rsp + 0x5d8], rax
mov rax, qword [rsp + 0x110]
movsxd rax, dword [rax + 4]
lea rax, [rsp + rax + 0x110]
mov rcx, rax
call fcn.140013c20
mov qword [rsp + 0x5e0], rax
cmp qword [rsp + 0x5e0], 0
je 0x140013bd6
mov rax, qword [rsp + 0x220]
movsxd rax, dword [rax + 4]
lea rax, [rsp + rax + 0x220]
mov rcx, rax
call fcn.140013c20
mov qword [rsp + 0x5e8], rax
cmp qword [rsp + 0x5e8], 0
je 0x140013bd6
lea rcx, [rsp + 0x110]
call fcn.1400172f0
mov qword [rsp + 0x5f0], rax
mov rdx, qword [rsp + 0x5f0]
lea rcx, [rsp + 0x220]
call fcn.140014020
lea rcx, [rsp + 0x110]
call fcn.140006f30
lea rcx, [rsp + 0x220]
call fcn.140018420
lea rcx, [rsp + 0x4e8]
call fcn.140011fd0
mov qword [rsp + 0x5f8], rax
mov rax, qword [rsp + 0x5f8]
mov qword [rsp + 0x600], rax
mov rdx, qword [rsp + 0xd8]
lea rcx, [rsp + 0x510]
call fcn.140013f30
mov qword [rsp + 0x608], rax
mov rax, qword [rsp + 0x608]
mov qword [rsp + 0x610], rax
lea r8, [0x14008d20c]
mov rdx, qword [rsp + 0x610]
lea rcx, [rsp + 0x538]
call fcn.14001c880
mov qword [rsp + 0x618], rax
mov rax, qword [rsp + 0x618]
mov qword [rsp + 0x620], rax
mov r8, qword [rsp + 0x600]
mov rdx, qword [rsp + 0x620]
lea rcx, [rsp + 0x330]
call fcn.14001c8e0
mov qword [rsp + 0x628], rax
lea rcx, [rsp + 0x538]
call fcn.140004070
nop
lea rcx, [rsp + 0x510]
call fcn.140004070
nop
lea rcx, [rsp + 0x4e8]
call fcn.140004070
lea rdx, [0x14008d530]
lea rcx, [rsp + 0x330]
call fcn.140013fa0
mov dword [rsp + 0x20], 1
mov r9d, 0x40
mov r8d, 2
lea rdx, [rsp + 0x330]
lea rcx, [rsp + 0x360]
call fcn.140018290
mov qword [rsp + 0x630], rax
mov rax, qword [rsp + 0x360]
movsxd rax, dword [rax + 4]
lea rax, [rsp + rax + 0x360]
mov rcx, rax
call fcn.140013c20
mov qword [rsp + 0x638], rax
cmp qword [rsp + 0x638], 0
je 0x140013bba
lea rdx, str._echo_off
lea rcx, [rsp + 0x360]
call fcn.14001cab0
mov qword [rsp + 0x640], rax
lea rdx, [0x140013c60]
mov rcx, qword [rsp + 0x640]
call fcn.140014000
lea rdx, str.timeout_3___NUL
lea rcx, [rsp + 0x360]
call fcn.14001cab0
mov qword [rsp + 0x648], rax
lea rdx, [0x140013c60]
mov rcx, qword [rsp + 0x648]
call fcn.140014000
lea rdx, str.START_____
lea rcx, [rsp + 0x360]
call fcn.14001cab0
mov qword [rsp + 0x650], rax
lea rdx, [rsp + 0xe0]
mov rcx, qword [rsp + 0x650]
call fcn.14001cea0
mov qword [rsp + 0x658], rax
lea rdx, [0x14008d3d4]
mov rcx, qword [rsp + 0x658]
call fcn.14001cab0
mov qword [rsp + 0x660], rax
lea rdx, [0x140013c60]
mov rcx, qword [rsp + 0x660]
call fcn.140014000
lea rdx, [0x14008d4e4]
lea rcx, [rsp + 0x360]
call fcn.14001cab0
mov qword [rsp + 0x668], rax
mov rdx, qword [rsp + 0xd8]
mov rcx, qword [rsp + 0x668]
call fcn.14001cab0
mov qword [rsp + 0x670], rax
lea rdx, [0x140013c60]
mov rcx, qword [rsp + 0x670]
call fcn.140014000
lea rcx, [rsp + 0x330]
call fcn.1400040b0
mov qword [rsp + 0x678], rax
lea rdx, str.DEL__
lea rcx, [rsp + 0x360]
call fcn.14001cab0
mov qword [rsp + 0x680], rax
mov rcx, qword [rsp + 0x678]
call qword [sym.imp.SHLWAPI.dll_PathFindFileNameA]
mov rdx, rax
mov rcx, qword [rsp + 0x680]
call fcn.14001cab0
mov qword [rsp + 0x688], rax
lea rdx, str.___f__q
mov rcx, qword [rsp + 0x688]
call fcn.14001cab0
mov qword [rsp + 0x690], rax
lea rdx, [0x140013c60]
mov rcx, qword [rsp + 0x690]
call fcn.140014000
lea rcx, [rsp + 0x360]
call fcn.140018420
lea rcx, [rsp + 0x330]
call fcn.1400040b0
mov qword [rsp + 0x698], rax
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
xor r9d, r9d
mov r8, qword [rsp + 0x698]
lea rdx, str.open
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_ShellExecuteA]
xor ecx, ecx
call fcn.140059274
nop
lea rcx, [rsp + 0x360]
call fcn.140013cd0
nop
lea rcx, [rsp + 0x330]
call fcn.140004070
nop
lea rcx, [rsp + 0x220]
call fcn.140013cd0
nop
lea rcx, [rsp + 0x110]
call fcn.140013c90
nop
lea rcx, [rsp + 0xa8]
call fcn.140004070
nop
lea rcx, [rsp + 0xe0]
call fcn.140004070
nop
jmp 0x140013c17
add rsp, 0x6a8
ret