Function at 0x408480
Capabilities:
Check if file exists
Clear file content
Get file attributes
Write file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x42de98
push eax
mov dword fs:[0], esp
sub esp, 0x18
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov eax, dword [ebp + 4]
test eax, eax
je 0x4086ae
mov eax, dword [0x43a5b4]
mov dword [esp + 0x18], eax
mov dword [esp + 0x30], 0
mov dword [esp + 0x10], eax
mov byte [esp + 0x30], 1
call dword [sym.imp.KERNEL32.dll_GetACP]
cmp eax, 0x3a4
push str..Setup.ini
jne 0x4084e1
lea eax, [esp + 0x14]
push 0xa6
push eax
jmp 0x4084eb
lea ecx, [esp + 0x14]
push 0xa7
push ecx
call fcn.00426f79
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push str..Setup.ini
call edi
or ebx, 0xffffffff
cmp eax, ebx
je 0x408542
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str..Setup.ini
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
and eax, 1
cmp al, 1
jne 0x408585
mov edx, dword [esp + 0x10]
push 0
push 0x10
push edx
call fcn.00426cc3
jmp 0x408693
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, 2
je 0x408585
push 0
lea eax, [esp + 0x18]
push 0
push eax
push 0x400
push esi
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov ecx, dword [esp + 0x14]
push 0
push 0x10
push ecx
call fcn.00426cc3
jmp 0x408693
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push str..Setup.ini
call edi
mov esi, eax
cmp esi, ebx
jne 0x4085d9
push 0
lea edx, [esp + 0x18]
push 0
push edx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov eax, dword [esp + 0x14]
push 0
push 0x10
push eax
call fcn.00426cc3
jmp 0x408693
mov eax, dword [ebp + 0x14]
xor edi, edi
test eax, eax
mov dword [esp + 0x20], eax
jle 0x40864c
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
add ebp, 8
push edi
mov ecx, ebp
call fcn.0041f302
add eax, 8
lea ecx, [esp + 0x1c]
push eax
call fcn.00423426
push 0x43a424
lea ecx, [esp + 0x20]
mov byte [esp + 0x34], 2
call fcn.004238fb
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x24]
push 0
push edx
mov ecx, dword [eax - 8]
push ecx
push eax
push esi
call ebx
cmp eax, 1
jne 0x4086c3
lea ecx, [esp + 0x1c]
mov byte [esp + 0x30], al
call fcn.004236b1
mov eax, dword [esp + 0x20]
inc edi
cmp edi, eax
jl 0x4085ef
or ebx, 0xffffffff
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
cmp eax, 1
je 0x40873c
push 0
lea edx, [esp + 0x18]
push 0
push edx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov eax, dword [esp + 0x14]
push 0
push 0x10
push eax
call fcn.00426cc3
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x10]
mov byte [esp + 0x30], 0
call fcn.004236b1
lea ecx, [esp + 0x18]
mov dword [esp + 0x30], ebx
call fcn.004236b1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
add esp, 0x24
ret
push 0
lea eax, [esp + 0x18]
push 0
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov ecx, dword [esp + 0x14]
push 0
push 0x10
push ecx
call fcn.00426cc3
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x1c]
mov byte [esp + 0x30], 1
call fcn.004236b1
lea ecx, [esp + 0x10]
mov byte [esp + 0x30], 0
call fcn.004236b1
lea ecx, [esp + 0x18]
mov dword [esp + 0x30], 0xffffffff
call fcn.004236b1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
add esp, 0x24
ret
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x10]
mov byte [esp + 0x30], 0
call fcn.004236b1
lea ecx, [esp + 0x18]
mov dword [esp + 0x30], ebx
call fcn.004236b1
mov ecx, dword [esp + 0x28]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
mov dword fs:[0], ecx
add esp, 0x24
ret