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

Disassembly:
mov eax, 0x4084ac
call sub.MSVCRT.dll__EH_prolog
sub esp, 0x3c
push ebx
push esi
mov esi, ecx
push edi
lea ecx, [ebp - 0x24]
call sub.MFC42.DLL_CString::CString_1
and dword [ebp - 4], 0
lea eax, [esi + 0xa34]
push eax
lea ecx, [esi + 0xa2c]
call fcn.004078ee
lea eax, [ebp - 0x48]
lea edi, [esi + 0x68]
push eax
push edi
call dword [sym.imp.MSVCRT.dll__stat]
mov eax, dword [ebp - 0x34]
pop ecx
test eax, eax
pop ecx
mov dword [0x40c04c], eax
jne 0x40625d
xor bl, bl
jmp 0x406370
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
test eax, eax
pop ecx
mov dword [esi + 0xa30], eax
je 0x406256
push 0x40c4f8
push edi
mov edi, dword [sym.imp.MSVCRT.dll_fopen]
call edi
pop ecx
mov dword [ebp - 0x20], eax
test eax, eax
pop ecx
je 0x406361
push eax
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push dword [0x40c04c]
push 1
push dword [esi + 0xa30]
call ebx
push dword [ebp - 0x20]
mov dword [ebp - 0x18], eax
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [ebp - 0x18]
add esp, 0x14
cmp eax, dword [0x40c04c]
jne 0x406361
mov eax, dword [esi + 0xa34]
lea ecx, [ebp - 0x48]
push ecx
push eax
call dword [sym.imp.MSVCRT.dll__stat]
pop ecx
test eax, eax
pop ecx
jne 0x40654e
cmp dword [ebp - 0x34], eax
je 0x40654e
mov ecx, esi
call fcn.004065c4
test al, al
je 0x406361
mov eax, dword [esi + 0xa34]
push 0x40c4f8
push eax
call edi
pop ecx
mov dword [ebp - 0x1c], eax
test eax, eax
pop ecx
je 0x406361
push ecx
lea eax, [esi + 0xa34]
mov ecx, esp
mov dword [ebp - 0x20], esp
push eax
call sub.MFC42.DLL_CString::CString_2
call fcn.0040342a
test al, al
pop ecx
je 0x40633c
push dword [esi + 0xa30]
call dword [sym.imp.MSVCRT.dll_free]
push dword [ebp - 0x1c]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
mov bl, 1
pop ecx
jmp 0x406370
push 0
push 0
push dword [ebp - 0x1c]
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esi + 0xa3c]
push 0x40ce80
push eax
call edi
add esp, 0x14
mov dword [ebp - 0x20], eax
test eax, eax
jne 0x406383
push dword [esi + 0xa30]
xor bl, bl
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x24]
call sub.MFC42.DLL_CString::CString
mov al, bl
jmp 0x406569
push eax
mov edi, dword [sym.imp.MSVCRT.dll_fwrite]
push dword [ebp - 0x18]
push 1
push dword [esi + 0xa30]
call edi
push dword [ebp - 0x20]
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x34]
push 4
push 1
push eax
call edi
push dword [ebp - 0x20]
add dword [ebp - 0x18], eax
lea eax, [ebp - 0x24]
push 4
push 1
push eax
call edi
push dword [ebp - 0x1c]
add dword [ebp - 0x18], eax
mov byte [ebp - 0xd], 1
push dword [0x40c04c]
push 1
push dword [esi + 0xa30]
call ebx
add esp, 0x40
test eax, eax
je 0x406467
cmp byte [ebp - 0xd], 0
je 0x40643b
mov ecx, dword [0x40c040]
add ecx, 9
cmp ecx, dword [0x40c04c]
mov dword [ebp - 0x14], ecx
jae 0x40640c
mov edx, dword [esi + 0xa30]
add ecx, edx
mov dl, byte [ecx]
not dl
mov byte [ecx], dl
mov ecx, dword [ebp - 0x14]
add ecx, 0xd
jmp 0x4063eb
xor ecx, ecx
cmp dword [0x40c04c], ecx
mov dword [ebp - 0x14], ecx
jbe 0x406437
mov edx, dword [esi + 0xa30]
add ecx, edx
mov dl, byte [ecx]
not dl
mov byte [ecx], dl
mov ecx, dword [ebp - 0x14]
inc ecx
inc ecx
cmp ecx, dword [0x40c04c]
mov dword [ebp - 0x14], ecx
jb 0x406419
and byte [ebp - 0xd], 0
push dword [ebp - 0x20]
push eax
push 1
push dword [esi + 0xa30]
call edi
push dword [ebp - 0x1c]
add dword [ebp - 0x18], eax
push dword [0x40c04c]
push 1
push dword [esi + 0xa30]
call ebx
add esp, 0x20
jmp 0x4063d4
push dword [ebp - 0x1c]
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esi + 0xa38]
mov dword [esp], 0x40c4f8
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x1c], eax
test eax, eax
pop ecx
je 0x40654e
push eax
mov byte [ebp - 0xd], 1
push dword [0x40c04c]
push 1
push dword [esi + 0xa30]
call ebx
add esp, 0x10
test eax, eax
je 0x40650b
cmp byte [ebp - 0xd], 0
je 0x4064e2
xor ecx, ecx
cmp dword [0x40c04c], ecx
mov dword [ebp - 0x14], ecx
jbe 0x4064de
mov edx, dword [esi + 0xa30]
add ecx, edx
mov dl, byte [ecx]
not dl
mov byte [ecx], dl
mov ecx, dword [ebp - 0x14]
inc ecx
inc ecx
cmp ecx, dword [0x40c04c]
mov dword [ebp - 0x14], ecx
jb 0x4064c0
and byte [ebp - 0xd], 0
push dword [ebp - 0x20]
push eax
push 1
push dword [esi + 0xa30]
call edi
push dword [ebp - 0x1c]
add dword [ebp - 0x18], eax
push dword [0x40c04c]
push 1
push dword [esi + 0xa30]
call ebx
add esp, 0x20
jmp 0x4064a9
push dword [ebp - 0x20]
mov ecx, dword [0x40c04c]
lea eax, [esi + 0x64]
push 4
push 1
push eax
mov dword [eax], ecx
call edi
push dword [ebp - 0x1c]
mov edi, dword [sym.imp.MSVCRT.dll_fclose]
call edi
push dword [ebp - 0x20]
call edi
push dword [esi + 0xa30]
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0x1c
inc dword [0x40e084]
mov byte [esi + 0xa73], 1
jmp 0x40655b
push dword [esi + 0xa30]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x24]
call sub.MFC42.DLL_CString::CString
xor al, al
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret