Function at 0x402870
Capabilities:
Check if file exists
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x26c
mov eax, dword [0x42b260]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x14]
xor ebx, ebx
mov dword [ebp - 0x268], eax
mov dword [ebp - 0x264], edi
cmp dword [ebp + 0x10], ebx
jne 0x402b36
cmp esi, ebx
je 0x402ba2
push dword [eax*4 + 0x42b0c8]
push 0x3e9
push dword [0x42d850]
call dword [sym.imp.USER32.dll_SetDlgItemTextA]
jmp 0x402b36
cmp dword [0x42d848], ebx
jne 0x402ba2
mov eax, dword [ebp - 0x268]
sub eax, ebx
je 0x402ad2
dec eax
je 0x40290a
dec eax
je 0x4028fc
dec eax
jne 0x402afc
push dword [esi + 0x10]
call fcn.004042f1
jmp 0x402904
push dword [esi + 0x10]
call fcn.004064cd
pop ecx
jmp 0x402afc
mov eax, dword [esi + 0x10]
push dword [eax]
push str.CroInfo
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40292a
cmp dword [0x42d240], ebx
jne 0x402afc
mov eax, dword [esi + 0x10]
push ebx
push dword [eax]
push dword [0x42d524]
call fcn.00409bb7
add esp, 0xc
test eax, eax
jne 0x402afc
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
lea eax, [ebp - 0x25c]
push eax
push dword [0x42d524]
call fcn.0040ad30
add esp, 0x20
test eax, eax
jne 0x402afc
push dword [0x42d524]
call fcn.0040bd70
pop ecx
test eax, eax
jne 0x402afc
push dword [ebp - 0x240]
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
push dword [ebp - 0x240]
mov dword [ebp - 0x260], eax
push eax
push dword [0x42d524]
call fcn.0040b2d0
add esp, 0xc
test eax, eax
js 0x402ab8
mov eax, dword [esi + 0x10]
push dword [eax + 4]
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
mov eax, dword [esi + 0x10]
push dword [eax]
call fcn.00404d8f
pop ecx
push eax
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
cmp dword [ebp + 0x10], ebx
jne 0x402a04
lea eax, [ebp - 0x108]
push eax
push 0x3e8
push dword [0x42d850]
call dword [sym.imp.USER32.dll_SetDlgItemTextA]
cmp dword [0x42d6c0], ebx
je 0x402a2a
mov eax, dword [esi + 0x10]
test byte [eax + 8], 4
je 0x402a2a
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x402afc
mov edi, 0x80
push edi
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push ebx
push edi
push 2
push ebx
push 2
push 0x40000000
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x402a7c
push ebx
lea eax, [ebp - 0x26c]
push eax
push dword [ebp - 0x240]
push dword [ebp - 0x260]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x402aab
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x20c]
push 0x422750
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
push ebx
lea eax, [ebp - 0x20c]
push eax
push dword [0x42d850]
call fcn.00406fca
add esp, 0x18
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0x264]
push dword [0x42d524]
call fcn.0040b560
pop ecx
push dword [ebp - 0x260]
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x402afc
cmp dword [ebp + 0x10], ebx
jne 0x402aed
mov eax, dword [esi + 0x10]
push dword [eax]
push 0x3e8
push dword [0x42d850]
call dword [sym.imp.USER32.dll_SetDlgItemTextA]
mov eax, dword [esi + 0x10]
push dword [eax]
call fcn.00409886
pop ecx
test eax, eax
je 0x402b40
mov eax, dword [edi]
fild dword [edi]
mov esi, dword [esi]
test eax, eax
jns 0x402b0c
fadd dword [0x42274c]
fadd dword [0x42d84c]
call fcn.0040f046
mov dword [edi], eax
cmp dword [ebp + 0x10], ebx
jne 0x402b36
push ebx
push eax
push 0x402
push 0x3ec
push dword [0x42d850]
call dword [sym.imp.USER32.dll_SendDlgItemMessageA]
cmp esi, ebx
jne 0x4028cb
jmp 0x402ba2
mov eax, dword [esi + 0x10]
push dword [eax]
lea eax, [ebp - 0x20c]
push 0x422730
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
push ebx
lea eax, [ebp - 0x20c]
push eax
push dword [0x42d850]
call fcn.00406fca
add esp, 0x18
cmp dword [ebp + 0x10], ebx
jne 0x402b9f
push ebx
push 0x7d1
push 0x111
push dword [0x42d38c]
call dword [sym.imp.USER32.dll_PostMessageA]
cmp dword [0x42d3fc], ebx
jne 0x402b9f
push 5
push dword [0x42d38c]
call dword [sym.imp.USER32.dll_ShowWindow]
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040e67e
leave
ret