Function at 0x40d110
Capabilities:
Write file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x498572
push eax
mov eax, 0x5470
mov dword fs:[0], esp
call fcn.00496a60
mov eax, dword [0x4bc410]
xor eax, esp
mov dword [esp + 0x546c], eax
lea ecx, [esp + 0x5480]
mov dword [esp + 0x5478], 1
call dword [sym.imp.MFC71.DLL_ATL::CSimpleStringT::IsEmpty]
test al, al
lea ecx, [esp + 0x5480]
je 0x40d17a
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea ecx, [esp + 0x5484]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
xor eax, eax
jmp 0x40d428
push ebx
push ebp
push edi
call dword [sym.imp.MFC71.DLL_ATL::CSimpleStringT::operator_char_const_]
push eax
call fcn.00493ef5
mov ebp, eax
xor eax, eax
xor ebx, ebx
add esp, 4
cmp ebp, ebx
mov ecx, 0x41
lea edi, [esp + 0x270]
rep stosd dword es:[edi], eax
je 0x40d1c0
lea ecx, [esp + 0x5490]
call dword [sym.imp.MFC71.DLL_ATL::CSimpleStringT::operator_char_const_]
push eax
lea eax, [esp + 0x274]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
cmp byte [esp + 0x270], bl
je 0x40d1fe
lea ecx, [esp + 0x270]
push ecx
call fcn.004088b0
add esp, 4
test eax, eax
jne 0x40d1fe
lea ecx, [esp + 0x548c]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea ecx, [esp + 0x5490]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
xor eax, eax
jmp 0x40d425
lea edx, [esp + 0x10]
push edx
push ebp
call fcn.004934be
add esp, 8
test eax, eax
jne 0x40d216
cmp dword [esp + 0x10], ebx
je 0x40d1dd
push ebp
call fcn.0049383f
add esp, 4
test eax, eax
jne 0x40d1dd
push esi
jmp 0x40d230
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x170]
rep stosd dword es:[edi], eax
push 0xff
mov ecx, 0x14
lea edi, [esp + 0x20]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x37c]
push eax
push ebx
push ebx
push 0x104
lea ecx, [esp + 0x184]
push ecx
lea edx, [esp + 0x34]
push edx
push ebp
mov dword [esp + 0x398], ebx
call fcn.00493818
add esp, 0x20
test eax, eax
jne 0x40d44b
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea eax, [esp + 0x170]
push eax
call esi
lea ecx, [esp + 0x170]
mov al, byte [eax + ecx - 1]
dec ecx
cmp al, 0x5c
je 0x40d3eb
cmp al, 0x2f
je 0x40d3eb
lea edx, [esp + 0x274]
push edx
lea eax, [esp + 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [esp + 0x6c]
push ecx
call esi
lea edx, [esp + 0x6c]
mov cl, byte [eax + edx - 1]
dec edx
cmp cl, 0x5c
je 0x40d2e8
push 0x4a1f5c
lea eax, [esp + 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 0x170]
push ecx
lea edx, [esp + 0x70]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [esp + 0x6c]
push eax
call dword [sym.imp.MSVCR71.dll__strdup]
mov esi, eax
push 0x5c
push esi
call dword [sym.imp.MSVCR71.dll_strrchr]
add esp, 0xc
xor edi, edi
cmp eax, ebx
je 0x40d327
push esi
mov byte [eax], bl
call fcn.004088b0
add esp, 4
mov edi, eax
push esi
call dword [sym.imp.MSVCR71.dll_free]
add esp, 4
cmp edi, ebx
je 0x40d44b
lea ecx, [esp + 0x6c]
push ecx
call fcn.00408940
add esp, 4
test eax, eax
je 0x40d44b
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
lea edx, [esp + 0x84]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x40d44b
push ebp
call fcn.004941a2
add esp, 4
test eax, eax
jne 0x40d44b
jmp 0x40d390
push 0x5000
lea eax, [esp + 0x480]
push eax
push ebp
call fcn.00493ad0
mov esi, eax
add esp, 0xc
cmp esi, ebx
jle 0x40d3d3
push ebx
lea ecx, [esp + 0x14]
push ecx
push esi
lea edx, [esp + 0x488]
push edx
push edi
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d3d0
cmp dword [esp + 0x10], esi
je 0x40d390
or esi, 0xffffffff
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call fcn.00493cc8
add esp, 4
test eax, eax
jne 0x40d44b
cmp esi, ebx
jl 0x40d44b
push ebp
call fcn.00493881
add esp, 4
test eax, eax
je 0x40d230
push ebp
call fcn.00493f03
add esp, 4
lea ecx, [esp + 0x5490]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea ecx, [esp + 0x5494]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
mov eax, 1
pop esi
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x5470]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x546c]
xor ecx, esp
call fcn.00496ace
add esp, 0x547c
ret
lea ecx, [esp + 0x5490]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea ecx, [esp + 0x5494]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
xor eax, eax
jmp 0x40d424