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

Disassembly:
push 0xffffffffffffffff
push 0x41df80
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, 0x427d64
test al, 0x40
je 0x40c8fd
mov ecx, 0x42a608
jmp 0x40c906
test al, 0x20
je 0x40c906
mov ecx, 0x42709c
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 0x40c92f
mov ecx, ebp
call fcn.0040c740
jmp 0x40cbfc
mov ecx, dword [ebp + 4]
xor ebx, ebx
test cl, 0x10
mov byte [esp + 0x30], 1
mov dword [ebp + 0x18], 1
je 0x40cb0c
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 0x40c98b
test eax, eax
mov dword [esp + 0x10], eax
je 0x40cb54
mov esi, eax
push esi
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [esp + 0x18], eax
test esi, esi
je 0x40c9bf
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 0x40cafa
mov ecx, dword [ebp + 4]
xor edi, edi
and ecx, 0xfffffffa
mov dword [ebp + 4], ecx
mov eax, dword [0x428038]
test eax, eax
je 0x40ca39
mov eax, 0x42803c
mov esi, dword [eax]
test esi, esi
jle 0x40c9f8
cmp ebx, dword [esp + 0x10]
jge 0x40c9f8
mov ecx, dword [esp + 0x18]
mov edx, dword [eax - 4]
mov cl, byte [ecx + ebx]
cmp cl, byte [edx + ebx]
jne 0x40c9f8
inc ebx
cmp ebx, esi
jl 0x40c9de
cmp ebx, esi
je 0x40ca0b
mov ecx, dword [eax + 0xc]
add eax, 0x10
inc edi
xor ebx, ebx
test ecx, ecx
jne 0x40c9d8
jmp 0x40ca35
mov esi, dword [ebp + 4]
shl edi, 4
mov eax, edi
mov edx, dword [eax + 0x428044]
or edx, esi
cmp ebx, 2
mov dword [ebp + 4], edx
jne 0x40ca26
mov dword [ebp + 0x18], ebx
mov eax, dword [eax + 0x428040]
lea ecx, [ebp + 0x24]
push eax
call fcn.00406060
mov esi, dword [esp + 0x10]
cmp esi, ebx
jle 0x40ca4d
mov ecx, dword [ebp]
push 0
push ebx
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test ebx, ebx
jne 0x40cada
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString_2
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.0040f7c0
add esp, 8
push eax
lea ecx, [ebp + 0x24]
mov byte [esp + 0x2c], 1
call sub.MFC42.DLL_CString::operator_1
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 0x40cafa
mov edx, dword [esp + 0x18]
cmp byte [edx], 0x3c
jne 0x40cafa
push str.UTF_8
call fcn.00406060
mov eax, dword [esp + 0x18]
push eax
call sub.MFC42.DLL_operatordelete
add esp, 4
jmp 0x40cbae
test cl, 0x20
je 0x40cb54
test cl, 0x40
je 0x40cb31
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 [0x428038]
xor ecx, ecx
test eax, eax
je 0x40cb54
mov edx, dword [ebp + 4]
mov eax, 0x428038
test dword [eax + 0xc], edx
jne 0x40cb62
mov esi, dword [eax + 0x10]
add eax, 0x10
inc ecx
test esi, esi
jne 0x40cb44
test byte [ebp + 4], 0x40
je 0x40cbbf
mov edx, dword [ebp + 0x10]
mov dword [ebp + 0x14], edx
jmp 0x40cbc2
shl ecx, 4
mov esi, ecx
mov ebx, dword [esi + 0x42803c]
cmp ebx, 2
jne 0x40cb75
mov dword [ebp + 0x18], ebx
mov edx, dword [esi + 0x428040]
lea ecx, [ebp + 0x24]
push edx
call fcn.00406060
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40cb8f
xor ebx, ebx
jmp 0x40cb54
mov eax, dword [ebp]
mov ecx, dword [esi + 0x428038]
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 0x40cb54
mov ecx, ebp
call fcn.0040c740
jmp 0x40cbfc
mov dword [ebp + 0x14], ebx
test ebx, ebx
je 0x40cbf8
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
push 0
call fcn.00411e20
push ecx
mov ecx, esp
mov dword [esp + 0x2c], esp
push 0x42a604
call fcn.00411e20
mov eax, dword [esp + 0x30]
push eax
call fcn.0040b300
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