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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x128
nop
mov eax, dword [0x4080d8]
push eax
mov eax, 1
push eax
call sub.msvcrt.dll_calloc
add esp, 8
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp eax, 0
jne 0x4010d5
mov eax, 1
push eax
call sub.msvcrt.dll_exit
add esp, 4
mov eax, dword [0x4080d8]
push eax
mov eax, dword [0x4080d4]
push eax
mov eax, dword [ebp - 4]
push eax
mov eax, section..data
push eax
call fcn.00402e50
add esp, 0x10
cmp eax, 0
jge 0x40110c
mov eax, 1
push eax
call sub.msvcrt.dll_exit
add esp, 4
mov eax, 0x4080dc
push eax
call sub.msvcrt.dll_getenv
add esp, 4
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
push eax
call sub.msvcrt.dll_strlen
add esp, 4
add eax, 0xe
add eax, 1
push eax
mov eax, 1
push eax
call sub.msvcrt.dll_calloc
add esp, 8
mov dword [ebp - 0xc], eax
mov eax, 0
mov word [ebp - 0xe], ax
mov eax, dword [ebp - 8]
push eax
call sub.msvcrt.dll_strlen
add esp, 4
add eax, 0xf
movzx ecx, word [ebp - 0xe]
push ecx
mov ecx, dword [ebp - 8]
push ecx
mov ecx, str._s_b2ev__hx
push ecx
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.msvcrt.dll__snprintf
add esp, 0x14
mov eax, 0
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.kernel32.dll_CreateDirectoryA
test eax, eax
je 0x401193
mov eax, 0
jmp 0x401198
mov eax, 1
cmp eax, 0
jne 0x4011a6
jmp 0x4011b5
movzx eax, word [ebp - 0xe]
mov ecx, eax
add eax, 1
mov word [ebp - 0xe], ax
jmp 0x40114a
mov eax, dword [ebp - 0xc]
push eax
call sub.msvcrt.dll__chdir
add esp, 4
mov eax, 0x20
push eax
mov eax, 0
push eax
lea eax, [ebp - 0x30]
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
mov eax, dword [ebp - 4]
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x38]
add eax, 4
mov ecx, dword [0x4080d8]
mov dword [eax], ecx
lea eax, [ebp - 0x30]
add eax, 0x10
lea ecx, [ebp - 0x38]
mov dword [eax], ecx
mov eax, section..text
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x30]
add eax, 8
mov ecx, 0x40106d
mov dword [eax], ecx
lea eax, [ebp - 0x30]
add eax, 0xc
mov ecx, 0x401083
mov dword [eax], ecx
mov eax, 0
mov dword [ebp - 0x118], eax
mov eax, 0
mov dword [ebp - 0x11c], eax
lea eax, [ebp - 0x114]
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.00406339
add esp, 8
cmp eax, 0
jne 0x40146e
lea eax, [ebp - 0x114]
add eax, 0x10
mov ecx, dword [eax]
cmp ecx, 0x30
jne 0x4013e7
lea eax, [ebp - 0x114]
add eax, 0x14
mov ecx, 0x4080ec
push ecx
push eax
call sub.msvcrt.dll_fopen
add esp, 8
mov dword [ebp - 0x120], eax
mov eax, dword [ebp - 0x120]
cmp eax, 0
jne 0x4012bd
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
lea ecx, [ebp - 0x114]
add ecx, 0x14
push ecx
mov ecx, str.FATAL:_Cannot_open__s
push ecx
push eax
call sub.msvcrt.dll_fprintf
add esp, 0xc
mov eax, 1
push eax
call sub.msvcrt.dll_exit
add esp, 4
lea eax, [ebp - 0x114]
add eax, 8
mov ecx, dword [ebp - 0x118]
mov edx, dword [eax]
cmp ecx, edx
jae 0x401353
lea eax, [ebp - 0x114]
add eax, 8
mov ecx, dword [eax]
push ecx
mov eax, dword [ebp - 0x11c]
push eax
call sub.msvcrt.dll_realloc
add esp, 8
mov dword [ebp - 0x124], eax
mov eax, dword [ebp - 0x124]
cmp eax, 0
jne 0x401336
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
lea ecx, [ebp - 0x114]
add ecx, 0x14
push ecx
mov ecx, str.FATAL:_Out_of_memory_on_file__s
push ecx
push eax
call sub.msvcrt.dll_fprintf
add esp, 0xc
mov eax, 1
push eax
call sub.msvcrt.dll_exit
add esp, 4
mov eax, dword [ebp - 0x124]
mov dword [ebp - 0x11c], eax
lea eax, [ebp - 0x114]
add eax, 8
mov ecx, dword [eax]
mov dword [ebp - 0x118], ecx
lea eax, [ebp - 0x114]
add eax, 8
mov ecx, dword [eax]
push ecx
mov eax, dword [ebp - 0x11c]
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.004063c7
add esp, 0xc
cmp eax, 0xffffffff
jne 0x4013ab
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
lea ecx, [ebp - 0x114]
add ecx, 0x14
push ecx
mov ecx, str.FATAL:_Incomplete_data_on__s
push ecx
push eax
call sub.msvcrt.dll_fprintf
add esp, 0xc
mov eax, 1
push eax
call sub.msvcrt.dll_exit
add esp, 4
lea eax, [ebp - 0x114]
add eax, 8
mov ecx, dword [ebp - 0x120]
push ecx
mov ecx, 1
push ecx
mov ecx, dword [eax]
push ecx
mov eax, dword [ebp - 0x11c]
push eax
call sub.msvcrt.dll_fwrite
add esp, 0x10
mov eax, dword [ebp - 0x120]
push eax
call sub.msvcrt.dll_fclose
add esp, 4
jmp 0x40145d
lea eax, [ebp - 0x114]
add eax, 0x10
mov ecx, dword [eax]
cmp ecx, 0x35
jne 0x40145d
lea eax, [ebp - 0x114]
add eax, 0x14
mov ecx, 0
push ecx
push eax
call sub.kernel32.dll_CreateDirectoryA
test eax, eax
je 0x40141f
mov eax, 0
jmp 0x401424
mov eax, 1
cmp eax, 0
je 0x40145d
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
lea ecx, [ebp - 0x114]
add ecx, 0x14
push ecx
mov ecx, str.FATAL:_Cant_create_directory__s
push ecx
push eax
call sub.msvcrt.dll_fprintf
add esp, 0xc
mov eax, 1
push eax
call sub.msvcrt.dll_exit
add esp, 4
lea eax, [ebp - 0x30]
push eax
call fcn.004061f1
add esp, 4
jmp 0x401230
mov eax, dword [ebp - 0x11c]
push eax
call sub.msvcrt.dll_free
add esp, 4
mov eax, dword [ebp + 0xc]
mov ecx, str.main.bat
mov dword [eax], ecx
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0xc]
push ecx
mov ecx, dword [eax]
push ecx
mov eax, 0
push eax
call sub.msvcrt.dll__spawnvp
add esp, 0xc
mov dword [ebp - 0x128], eax
lea eax, [ebp - 0x30]
push eax
call fcn.004061b4
add esp, 4
lea eax, [ebp - 0x114]
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.00406339
add esp, 8
cmp eax, 0
jne 0x401529
lea eax, [ebp - 0x114]
add eax, 0x10
mov ecx, dword [eax]
cmp ecx, 0x30
jne 0x4014f5
lea eax, [ebp - 0x114]
add eax, 0x14
push eax
call sub.kernel32.dll_DeleteFileA
jmp 0x40151b
lea eax, [ebp - 0x114]
add eax, 0x10
mov ecx, dword [eax]
cmp ecx, 0x35
jne 0x40151b
lea eax, [ebp - 0x114]
add eax, 0x14
push eax
call sub.msvcrt.dll__rmdir
add esp, 4
lea eax, [ebp - 0x30]
push eax
call fcn.004061f1
add esp, 4
jmp 0x4014b1
lea eax, [ebp - 0x30]
push eax
call fcn.0040614f
add esp, 4
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_free
add esp, 4
mov eax, 0x408174
push eax
call sub.msvcrt.dll__chdir
add esp, 4
mov eax, dword [ebp - 0xc]
push eax
call sub.msvcrt.dll__rmdir
add esp, 4
mov eax, dword [ebp - 0xc]
push eax
call sub.msvcrt.dll_free
add esp, 4
mov eax, dword [ebp - 0x128]
jmp 0x401572
leave
ret