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

Disassembly:
sub esp, 0x104
mov al, byte [0x406630]
push ebx
push ebp
push esi
push edi
mov byte [esp + 0x14], al
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x15]
mov ebp, dword [esp + 0x118]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor ebx, ebx
push 0x406028
push ebp
mov dword [esp + 0x18], ebx
stosb byte es:[edi], al
call dword [sym.imp.MSVCRT.dll_strstr]
add esp, 8
test eax, eax
jne 0x40232f
mov edx, dword [0x406894]
lea ecx, [esp + 0x14]
push 0x100
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call sub.PSAPI.DLL_GetModuleFileNameExA
lea edi, [esp + 0x14]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xfffffffe
cmp ecx, ebx
jle 0x4022db
mov al, 0x5c
cmp byte [esp + ecx + 0x14], al
je 0x4022d7
dec ecx
cmp ecx, ebx
jg 0x4022ca
jmp 0x4022db
mov byte [esp + ecx + 0x14], bl
mov edi, 0x406028
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x14]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x14]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
jmp 0x40234d
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x14]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
lea ecx, [esp + 0x14]
push ecx
call edi
mov ebp, dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
cmp eax, 0xffffffff
je 0x402374
and al, 0xf8
lea edx, [esp + 0x14]
push eax
push edx
call ebp
push ebx
push 0x80
push 2
push ebx
push ebx
lea eax, [esp + 0x28]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4023ba
lea ecx, [esp + 0x14]
push ecx
call edi
cmp eax, esi
je 0x4023aa
or al, 6
lea edx, [esp + 0x14]
push eax
push edx
call ebp
pop edi
pop esi
pop ebp
mov eax, 0xffffff9c
pop ebx
add esp, 0x104
ret
mov ecx, dword [esp + 0x11c]
push ebx
mov ebx, dword [esp + 0x124]
lea eax, [esp + 0x14]
push eax
push ebx
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x10], ebx
je 0x40240a
lea edx, [esp + 0x14]
push edx
call edi
cmp eax, 0xffffffff
je 0x4023f3
or al, 6
push eax
lea eax, [esp + 0x18]
push eax
call ebp
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov eax, 0xffffff9b
pop ebx
add esp, 0x104
ret
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x14]
push ecx
call edi
cmp eax, 0xffffffff
je 0x402427
and al, 0xf9
lea edx, [esp + 0x14]
push eax
push edx
call ebp
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x104
ret