Function at 0x40d130
Capabilities:
Write file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x418542
push eax
mov eax, 0x19048
mov dword fs:[0], esp
call fcn.00417600
push esi
push edi
mov edi, ecx
push 0x41ef68
lea ecx, [esp + 0x10]
mov dword [esp + 0x18], edi
mov dword [esp + 0x2c], 0
call sub.MFC42.DLL_CString::CString_2
mov eax, dword [edi + 0x4f4]
mov dword [esp + 0x19058], 1
test eax, eax
je 0x40d48e
push ebx
push ebp
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString_1
mov eax, dword [edi + 0x4f4]
mov byte [esp + 0x19060], 2
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0x18]
add ecx, 0xc
push ecx
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::operator
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::TrimRight
mov edx, dword [esp + 0x10]
mov esi, dword [sym.imp.MSVCRT.dll__mbscmp]
push 0x41ef68
push edx
call esi
add esp, 8
test eax, eax
je 0x40d45f
lea eax, [esp + 0x34]
push 1
push eax
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::Left
mov eax, dword [eax]
push 0x41e154
push eax
mov byte [esp + 0x19068], 3
call esi
add esp, 8
test eax, eax
je 0x40d232
lea ecx, [esp + 0x2c]
push 1
push ecx
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::Left
mov eax, dword [eax]
push 0x41e14c
push eax
call esi
add esp, 8
lea ecx, [esp + 0x2c]
test eax, eax
sete bl
call sub.MFC42.DLL_CString::CString
test bl, bl
je 0x40d234
mov bl, 1
lea ecx, [esp + 0x34]
mov byte [esp + 0x19060], 2
call sub.MFC42.DLL_CString::CString
test bl, bl
push 0x41ef68
je 0x40d309
mov edx, dword [esp + 0x18]
push edx
call esi
add esp, 8
test eax, eax
jne 0x40d2a7
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x20]
mov eax, dword [eax - 8]
dec eax
push eax
push ecx
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::Right
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x19064], 4
call sub.MFC42.DLL_CString::operator_1
lea ecx, [esp + 0x20]
mov byte [esp + 0x19060], 2
call sub.MFC42.DLL_CString::CString
push 0x5c
push 0x2f
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::Replace
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x10]
mov eax, dword [edx - 8]
dec eax
push eax
lea eax, [esp + 0x28]
push eax
call sub.MFC42.DLL_CString::Right
lea ecx, [edi + 0x504]
push eax
lea edx, [esp + 0x3c]
push ecx
push edx
mov byte [esp + 0x1906c], 5
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x19064], 6
call sub.MFC42.DLL_CString::operator_1
lea ecx, [esp + 0x38]
mov byte [esp + 0x19060], 5
call sub.MFC42.DLL_CString::CString
mov byte [esp + 0x19060], 2
lea ecx, [esp + 0x24]
jmp 0x40d366
mov eax, dword [esp + 0x18]
push eax
call esi
add esp, 8
test eax, eax
jne 0x40d332
lea ecx, [esp + 0x10]
push ecx
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::operator_1
push 0x5c
push 0x2f
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::Replace
lea edx, [esp + 0x10]
lea eax, [edi + 0x504]
push edx
lea ecx, [esp + 0x2c]
push eax
push ecx
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x19064], 7
call sub.MFC42.DLL_CString::operator_1
mov byte [esp + 0x19060], 2
lea ecx, [esp + 0x28]
call sub.MFC42.DLL_CString::CString
push 0x5c
push 0x2f
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::Replace
mov edx, dword [esp + 0x10]
push edx
call fcn.00401730
add esp, 4
lea ecx, [esp + 0x3c]
call fcn.004171f2
mov eax, dword [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x44]
mov byte [esp + 0x19068], 8
call sub.MFC42.DLL_CFileFind::FindFile
test eax, eax
jne 0x40d44e
mov ecx, dword [esp + 0x10]
push 0x41e108
push ecx
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x40d44e
mov eax, dword [esp + 0x18]
mov ecx, dword [edi + 0x160]
push 0
mov dl, byte [eax]
mov esi, dword [eax + 4]
mov eax, dword [eax + 8]
and edx, 0x7f
push eax
push ecx
sub esi, edx
call fcn.00401040
add esp, 0xc
test esi, esi
jbe 0x40d444
mov edx, dword [edi + 0x160]
lea eax, [esp + 0x58]
push edx
push 0x19000
push 1
push eax
call fcn.00401000
add esp, 0x10
mov edi, eax
cmp edi, esi
push ebp
ja 0x40d42f
push edi
lea ecx, [esp + 0x60]
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
sub esi, edi
mov edi, dword [esp + 0x1c]
je 0x40d444
jmp 0x40d3f2
push esi
lea edx, [esp + 0x60]
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov edi, dword [esp + 0x2c]
add esp, 0x10
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
lea ecx, [esp + 0x3c]
mov byte [esp + 0x19060], 2
call sub.MFC42.DLL_CFileFind::CFileFind
mov eax, dword [esp + 0x18]
mov ecx, dword [edi + 0x4f4]
mov eax, dword [eax + 0x10c]
cmp eax, ecx
mov dword [esp + 0x18], eax
jne 0x40d1a3
lea ecx, [esp + 0x10]
mov byte [esp + 0x19060], 1
call sub.MFC42.DLL_CString::CString
pop ebp
pop ebx
mov esi, dword [esp + 0x19060]
lea ecx, [esp + 0xc]
push ecx
mov ecx, esi
call fcn.004171fe
mov dword [esp + 0x28], 1
lea ecx, [esp + 0xc]
mov byte [esp + 0x19058], 0
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x19050]
mov eax, esi
pop edi
pop esi
mov dword fs:[0], ecx
add esp, 0x19054
ret 4