Function at 0x4045d4
Capabilities:
Check if file exists
Get file attributes
Get system information on windows
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x368
mov eax, dword [0x40e004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 7
mov ebx, ecx
mov dword [ebp - 0x338], 1
pop ecx
mov esi, 0x4013f8
mov dword [ebp - 0x33c], ebx
lea edi, [ebp - 0xd4]
mov dword [ebp - 0x368], 0x40151c
rep movsd dword es:[edi], dword [esi]
push 6
pop ecx
push 6
movsw word es:[edi], word [esi]
mov esi, 0x401418
mov dword [ebp - 0x364], 0x40153c
lea edi, [ebp - 0x7c]
mov dword [ebp - 0x360], 0x401550
rep movsd dword es:[edi], dword [esi]
pop ecx
push 5
mov dword [ebp - 0x35c], 0x401570
movsw word es:[edi], word [esi]
mov esi, 0x401434
mov dword [ebp - 0x358], 0x401588
lea edi, [ebp - 0x98]
mov dword [ebp - 0x354], 0x4015a4
rep movsd dword es:[edi], dword [esi]
pop ecx
push 5
mov dword [ebp - 0x350], 0x4015d0
movsw word es:[edi], word [esi]
mov dword [ebp - 0x34c], 0x4015e8
mov dword [ebp - 0x348], 0x401614
movsb byte es:[edi], byte [esi]
mov esi, 0x401450
lea edi, [ebp - 0x60]
rep movsd dword es:[edi], dword [esi]
pop ecx
push 5
movsw word es:[edi], word [esi]
mov esi, 0x401468
lea edi, [ebp - 0x48]
rep movsd dword es:[edi], dword [esi]
pop ecx
push 8
movsw word es:[edi], word [esi]
mov esi, 0x401480
lea edi, [ebp - 0x30]
rep movsd dword es:[edi], dword [esi]
pop ecx
push 0xc
movsw word es:[edi], word [esi]
mov esi, 0x401498
lea edi, [ebp - 0xf4]
rep movsd dword es:[edi], dword [esi]
pop ecx
mov esi, 0x4014b8
lea edi, [ebp - 0x22c]
rep movsd dword es:[edi], dword [esi]
push 7
pop ecx
movsw word es:[edi], word [esi]
mov esi, 0x4014ec
lea edi, [ebp - 0x18]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov esi, 0x401500
lea edi, [ebp - 0xb4]
rep movsd dword es:[edi], dword [esi]
xor esi, esi
push esi
push 0x80
mov dword [ebp - 0x344], esi
push 2
push esi
push esi
push 0x40000000
push 0x40f838
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40473b
push esi
push 0x10
push esi
push esi
mov edx, 0x462
mov ecx, ebx
call fcn.00402462
xor eax, eax
jmp 0x404d0e
push 0x200
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
test esi, esi
jne 0x404768
push eax
push 0x10
push eax
push eax
mov edx, 0x44c
mov ecx, ebx
call fcn.00402462
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x404734
push 0x100
lea edx, [ebp - 0x32c]
mov ecx, 0x41c
call fcn.00402774
lea ecx, [ebp - 0x32c]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404786
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [ebp - 0x330]
push 0
push eax
sub ecx, edx
lea eax, [ebp - 0x32c]
push ecx
push eax
push edi
call ebx
push 0x40f93c
lea eax, [ebp - 0xd4]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4047c8
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
push dword [0x4108a8]
lea eax, [ebp - 0x7c]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4047fc
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
push dword [0x4108ac]
lea eax, [ebp - 0x98]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404833
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
push 0x40fa40
lea eax, [ebp - 0x60]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404866
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
push 0x40fb44
lea eax, [ebp - 0x48]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404899
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
test dword [0x4108bc], 0x10000
mov eax, 0x40164c
jne 0x4048c6
mov eax, 0x401654
push eax
lea eax, [ebp - 0x30]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4048de
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
mov eax, dword [0x4108bc]
test eax, 0x20000
je 0x404906
xor eax, eax
inc eax
jmp 0x40491e
test eax, 0x40000
je 0x404912
push 2
pop eax
jmp 0x40491e
and eax, 0x80000
neg eax
sbb eax, eax
and eax, 3
push dword [eax*4 + 0x4017f0]
lea eax, [ebp - 0xf4]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40493f
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
push 0x410390
lea eax, [ebp - 0x22c]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404975
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
push 0x410c60
push 0x104
lea eax, [ebp - 0x1f8]
mov edx, 0x401660
push eax
push 0x40165c
mov ecx, 0x401064
call fcn.00402ad1
lea eax, [ebp - 0x1f8]
push eax
lea eax, [ebp - 0x18]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4049cf
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
push ecx
push 0x15
mov edx, 0x40166c
call fcn.00402b69
test eax, eax
jg 0x4049fa
push 0x15
pop eax
push eax
lea eax, [ebp - 0xb4]
push eax
push 0x200
push esi
call fcn.00401b0d
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404a15
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
and dword [ebp - 0x334], 0
mov edx, 0x40151c
mov ecx, edx
lea eax, [ecx + 1]
mov dword [ebp - 0x340], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404a43
sub ecx, dword [ebp - 0x340]
lea eax, [ebp - 0x330]
push 0
push eax
push ecx
push edx
push edi
call ebx
mov eax, dword [ebp - 0x334]
inc eax
mov dword [ebp - 0x334], eax
mov edx, dword [ebp + eax*4 - 0x368]
test edx, edx
jne 0x404a38
mov eax, dword [0x4108d4]
mov ecx, dword [ebp - 0x338]
mov dword [ebp - 0x334], eax
test eax, eax
je 0x404bfd
push dword [eax + 4]
mov edx, 0x200
mov ecx, esi
call fcn.00401a45
mov eax, dword [ebp - 0x334]
mov edx, 0x200
mov ecx, esi
push dword [eax]
call fcn.00401acd
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x404bda
test al, 0x10
jne 0x404bda
test byte [0x4108bc], 2
je 0x404b28
push 0x401218
mov edx, 0x104
lea ecx, [ebp - 0x1f8]
call fcn.00401a45
test eax, eax
js 0x404734
push esi
mov edx, 0x104
lea ecx, [ebp - 0x1f8]
call fcn.00401acd
test eax, eax
js 0x404734
push 0x401218
mov edx, 0x104
lea ecx, [ebp - 0x1f8]
call fcn.00401acd
test eax, eax
js 0x404734
jmp 0x404b43
push 0x104
lea eax, [ebp - 0x1f8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
test eax, eax
je 0x404bcc
lea ecx, [ebp - 0x1f8]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404b4c
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
lea eax, [ebp - 0x1f8]
push eax
push edi
call ebx
push 0
lea eax, [ebp - 0x330]
push eax
push 2
push 0x401680
push edi
call ebx
mov ecx, eax
mov eax, dword [ebp - 0x334]
mov dword [ebp - 0x338], ecx
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x334], eax
test ecx, ecx
jne 0x404a87
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
cmp dword [ebp - 0x338], eax
jne 0x404d0d
mov ecx, dword [ebp - 0x33c]
mov edx, 0x463
push eax
push 0x10
push eax
push eax
jmp 0x40472f
xor eax, eax
mov edx, 0x46f
push eax
push 0x10
push eax
push eax
jmp 0x404be6
push 0
push 0x10
push 0
push esi
mov edx, 0x46e
mov ecx, dword [ebp - 0x33c]
call fcn.00402462
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x40475f
test ecx, ecx
je 0x404b9b
test byte [0x4108bc], 4
je 0x404b9b
lea eax, [ebp - 0x364]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
push ecx
push 0xffffffffffffffff
mov edx, 0x401684
call fcn.00402b69
mov eax, 0x4017e8
mov dword [ebp - 0x334], eax
cmp dword [ebp - 0x338], 0
je 0x404b9b
push 0
push dword [eax]
xor edx, edx
xor ecx, ecx
call fcn.004027a0
test eax, eax
jne 0x404cd7
push ecx
mov ecx, dword [ebp - 0x334]
lea edx, [ebp - 0x1f8]
mov ecx, dword [ecx]
call fcn.004060f3
test eax, eax
je 0x404cf6
push 0x401218
mov edx, 0x200
mov ecx, esi
call fcn.00401a45
lea eax, [ebp - 0x1f8]
mov edx, 0x200
push eax
mov ecx, esi
call fcn.00401acd
push 0x401218
mov edx, 0x200
mov ecx, esi
call fcn.00401acd
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404ca7
push 0
lea eax, [ebp - 0x330]
sub ecx, edx
push eax
push ecx
push esi
push edi
call ebx
push 0
lea eax, [ebp - 0x330]
push eax
push 2
push 0x401680
push edi
call ebx
mov dword [ebp - 0x338], eax
mov eax, dword [ebp - 0x334]
add eax, 4
mov dword [ebp - 0x334], eax
cmp eax, 0x4017ec
jl 0x404c2f
jmp 0x404b9b
push 0
push 0x10
push 0
lea eax, [ebp - 0x1f8]
mov edx, 0x46d
push eax
jmp 0x404be6
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040cb2e
mov esp, ebp
pop ebp
ret