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

Disassembly:
sub esp, 0x2c
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov dword [esp + 0x10], 0x12345678
lea eax, [esi + 0x170]
lea ecx, [esi + 0x168]
push eax
call fcn.00402646
lea eax, [esp + 0x18]
lea edi, [esi + 0x64]
push eax
push edi
call dword [sym.imp.MSVCRT.dll__stat]
mov eax, dword [esp + 0x34]
add esp, 8
test eax, eax
mov dword [0x404024], eax
jne 0x401fde
push eax
push 0x404258
push 0x404234
mov ecx, esi
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [esi + 0x16c], eax
test eax, eax
jne 0x40200e
push eax
push 0x404258
push 0x404210
mov ecx, esi
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret
push 0x4040b8
push edi
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
jne 0x40204f
mov ecx, dword [esi + 0x16c]
push ecx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ecx, esi
push edi
push 0x404258
push 0x4041f0
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret
mov edx, dword [0x404024]
mov eax, dword [esi + 0x16c]
push edi
push edx
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fread]
mov ebx, eax
push edi
mov dword [esp + 0x28], ebx
call dword [sym.imp.MSVCRT.dll_fclose]
mov edx, dword [0x404024]
add esp, 0x14
cmp ebx, edx
je 0x4020ad
mov ecx, dword [esi + 0x16c]
push ecx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ecx, esi
push 0
push 0x404258
push 0x4041c4
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret
add edx, 0xfffffffc
xor edi, edi
test edx, edx
jbe 0x4020f0
mov ebp, dword [esi + 0x16c]
xor eax, eax
lea ecx, [edi + ebp]
mov bl, byte [ecx]
cmp bl, byte [esp + eax + 0x10]
jne 0x4020d0
inc eax
inc ecx
cmp eax, 4
jb 0x4020c1
cmp eax, 4
je 0x4020de
add edi, 4
cmp edi, edx
jb 0x4020bc
jmp 0x4020f0
mov edx, dword [0x404020]
mov dword [edi + ebp], edx
mov eax, dword [0x404024]
mov dword [edi + ebp + 4], eax
mov ecx, dword [0x404024]
add ecx, 0xfffffffc
cmp edi, ecx
jb 0x40212a
mov edx, dword [esi + 0x16c]
push edx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ecx, esi
push 0
push 0x404258
push 0x4041a0
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret
mov eax, dword [esi + 0x170]
lea ecx, [esp + 0x18]
push ecx
push eax
call dword [sym.imp.MSVCRT.dll__stat]
add esp, 8
test eax, eax
jne 0x40236e
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40236e
mov eax, dword [esi + 0x178]
mov ebx, dword [sym.imp.MSVCRT.dll_fopen]
push 0x4040b4
push eax
call ebx
mov edi, eax
add esp, 8
test edi, edi
jne 0x40219c
mov edx, dword [esi + 0x16c]
push edx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ecx, esi
push edi
push 0x404258
push 0x404174
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 0x16c]
push edi
push eax
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ebp, eax
mov eax, dword [esi + 0x170]
push 0x4040b8
push eax
call ebx
mov ebx, eax
add esp, 0x18
test ebx, ebx
jne 0x4021f6
mov edx, dword [esi + 0x16c]
push edx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ecx, esi
push ebx
push 0x404258
push 0x40414c
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret
push edi
push 4
lea eax, [esp + 0x34]
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ecx, dword [0x404024]
mov edx, dword [esi + 0x16c]
push ebx
push ecx
push 1
push edx
add ebp, eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x20
test eax, eax
je 0x402257
push edi
push eax
mov eax, dword [esi + 0x16c]
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ecx, dword [0x404024]
mov edx, dword [esi + 0x16c]
push ebx
push ecx
push 1
push edx
add ebp, eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x20
test eax, eax
jne 0x402226
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esi + 0x174]
lea ecx, [esp + 0x1c]
push ecx
push eax
call dword [sym.imp.MSVCRT.dll__stat]
add esp, 0xc
test eax, eax
jne 0x402341
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x402341
mov eax, dword [esi + 0x174]
push 0x4040b8
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x4022ce
mov edx, dword [esi + 0x16c]
push edx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ecx, esi
push ebx
push 0x404258
push 0x404124
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret
mov eax, dword [0x404024]
mov ecx, dword [esi + 0x16c]
push ebx
push eax
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
test eax, eax
je 0x40231b
mov edx, dword [esi + 0x16c]
push edi
push eax
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ecx, dword [esi + 0x16c]
add ebp, eax
mov eax, dword [0x404024]
push ebx
push eax
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x20
test eax, eax
jne 0x4022eb
push ebx
mov ebx, dword [sym.imp.MSVCRT.dll_fclose]
call ebx
push edi
call ebx
mov edx, dword [esi + 0x16c]
push edx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0xc
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov eax, dword [esi + 0x16c]
push eax
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ecx, esi
push 0
push 0x404258
push 0x4040fc
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret
mov ecx, dword [esi + 0x16c]
push ecx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ecx, esi
push 0
push 0x404258
push 0x4040d4
call sub.MFC42.DLL_CWnd::MessageBoxA
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2c
ret