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

Disassembly:
push 0xffffffffffffffff
push 0x40f390
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x10
push ebx
push ebp
mov ebp, ecx
push esi
push edi
lea ecx, [ebp + 0x20]
mov dword [esp + 0x1c], ecx
call sub.MFC42.DLL_CString::Empty
mov eax, dword [ebp + 4]
mov ecx, 0x415aa4
test al, 0x40
je 0x405f2d
mov ecx, 0x415aa0
jmp 0x405f36
test al, 0x20
je 0x405f36
mov ecx, 0x413120
mov eax, dword [esp + 0x30]
push ecx
push eax
mov dword [ebp], 0
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [ebp], eax
test eax, eax
jne 0x405f5f
mov ecx, ebp
call fcn.00405d70
jmp 0x40622c
mov ecx, dword [ebp + 4]
xor ebx, ebx
test cl, 0x10
mov byte [esp + 0x30], 1
mov dword [ebp + 0x18], 1
je 0x40613c
mov esi, dword [sym.imp.MSVCRT.dll_fseek]
push 2
push ebx
push eax
call esi
mov ecx, dword [ebp]
push ecx
call dword [sym.imp.MSVCRT.dll_ftell]
mov edx, dword [ebp]
push ebx
push ebx
push edx
mov dword [ebp + 0x10], eax
call esi
mov eax, dword [ebp + 0x10]
mov esi, 0x400
add esp, 0x1c
cmp eax, esi
mov dword [esp + 0x10], esi
jge 0x405fbb
test eax, eax
mov dword [esp + 0x10], eax
je 0x406184
mov esi, eax
push esi
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [esp + 0x18], eax
test esi, esi
je 0x405fef
mov ecx, dword [ebp]
push ecx
push 1
push esi
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 1
sete al
test al, al
mov byte [esp + 0x30], al
je 0x40612a
mov ecx, dword [ebp + 4]
xor edi, edi
and ecx, 0xfffffffa
mov dword [ebp + 4], ecx
mov eax, dword [0x413420]
test eax, eax
je 0x406069
mov eax, 0x413424
mov esi, dword [eax]
test esi, esi
jle 0x406028
cmp ebx, dword [esp + 0x10]
jge 0x406028
mov ecx, dword [esp + 0x18]
mov edx, dword [eax - 4]
mov cl, byte [ecx + ebx]
cmp cl, byte [edx + ebx]
jne 0x406028
inc ebx
cmp ebx, esi
jl 0x40600e
cmp ebx, esi
je 0x40603b
mov ecx, dword [eax + 0xc]
add eax, 0x10
inc edi
xor ebx, ebx
test ecx, ecx
jne 0x406008
jmp 0x406065
mov esi, dword [ebp + 4]
shl edi, 4
mov eax, edi
mov edx, dword [eax + 0x41342c]
or edx, esi
cmp ebx, 2
mov dword [ebp + 4], edx
jne 0x406056
mov dword [ebp + 0x18], ebx
mov eax, dword [eax + 0x413428]
lea ecx, [ebp + 0x24]
push eax
call sub.MFC42.DLL_CString::operator
mov esi, dword [esp + 0x10]
cmp esi, ebx
jle 0x40607d
mov ecx, dword [ebp]
push 0
push ebx
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test ebx, ebx
jne 0x40610a
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString_3
mov edx, dword [esp + 0x10]
mov esi, dword [esp + 0x18]
push edx
lea ecx, [esp + 0x18]
mov dword [esp + 0x2c], ebx
call sub.MFC42.DLL_CString::GetBuffer
mov edi, eax
mov eax, dword [esp + 0x10]
mov ecx, eax
push eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::ReleaseBuffer
push ecx
mov ecx, dword [esp + 0x18]
mov eax, esp
lea edx, [esp + 0x14]
mov dword [esp + 0x14], esp
push edx
mov dword [eax], ecx
call fcn.00408e50
add esp, 8
push eax
lea ecx, [ebp + 0x24]
mov byte [esp + 0x2c], 1
call fcn.0040e364
lea ecx, [esp + 0x10]
mov byte [esp + 0x28], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
mov dword [esp + 0x28], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov eax, dword [ebp + 0x24]
lea ecx, [ebp + 0x24]
mov edx, dword [eax - 8]
test edx, edx
jne 0x40612a
mov edx, dword [esp + 0x18]
cmp byte [edx], 0x3c
jne 0x40612a
push str.UTF_8
call sub.MFC42.DLL_CString::operator
mov eax, dword [esp + 0x18]
push eax
call sub.MFC42.DLL_operatordelete
add esp, 4
jmp 0x4061de
test cl, 0x20
je 0x406184
test cl, 0x40
je 0x406161
push 2
push 0
push eax
call dword [sym.imp.MSVCRT.dll_fseek]
mov ecx, dword [ebp]
push ecx
call dword [sym.imp.MSVCRT.dll_ftell]
add esp, 0x10
mov dword [ebp + 0x10], eax
mov eax, dword [0x413420]
xor ecx, ecx
test eax, eax
je 0x406184
mov edx, dword [ebp + 4]
mov eax, 0x413420
test dword [eax + 0xc], edx
jne 0x406192
mov esi, dword [eax + 0x10]
add eax, 0x10
inc ecx
test esi, esi
jne 0x406174
test byte [ebp + 4], 0x40
je 0x4061ef
mov edx, dword [ebp + 0x10]
mov dword [ebp + 0x14], edx
jmp 0x4061f2
shl ecx, 4
mov esi, ecx
mov ebx, dword [esi + 0x413424]
cmp ebx, 2
jne 0x4061a5
mov dword [ebp + 0x18], ebx
mov edx, dword [esi + 0x413428]
lea ecx, [ebp + 0x24]
push edx
call sub.MFC42.DLL_CString::operator
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x4061bf
xor ebx, ebx
jmp 0x406184
mov eax, dword [ebp]
mov ecx, dword [esi + 0x413420]
push eax
push 1
push ebx
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
cmp eax, 1
sete byte [esp + 0x30]
mov al, byte [esp + 0x30]
test al, al
jne 0x406184
mov ecx, ebp
call fcn.00405d70
jmp 0x40622c
mov dword [ebp + 0x14], ebx
test ebx, ebx
je 0x406228
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
push 0
call fcn.004016c0
push ecx
mov ecx, esp
mov dword [esp + 0x2c], esp
push 0x415a9c
call fcn.004016c0
mov eax, dword [esp + 0x30]
push eax
call fcn.00404950
add esp, 0x18
mov al, byte [esp + 0x30]
mov ecx, dword [esp + 0x20]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x1c
ret 4