Function at 0x4040c5
Capabilities:
Check if file exists
Get file attributes
Get file size
Set file attributes
Write file on windows

Disassembly:
mov eax, 0x433204
call fcn.004269c8
sub esp, 0x438
mov eax, dword [0x44de90]
push ebx
push esi
push edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x14], eax
push 0x104
lea eax, [ebp - 0x21c]
xor ebx, ebx
push eax
push dword [ebp + 8]
mov byte [ebp - 0x425], bl
mov byte [ebp - 0x426], bl
mov dword [ebp - 0x430], ebx
mov dword [ebp - 0x434], ebx
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
test eax, eax
jne 0x40412a
push dword [ebp + 8]
lea eax, [ebp - 0x21c]
push eax
call fcn.00425600
pop ecx
pop ecx
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
mov esi, str.c:_autoexec.bat
push esi
call dword [0x451df8]
mov edi, eax
xor eax, eax
cmp edi, 0xffffffff
setne al
xor ecx, ecx
cmp edi, ebx
setne cl
mov dword [ebp - 0x430], edi
test ecx, eax
je 0x4043bf
push ebx
push edi
mov dword [ebp - 0x438], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
xor eax, eax
cmp edi, ebx
setne al
xor ecx, ecx
cmp edi, 0xffffffff
setne cl
mov dword [ebp - 0x43c], edi
test ecx, eax
je 0x4043bf
lea eax, [edi + 1]
push eax
call fcn.00425520
pop ecx
push ebx
lea ecx, [ebp - 0x438]
push ecx
push edi
push eax
push dword [ebp - 0x430]
mov dword [ebp - 0x434], eax
call dword [0x451e3c]
cmp eax, ebx
je 0x4043ab
mov eax, dword [ebp - 0x434]
mov ecx, dword [ebp - 0x438]
push str.win
mov byte [ecx + eax], bl
push eax
call fcn.00425fe0
mov edi, eax
cmp edi, ebx
pop ecx
pop ecx
je 0x4042e7
lea eax, [ebp - 0x320]
push 0xa
push edi
mov dword [ebp - 0x444], eax
call fcn.00426a30
cmp eax, ebx
pop ecx
pop ecx
jne 0x404209
push edi
call fcn.00425700
pop ecx
jmp 0x40420c
sub eax, edi
dec eax
mov dword [ebp - 0x42c], eax
add eax, 0xfffffffe
push eax
lea eax, [edi + 3]
push eax
lea eax, [ebp - 0x424]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
push ebx
push ebx
lea eax, [ebp - 0x444]
push eax
lea eax, [ebp - 0x424]
push eax
call fcn.004212f0
add esp, 0x10
push 0x104
lea eax, [ebp - 0x118]
push eax
lea eax, [ebp - 0x320]
push eax
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
test eax, eax
jne 0x404271
lea eax, [ebp - 0x320]
push eax
lea eax, [ebp - 0x118]
push eax
call fcn.00425600
pop ecx
pop ecx
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x118]
push eax
call fcn.0042766e
test eax, eax
pop ecx
pop ecx
jne 0x4042d9
lea eax, [edi - 1]
cmp byte [eax], 0x40
jne 0x40429a
inc dword [ebp - 0x42c]
mov edi, eax
mov eax, dword [ebp - 0x42c]
add eax, edi
push eax
call fcn.004269e7
push eax
push edi
mov dword [ebp - 0x440], eax
call fcn.00425600
push dword [ebp - 0x440]
call fcn.00425476
mov eax, dword [ebp - 0x42c]
sub dword [ebp - 0x43c], eax
add esp, 0x10
sub edi, 3
mov byte [ebp - 0x426], 1
push 0x434c18
add edi, 3
push edi
jmp 0x4041d5
cmp byte [ebp - 0x426], bl
je 0x4043ab
push dword [ebp - 0x430]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov edi, 0x80
push edi
push esi
mov dword [ebp - 0x440], eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push ebx
push edi
push 2
push ebx
push 1
push 0x40000000
push esi
call dword [0x451df8]
mov edi, eax
xor eax, eax
cmp edi, 0xffffffff
setne al
xor ecx, ecx
cmp edi, ebx
setne cl
mov dword [ebp - 0x430], edi
test ecx, eax
je 0x40437b
push ebx
lea eax, [ebp - 0x438]
push eax
push dword [ebp - 0x43c]
push dword [ebp - 0x434]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40437b
mov eax, dword [ebp - 0x43c]
cmp dword [ebp - 0x438], eax
jne 0x40437b
mov byte [ebp - 0x425], 1
push dword [ebp - 0x440]
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
jmp 0x4043ab
cmp dword [ebp - 0x434], ebx
je 0x4043bf
push dword [ebp - 0x434]
call fcn.00425476
pop ecx
push dword [ebp - 0x430]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0xc]
mov al, byte [ebp - 0x425]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x14]
call fcn.00425221
pop edi
pop esi
pop ebx
leave
ret