Function at 0x4010d7
Capabilities:
Create directory
Delete directory
Delete file
Query environment variable
Write file on windows

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0x1a0
mov qword [rbp + 0x10], rcx
mov qword [rbp + 0x18], rdx
mov eax, dword [0x00409070]
movsxd rax, eax
mov r11, rax
movabs rax, 1
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_calloc
mov qword [rbp - 8], rax
mov rax, qword [rbp - 8]
cmp rax, 0
jne 0x401125
mov eax, 1
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_exit
mov eax, dword [0x00409070]
mov r9, rax
mov eax, dword [0x0040906c]
mov r8, rax
mov rax, qword [rbp - 8]
mov r11, rax
lea rax, section..data
mov r10, rax
mov rcx, r10
mov rdx, r11
call fcn.0040349c
cmp eax, 0
jge 0x40116c
mov eax, 1
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_exit
lea rax, [0x00409074]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_getenv
mov qword [rbp - 0x10], rax
mov rax, qword [rbp - 0x10]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_strlen
add rax, 0xe
add rax, 1
mov r11, rax
movabs rax, 1
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_calloc
mov qword [rbp - 0x18], rax
mov eax, 0
mov word [rbp - 0x1a], ax
mov rax, qword [rbp - 0x10]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_strlen
add rax, 0xf
movzx ecx, word [rbp - 0x1a]
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbp - 0x10]
mov r9, rcx
lea rcx, str._s_b2ev__hx
mov r8, rcx
mov r11, rax
mov rax, qword [rbp - 0x18]
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll__snprintf
movabs rax, 0
mov r11, rax
mov rax, qword [rbp - 0x18]
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.kernel32.dll_CreateDirectoryA
cmp eax, 0
je 0x401232
mov eax, 0
jmp 0x401237
mov eax, 1
cmp eax, 0
jne 0x401245
jmp 0x401258
movzx eax, word [rbp - 0x1a]
mov rcx, rax
add eax, 1
mov word [rbp - 0x1a], ax
jmp 0x4011c1
mov rax, qword [rbp - 0x18]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll__chdir
movabs rax, 0x38
mov r8, rax
mov eax, 0
mov r11, rax
lea rax, [rbp - 0x58]
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_memset
mov rax, qword [rbp - 8]
mov qword [rbp - 0x68], rax
mov eax, dword [0x00409070]
movsxd rax, eax
mov qword [rbp - 0x60], rax
lea rax, [rbp - 0x68]
mov qword [rbp - 0x38], rax
lea rax, section..text
mov qword [rbp - 0x58], rax
lea rax, [0x0040109c]
mov qword [rbp - 0x48], rax
lea rax, [0x004010b6]
mov qword [rbp - 0x40], rax
movabs rax, 0
mov qword [rbp - 0x150], rax
movabs rax, 0
mov qword [rbp - 0x158], rax
lea rax, [rbp - 0x144]
mov r11, rax
lea rax, [rbp - 0x58]
mov r10, rax
mov rcx, r10
mov rdx, r11
call fcn.00407a64
cmp eax, 0
jne 0x401589
mov eax, dword [rbp - 0x134]
cmp eax, 0x30
jne 0x4014eb
lea rax, [0x00409084]
mov r11, rax
lea rax, [rbp - 0x130]
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_fopen
mov qword [rbp - 0x160], rax
mov rax, qword [rbp - 0x160]
cmp rax, 0
jne 0x401394
call sub.msvcrt.dll___iob_func
add rax, 0x60
lea rcx, [rbp - 0x130]
mov r8, rcx
lea rcx, str.FATAL:_Cannot_open__s
mov r11, rcx
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_fprintf
mov eax, 1
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_exit
mov eax, dword [rbp - 0x13c]
mov rcx, qword [rbp - 0x150]
cmp rcx, rax
jae 0x401436
mov eax, dword [rbp - 0x13c]
mov r11, rax
mov rax, qword [rbp - 0x158]
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_realloc
mov qword [rbp - 0x168], rax
mov rax, qword [rbp - 0x168]
cmp rax, 0
jne 0x40141b
call sub.msvcrt.dll___iob_func
add rax, 0x60
lea rcx, [rbp - 0x130]
mov r8, rcx
lea rcx, str.FATAL:_Out_of_memory_on_file__s
mov r11, rcx
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_fprintf
mov eax, 1
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_exit
mov rax, qword [rbp - 0x168]
mov qword [rbp - 0x158], rax
mov eax, dword [rbp - 0x13c]
mov qword [rbp - 0x150], rax
mov eax, dword [rbp - 0x13c]
mov r8, rax
mov rax, qword [rbp - 0x158]
mov r11, rax
lea rax, [rbp - 0x58]
mov r10, rax
mov rcx, r10
mov rdx, r11
call fcn.00407b1a
cmp eax, 0xffffffff
jne 0x40149f
call sub.msvcrt.dll___iob_func
add rax, 0x60
lea rcx, [rbp - 0x130]
mov r8, rcx
lea rcx, str.FATAL:_Incomplete_data_on__s
mov r11, rcx
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_fprintf
mov eax, 1
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_exit
mov eax, dword [rbp - 0x13c]
mov rcx, qword [rbp - 0x160]
mov r9, rcx
movabs rcx, 1
mov r8, rcx
mov r11, rax
mov rax, qword [rbp - 0x158]
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_fwrite
mov rax, qword [rbp - 0x160]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_fclose
jmp 0x401575
mov eax, dword [rbp - 0x134]
cmp eax, 0x35
jne 0x401575
movabs rax, 0
mov r11, rax
lea rax, [rbp - 0x130]
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.kernel32.dll_CreateDirectoryA
cmp eax, 0
je 0x40152c
mov eax, 0
jmp 0x401531
mov eax, 1
cmp eax, 0
je 0x401575
call sub.msvcrt.dll___iob_func
add rax, 0x60
lea rcx, [rbp - 0x130]
mov r8, rcx
lea rcx, str.FATAL:_Cant_create_directory__s
mov r11, rcx
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll_fprintf
mov eax, 1
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_exit
lea rax, [rbp - 0x58]
mov r10, rax
mov rcx, r10
call fcn.004078de
jmp 0x4012ee
mov rax, qword [rbp - 0x158]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_free
mov rax, qword [rbp + 0x18]
lea rcx, str.main.bat
mov qword [rax], rcx
mov rax, qword [rbp + 0x18]
mov rcx, qword [rbp + 0x18]
mov r8, rcx
mov rcx, qword [rax]
mov r11, rcx
mov eax, 0
mov r10, rax
mov rcx, r10
mov rdx, r11
call sub.msvcrt.dll__spawnvp
mov qword [rbp - 0x170], rax
lea rax, [rbp - 0x58]
mov r10, rax
mov rcx, r10
call fcn.00407895
lea rax, [rbp - 0x144]
mov r11, rax
lea rax, [rbp - 0x58]
mov r10, rax
mov rcx, r10
mov rdx, r11
call fcn.00407a64
cmp eax, 0
jne 0x401660
mov eax, dword [rbp - 0x134]
cmp eax, 0x30
jne 0x40162e
lea rax, [rbp - 0x130]
mov r10, rax
mov rcx, r10
call sub.kernel32.dll_DeleteFileA
jmp 0x40164f
mov eax, dword [rbp - 0x134]
cmp eax, 0x35
jne 0x40164f
lea rax, [rbp - 0x130]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll__rmdir
lea rax, [rbp - 0x58]
mov r10, rax
mov rcx, r10
call fcn.004078de
jmp 0x4015e3
lea rax, [rbp - 0x58]
mov r10, rax
mov rcx, r10
call fcn.00407813
mov rax, qword [rbp - 8]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_free
lea rax, [0x0040910c]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll__chdir
mov rax, qword [rbp - 0x18]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll__rmdir
mov rax, qword [rbp - 0x18]
mov r10, rax
mov rcx, r10
call sub.msvcrt.dll_free
mov eax, dword [rbp - 0x170]
leave
ret