Function at 0x40d1d0
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x426ac4
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc3c
push ebx
push ebp
mov ebx, ecx
push esi
push edi
mov dword [esp + 0x14], ebx
lea edi, [ebx + 4]
mov dword [edi], 0
mov dword [esp + 0xc54], 0
mov dword [ebx + 8], 0
mov eax, dword [esp + 0xc68]
mov eax, dword [eax]
test eax, eax
mov dword [ebx + 0xc], eax
je 0x40d22a
add eax, 8
push eax
call dword [0x4280ec]
mov ebp, dword [esp + 0xc60]
mov dword [ebx], 0x4286a8
mov byte [esp + 0xc54], 2
mov eax, dword [ebp]
test eax, eax
je 0x40d648
mov eax, dword [eax]
test eax, eax
je 0x40d648
push eax
call dword [0x42858c]
test eax, eax
jbe 0x40d648
mov eax, dword [ebp]
test eax, eax
je 0x40d26e
mov eax, dword [eax]
jmp 0x40d270
xor eax, eax
push eax
call dword [0x4285bc]
test eax, eax
jne 0x40d56b
call fcn.00401f30
mov esi, eax
test esi, esi
je 0x40d648
mov ecx, edi
call fcn.00405fc0
mov dword [edi], 0
mov ecx, dword [esi]
push edi
push esi
call dword [ecx + 0x78]
test eax, eax
jl 0x40d648
push ebp
lea ecx, [ebx + 8]
call fcn.0040d670
mov esi, dword [esp + 0xc64]
mov ecx, edi
mov dword [ebx + 0x10], esi
call fcn.00405620
mov edx, dword [eax]
push 0xffffffffffffffff
push eax
call dword [edx + 0x4c]
mov ecx, edi
call fcn.00405620
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x50]
test esi, esi
je 0x40d319
push 0x42e1c0
lea ecx, [esp + 0x14]
call fcn.00401020
lea edx, [esp + 0x10]
mov ecx, ebx
push edx
mov byte [esp + 0xc58], 3
call fcn.0040d750
lea ecx, [esp + 0x10]
mov esi, eax
mov byte [esp + 0xc54], 2
call fcn.00401660
jmp 0x40d554
mov eax, dword [ebp]
mov dword [esp + 0x18], 0
test eax, eax
je 0x40d32c
mov eax, dword [eax]
jmp 0x40d32e
xor eax, eax
push eax
call dword [0x4285d0]
test eax, eax
je 0x40d3aa
push ebp
lea ecx, [esp + 0x30]
call fcn.0040d6e0
mov ebx, dword [eax]
mov ebp, dword [eax + 4]
mov esi, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov ecx, edi
mov byte [esp + 0xc54], 4
mov dword [esp + 0x28], eax
call fcn.00405620
lea edx, [esp + 0x18]
mov ecx, dword [eax]
push edx
sub esp, 0x10
mov edx, esp
push eax
mov dword [edx], ebx
mov dword [edx + 4], ebp
mov dword [edx + 8], esi
mov esi, dword [esp + 0x40]
mov dword [edx + 0xc], esi
call dword [ecx + 0x30]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x2c]
push eax
mov byte [esp + 0xc58], 2
call dword [0x428588]
test eax, eax
jge 0x40d544
push eax
call fcn.004253d0
jmp 0x40d544
mov dword [esp + 0x10], 0x80004005
call fcn.00401f30
test eax, eax
je 0x40d548
mov ecx, dword [eax]
push eax
call dword [ecx + 0x6c]
mov esi, eax
test esi, esi
je 0x40d548
mov ebp, dword [ebp]
test ebp, ebp
je 0x40d3db
mov eax, dword [ebp]
jmp 0x40d3dd
xor eax, eax
mov edx, dword [esi]
push eax
push 0
push esi
call dword [edx + 0x10]
mov ebp, eax
test ebp, ebp
jle 0x40d548
push ebp
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40d544
mov ecx, ebp
xor eax, eax
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0xc60]
mov eax, dword [eax]
test eax, eax
je 0x40d429
mov eax, dword [eax]
jmp 0x40d42b
xor eax, eax
mov ecx, dword [esi]
push ebp
push ebx
push eax
push 0
push esi
call dword [ecx + 0x14]
lea edx, [esp + 0x244]
mov ecx, 0x82
xor eax, eax
lea edi, [esp + 0x244]
push edx
push 0x104
rep stosd dword es:[edi], eax
call dword [0x4280e0]
mov ecx, 0x82
xor eax, eax
lea edi, [esp + 0x3c]
rep stosd dword es:[edi], eax
mov eax, dword [0x42e1b8]
mov ecx, eax
inc eax
mov dword [0x42e1b8], eax
lea eax, [esp + 0x3c]
push eax
push ecx
lea ecx, [esp + 0x24c]
push 0x42e1b0
push ecx
call dword [0x4280e4]
lea edx, [esp + 0x3c]
push 0x42e1a8
push edx
call dword [sym.imp.MSVCRT.dll__wfopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x40d53a
push esi
push 1
push ebp
push ebx
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
lea eax, [esp + 0x3c]
lea ecx, [esp + 0x1c]
push eax
call fcn.0040d720
mov ecx, dword [eax + 0xc]
mov edx, dword [esp + 0x14]
mov esi, dword [eax]
mov edi, dword [eax + 4]
mov ebp, dword [eax + 8]
mov dword [esp + 0x38], ecx
lea ecx, [edx + 4]
mov byte [esp + 0xc54], 5
call fcn.00405620
lea edx, [esp + 0x18]
mov ecx, dword [eax]
push edx
sub esp, 0x10
mov edx, esp
push eax
mov dword [edx], esi
mov esi, dword [esp + 0x50]
mov dword [edx + 4], edi
mov dword [edx + 8], ebp
mov dword [edx + 0xc], esi
call dword [ecx + 0x30]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x1c]
push eax
mov byte [esp + 0xc58], 2
call dword [0x428588]
test eax, eax
jge 0x40d52f
push eax
call fcn.004253d0
lea ecx, [esp + 0x3c]
push ecx
call dword [0x4280e8]
push ebx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ebx, dword [esp + 0x14]
cmp word [esp + 0x18], 0
je 0x40d55c
mov esi, dword [esp + 0x10]
test esi, esi
jge 0x40d648
push 0
lea ecx, [ebx + 4]
call fcn.004055f0
jmp 0x40d648
mov eax, dword [esp + 0xc5c]
lea edx, [esp + 0x44c]
push 0x400
push edx
push eax
call dword [0x4280c0]
lea ecx, [esp + 0x44c]
push ecx
call dword [0x4285c8]
mov ebp, dword [ebp]
test ebp, ebp
je 0x40d5a0
mov ebp, dword [ebp]
jmp 0x40d5a2
xor ebp, ebp
lea edx, [esp + 0x44c]
push ebp
lea eax, [esp + 0x450]
push edx
push eax
call dword [0x4285cc]
push 0xc
call sub.MFC42u.DLL_operatornew
add esp, 4
mov dword [esp + 0x18], eax
test eax, eax
mov byte [esp + 0xc54], 6
je 0x40d5e4
lea ecx, [esp + 0x44c]
push ecx
mov ecx, eax
call fcn.00401ed0
jmp 0x40d5e6
xor eax, eax
test eax, eax
mov byte [esp + 0xc54], 2
mov dword [esp + 0x10], eax
jne 0x40d600
push 0x8007000e
call fcn.004253d0
mov edx, dword [esp + 0xc64]
lea eax, [esp + 0x10]
push edx
push eax
mov ecx, ebx
mov byte [esp + 0xc5c], 7
call fcn.00401840
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40d648
mov esi, eax
add eax, 8
push eax
call dword [0x4280f0]
test eax, eax
jne 0x40d648
test esi, esi
je 0x40d648
mov ecx, esi
call fcn.00401740
push esi
call fcn.0041eb90
add esp, 4
mov ecx, dword [esp + 0xc4c]
pop edi
pop esi
mov eax, ebx
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0xc48
ret 0x10