Function at 0x401e50
Capabilities:
Check if file exists
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1244
call fcn.00402c40
push ebx
push esi
push edi
mov dword [ebp - 0x1230], ecx
cmp dword [ebp + 8], 0
je 0x401e97
mov edi, dword [ebp + 8]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
test ecx, ecx
jbe 0x401e97
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x401e97
mov eax, 1
jmp 0x40227c
push 0x404028
mov ecx, dword [ebp - 0x1230]
push ecx
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [ebp - 0x121c], eax
cmp dword [ebp - 0x121c], 0
jne 0x401ec5
mov eax, 2
jmp 0x40227c
push 2
push 0xfffffffffffffff5
mov edx, dword [ebp - 0x121c]
push edx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test eax, eax
je 0x401ef7
mov eax, dword [ebp - 0x121c]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, 3
jmp 0x40227c
mov ecx, dword [ebp - 0x121c]
push ecx
call dword [sym.imp.MSVCRT.dll_ftell]
add esp, 4
mov dword [ebp - 0x1218], eax
mov edx, dword [ebp - 0x121c]
push edx
push 4
push 1
lea eax, [ebp - 0x1228]
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
mov byte [ebp - 0x20d], 0
mov ecx, dword [ebp - 0x121c]
push ecx
push 7
push 1
lea edx, [ebp - 0x214]
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
mov dword [ebp - 0x1234], str._faSig_
lea eax, [ebp - 0x214]
mov dword [ebp - 0x1238], eax
mov ecx, dword [ebp - 0x1238]
mov dl, byte [ecx]
mov byte [ebp - 0x1239], dl
mov eax, dword [ebp - 0x1234]
cmp dl, byte [eax]
jne 0x401fbe
cmp byte [ebp - 0x1239], 0
je 0x401fb2
mov ecx, dword [ebp - 0x1238]
mov dl, byte [ecx + 1]
mov byte [ebp - 0x123a], dl
mov eax, dword [ebp - 0x1234]
cmp dl, byte [eax + 1]
jne 0x401fbe
add dword [ebp - 0x1238], 2
add dword [ebp - 0x1234], 2
cmp byte [ebp - 0x123a], 0
jne 0x401f60
mov dword [ebp - 0x1240], 0
jmp 0x401fc9
sbb ecx, ecx
sbb ecx, 0xffffffff
mov dword [ebp - 0x1240], ecx
mov edx, dword [ebp - 0x1240]
mov dword [ebp - 0x1244], edx
cmp dword [ebp - 0x1244], 0
je 0x401ff8
mov eax, dword [ebp - 0x121c]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, 3
jmp 0x40227c
push 0
mov ecx, dword [ebp - 0x1228]
push ecx
mov edx, dword [ebp - 0x121c]
push edx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test eax, eax
je 0x40202f
mov eax, dword [ebp - 0x121c]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, 4
jmp 0x40227c
mov ecx, dword [ebp - 0x121c]
push ecx
push 4
push 1
lea edx, [ebp - 0x1224]
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
mov eax, dword [ebp - 0x121c]
push eax
mov ecx, dword [ebp - 0x1224]
push ecx
push 1
lea edx, [ebp - 0x104]
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
mov eax, dword [ebp - 0x1224]
mov byte [ebp + eax - 0x104], 0
mov byte [ebp - 0x208], 0
cmp dword [ebp + 8], 0
je 0x4020ab
mov edi, dword [ebp + 8]
lea edx, [ebp - 0x208]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov eax, ecx
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]
lea edi, [ebp - 0x208]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
cmp ecx, 1
jbe 0x402115
lea edi, [ebp - 0x208]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xffffffff
movsx ecx, byte [ebp + ecx - 0x209]
cmp ecx, 0x5c
je 0x402115
mov edi, 0x404034
lea edx, [ebp - 0x208]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
add edi, 0xffffffff
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x104]
lea edx, [ebp - 0x208]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
add edi, 0xffffffff
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [ebp + 0xc], 0
je 0x402168
mov eax, dword [ebp + 0x10]
push eax
lea ecx, [ebp - 0x208]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.MSVCRT.dll_strncpy]
add esp, 0xc
push 0x404030
lea eax, [ebp - 0x208]
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [ebp - 0x20c], eax
cmp dword [ebp - 0x20c], 0
jne 0x4021a6
mov ecx, dword [ebp - 0x121c]
push ecx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, 5
jmp 0x40227c
mov dword [ebp - 0x122c], 0x400
mov dword [ebp - 0x1220], 0x400
mov edx, dword [ebp - 0x121c]
push edx
call dword [sym.imp.MSVCRT.dll_ftell]
add esp, 4
mov dword [ebp - 0x1228], eax
mov eax, dword [ebp - 0x1228]
cmp eax, dword [ebp - 0x1218]
jge 0x402257
mov ecx, dword [ebp - 0x1228]
add ecx, 0x400
cmp ecx, dword [ebp - 0x1218]
jle 0x402204
mov edx, dword [ebp - 0x1218]
sub edx, dword [ebp - 0x1228]
mov dword [ebp - 0x1220], edx
mov eax, dword [ebp - 0x121c]
push eax
mov ecx, dword [ebp - 0x1220]
push ecx
push 1
lea edx, [ebp - 0x1214]
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
mov ecx, dword [ebp - 0x1228]
add ecx, eax
mov dword [ebp - 0x1228], ecx
mov edx, dword [ebp - 0x20c]
push edx
mov eax, dword [ebp - 0x1220]
push eax
push 1
lea ecx, [ebp - 0x1214]
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
jmp 0x4021d0
mov edx, dword [ebp - 0x121c]
push edx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, dword [ebp - 0x20c]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc