Function at 0x404e41
Capabilities:
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x407d44
call sub.MSVCRT.dll__EH_prolog
sub esp, 0x3c
push ebx
push esi
mov esi, ecx
push edi
lea ecx, [ebp - 0x20]
call sub.MFC42.DLL_CString::CString_2
and dword [ebp - 4], 0
lea edi, [esi + 0x170]
push edi
lea ecx, [esi + 0x168]
mov byte [ebp - 0xd], 1
call fcn.004070fe
lea eax, [ebp - 0x48]
lea ebx, [esi + 0x64]
push eax
push ebx
call dword [sym.imp.MSVCRT.dll__stat]
mov eax, dword [ebp - 0x34]
pop ecx
test eax, eax
pop ecx
mov dword [0x40a03c], eax
je 0x404fdd
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
test eax, eax
pop ecx
mov dword [esi + 0x16c], eax
je 0x404fdd
push 0x40aa3c
push ebx
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x24], eax
test eax, eax
pop ecx
je 0x404f33
push eax
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push dword [0x40a03c]
push 1
push dword [esi + 0x16c]
call ebx
push dword [ebp - 0x24]
mov dword [ebp - 0x18], eax
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [ebp - 0x18]
add esp, 0x14
cmp eax, dword [0x40a03c]
jne 0x404f33
mov eax, dword [edi]
lea ecx, [ebp - 0x48]
push ecx
push eax
call dword [sym.imp.MSVCRT.dll__stat]
pop ecx
test eax, eax
pop ecx
jne 0x405156
cmp dword [ebp - 0x34], eax
je 0x405156
mov ecx, esi
call fcn.004051cc
test al, al
je 0x404f33
mov edi, dword [edi]
push 0x40aa3c
push edi
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x14], eax
test eax, eax
pop ecx
jne 0x404f44
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_free]
jmp 0x404fdc
push dword [0x40a03c]
call dword [sym.imp.MSVCRT.dll_malloc]
mov edi, eax
pop ecx
test edi, edi
je 0x404fdd
push dword [ebp - 0x14]
push dword [0x40a03c]
push 1
push edi
call ebx
mov ecx, dword [0x40a03c]
add esp, 0x10
add ecx, 0xfffffffb
xor eax, eax
test ecx, ecx
jbe 0x404fa2
cmp byte [eax + edi], 0x78
jne 0x404f9d
cmp byte [eax + edi + 1], 0x78
jne 0x404f9d
cmp byte [eax + edi + 2], 0x70
jne 0x404f9d
cmp byte [eax + edi + 3], 0x69
jne 0x404f9d
cmp byte [eax + edi + 4], 0x6e
je 0x404ff2
inc eax
cmp eax, ecx
jb 0x404f7b
push edi
mov edi, dword [sym.imp.MSVCRT.dll_free]
call edi
push 0
push 0
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esi + 0x178]
push 0x40aa38
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 0x18
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x405013
push dword [esi + 0x16c]
call edi
pop ecx
xor bl, bl
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x20]
call sub.MFC42.DLL_CString::CString
mov al, bl
jmp 0x405171
push dword [esi + 0x16c]
mov esi, dword [sym.imp.MSVCRT.dll_free]
call esi
push edi
call esi
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0xc
mov bl, 1
jmp 0x404fdf
push eax
mov edi, dword [sym.imp.MSVCRT.dll_fwrite]
push dword [ebp - 0x18]
push 1
push dword [esi + 0x16c]
call edi
push dword [ebp - 0x1c]
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x34]
push 4
push 1
push eax
call edi
push dword [ebp - 0x1c]
add dword [ebp - 0x18], eax
lea eax, [ebp - 0x20]
push 4
push 1
push eax
call edi
push dword [ebp - 0x14]
add dword [ebp - 0x18], eax
push dword [0x40a03c]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x40
test eax, eax
je 0x4050c1
cmp byte [ebp - 0xd], 0
je 0x405098
mov ecx, dword [0x40a030]
add ecx, 9
cmp ecx, dword [0x40a03c]
mov dword [ebp - 0x24], ecx
jae 0x405094
mov edx, dword [esi + 0x16c]
add ecx, edx
mov dl, byte [ecx]
not dl
mov byte [ecx], dl
mov ecx, dword [ebp - 0x24]
add ecx, 0x1a
jmp 0x405073
and byte [ebp - 0xd], 0
push dword [ebp - 0x1c]
push eax
push 1
push dword [esi + 0x16c]
call edi
push dword [ebp - 0x14]
add dword [ebp - 0x18], eax
push dword [0x40a03c]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x20
jmp 0x405060
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esi + 0x174]
mov dword [esp], 0x40aa3c
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x14], eax
test eax, eax
pop ecx
je 0x405156
push eax
push dword [0x40a03c]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x10
test eax, eax
je 0x405128
push dword [ebp - 0x1c]
push eax
push 1
push dword [esi + 0x16c]
call edi
push dword [ebp - 0x14]
add dword [ebp - 0x18], eax
push dword [0x40a03c]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x20
jmp 0x4050fb
push dword [ebp - 0x14]
mov edi, dword [sym.imp.MSVCRT.dll_fclose]
call edi
push dword [ebp - 0x1c]
call edi
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0xc
inc dword [0x40c098]
mov byte [esi + 0x1af], 1
jmp 0x405163
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x20]
call sub.MFC42.DLL_CString::CString
xor al, al
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret