Function at 0x4013e0
Capabilities:
Accept command line arguments
Read file on windows
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x414]
sub esp, 0x414
push 0xffffffffffffffff
push 0x4022e8
mov eax, dword fs:[0]
push eax
sub esp, 0x28
mov eax, dword [0x404048]
xor eax, ebp
mov dword [ebp + 0x410], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 0x420]
xor edi, edi
push edi
mov dword [ebp - 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
push edi
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call sub.mfc90u.dll_AfxWinInit
test eax, eax
jne 0x401461
call dword [sym.imp.MSVCR90.dll___iob_func]
add eax, 0x40
push eax
push str.Fatal_Error:_MFC_initialization_failed
call dword [sym.imp.MSVCR90.dll_fputws]
add esp, 8
lea eax, [edi + 0xa]
jmp 0x40180e
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
mov dword [ebp - 4], edi
call sub.mfc90u.dll_AfxGetModuleState
mov esi, dword [eax + 8]
push 0x104
push 0x104
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CSimpleStringT_wchar_t_1_::ReleaseBuffer]
push 0x5c
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::ReverseFind]
cmp eax, edi
jge 0x4014ba
push str.CwExpandres.dll
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::operator]
jmp 0x401503
inc eax
push eax
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::Left]
push str.CwExpandres.dll
push eax
lea edx, [ebp - 0x1c]
push edx
mov byte [ebp - 4], 1
call fcn.00401120
add esp, 0xc
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 2
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::operator_1]
lea ecx, [ebp - 0x1c]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 0
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_]
push eax
call sub.mfc90u.dll_AfxLoadLibrary
mov dword [0x404078], eax
cmp eax, edi
jne 0x40158e
lea ecx, [ebp - 0x18]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
lea ecx, [ebp - 0x24]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
push 0xf10d
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 4
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::LoadStringW]
mov eax, dword [ebp - 0x14]
push eax
lea ecx, [ebp - 0x18]
call dword [sym.imp.mfc90u.dll_]
push eax
lea ecx, [ebp - 0x24]
push ecx
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::Format]
add esp, 0xc
push edi
push 0x30
lea ecx, [ebp - 0x24]
call dword [sym.imp.mfc90u.dll_]
push eax
call sub.mfc90u.dll_AfxMessageBox
lea ecx, [ebp - 0x24]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
lea ecx, [ebp - 0x18]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
xor eax, eax
jmp 0x40180e
mov esi, eax
call sub.mfc90u.dll_AfxGetModuleState
mov dword [eax + 0xc], esi
mov esi, 1
cmp dword [ebp + 0x41c], esi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], edi
mov byte [ebp - 0x1d], 1
mov bl, 1
jle 0x4017cd
mov edi, dword [sym.imp.MSVCR90.dll_wcstoul]
jmp 0x4015c0
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + esi*4]
movzx ecx, word [eax]
cmp cx, 0x2f
je 0x401665
cmp cx, 0x2d
je 0x401665
cmp byte [ebp - 0x1d], 0
je 0x4015f6
push 0x10
push 0
push eax
call edi
add esp, 0xc
mov dword [ebp - 0x18], eax
mov byte [ebp - 0x1d], 0
jmp 0x401609
test bl, bl
je 0x401609
push 0x10
push 0
push eax
call edi
add esp, 0xc
mov dword [ebp - 0x1c], eax
xor bl, bl
inc esi
cmp esi, dword [ebp + 0x41c]
jl 0x4015c0
test bl, bl
jne 0x4017cd
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov byte [ebp - 4], 7
mov edx, dword [ebp - 0x18]
push 0
lea eax, [ebp - 0x24]
push eax
push 0x208
lea ecx, [ebp + 0x208]
push ecx
push edx
call ebx
test eax, eax
jne 0x4016bd
mov eax, dword [0x404078]
test eax, eax
je 0x401655
push eax
call sub.mfc90u.dll_AfxFreeLibrary
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
xor eax, eax
jmp 0x40180e
mov edx, eax
cmp word [edx + 2], 0x3f
jne 0x401683
call fcn.00401080
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
xor eax, eax
jmp 0x40180e
lea ecx, [ebp - 0x18]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + esi*4]
push ecx
lea edx, [ebp - 0x18]
push 1
push edx
mov byte [ebp - 4], 5
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::FormatMessageW]
add esp, 0xc
lea ecx, [ebp - 0x18]
call dword [sym.imp.mfc90u.dll_]
push eax
call fcn.004010f0
lea ecx, [ebp - 0x18]
jmp 0x4017f7
mov ecx, dword [ebp - 0x1c]
push 0
lea eax, [ebp - 0x24]
push eax
push 0xa
push str.more
push ecx
call edi
test eax, eax
jne 0x4016e5
push 0x403690
lea edx, [ebp - 0x28]
push edx
mov dword [ebp - 0x28], eax
call sub.MSVCR90.dll__CxxThrowException
mov edx, dword [ebp - 0x18]
push 0
lea eax, [ebp - 0x24]
push eax
push 0x208
lea ecx, [ebp]
push ecx
push edx
call ebx
test eax, eax
jne 0x40170f
mov dword [ebp - 0x2c], eax
push 0x403690
lea eax, [ebp - 0x2c]
push eax
call sub.MSVCR90.dll__CxxThrowException
lea edx, [ebp]
lea ecx, [ebp + 0x208]
mov esi, str.done
mov byte [ebp - 4], 8
call fcn.00401250
mov dword [ebp - 4], 7
jmp 0x401752
push 0
lea ecx, [ebp - 0x24]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea edx, [eax + eax + 2]
mov eax, dword [ebp - 0x1c]
push edx
push esi
push eax
call edi
test eax, eax
jne 0x40162a
push 0x403690
lea ecx, [ebp - 0x30]
push ecx
mov dword [ebp - 0x30], eax
call sub.MSVCR90.dll__CxxThrowException
lea ecx, [ebp - 0x1c]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
push 5
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 0xb
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::LoadStringW]
lea ecx, [ebp - 0x1c]
call dword [sym.imp.mfc90u.dll_]
push eax
call fcn.004010f0
add esp, 4
lea ecx, [ebp - 0x1c]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
mov eax, 0x4017bd
ret
lea ecx, [ebp - 0x1c]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class]
push 2
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 6
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::LoadStringW]
lea ecx, [ebp - 0x1c]
call dword [sym.imp.mfc90u.dll_]
push eax
call fcn.004010f0
lea ecx, [ebp - 0x1c]
add esp, 4
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
lea ecx, [ebp - 0x14]
call dword [sym.imp.mfc90u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x410]
xor ecx, ebp
call fcn.0040187c
add ebp, 0x414
mov esp, ebp
pop ebp
ret