Function at 0x40a970
Capabilities:
Check if file exists
Create directory
Get file attributes
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x41515c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x29c
mov eax, dword [esp + 0x2ac]
push ebx
mov ebx, ecx
push ebp
lea ecx, [eax + eax*8]
push esi
shl ecx, 3
sub ecx, eax
push edi
shl ecx, 4
mov eax, dword [ecx + ebx + 0x6b0]
lea ebp, [ecx + ebx]
test eax, eax
mov dword [esp + 0x28], ebp
je 0x40ad5f
lea eax, [ebp + 0x348]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
mov esi, dword [sym.imp.MSVCRT.dll_swprintf]
add esp, 4
test eax, eax
jbe 0x40aa28
mov ecx, 0x13
xor eax, eax
lea edi, [esp + 0x56]
mov word [esp + 0x54], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp + 0x348]
lea edx, [esp + 0x54]
push eax
push edx
call esi
mov ax, word [esp + 0x86]
mov cx, word [esp + 0x88]
lea edx, [esp + 0x24]
mov word [esp + 0x24], ax
push edx
mov word [esp + 0x2a], cx
mov word [esp + 0x2c], 0
call dword [sym.imp.MSVCRT.dll__wtoi]
add esp, 0xc
jmp 0x40aa2f
mov eax, dword [ebp + 0x26c]
inc eax
mov dword [esp + 0x10], eax
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0xa6]
mov word [esp + 0xa4], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov eax, dword [ebx + 0x25c]
lea ecx, [esp + 0xa4]
add eax, 0x43
push eax
push str._c:JdvrFileCapFile_
push ecx
call esi
add esp, 0xc
lea edx, [esp + 0xa4]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40aa82
test al, 0x10
jne 0x40aad8
mov eax, dword [ebx + 0x25c]
lea ecx, [esp + 0xa4]
add eax, 0x43
push eax
push str._c:JdvrFile_
push ecx
call esi
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
add esp, 0xc
lea edx, [esp + 0xa4]
push 0
push edx
call edi
mov eax, dword [ebx + 0x25c]
lea ecx, [esp + 0xa4]
add eax, 0x43
push eax
push str._c:JdvrFileCapFile_
push ecx
call esi
add esp, 0xc
lea edx, [esp + 0xa4]
push 0
push edx
call edi
lea eax, [esp + 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov edx, dword [esp + 0x4a]
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x48]
and edx, 0xffff
push ecx
mov ecx, dword [esp + 0x4a]
and eax, 0xffff
push edx
mov edx, dword [esp + 0x4c]
push eax
mov eax, dword [esp + 0x4e]
and ecx, 0xffff
and edx, 0xffff
push ecx
mov ecx, dword [esp + 0x4e]
and eax, 0xffff
push edx
mov edx, dword [esp + 0x50]
push eax
mov eax, dword [ebx + 0x25c]
and ecx, 0xffff
and edx, 0xffff
push ecx
add eax, 0x43
push edx
push eax
lea ecx, [esp + 0xc8]
push str._c:JdvrFileCapFile_.4d_.2d_.2d_.2d_.2d_.2d_.3d_.2d.bmp
push ecx
call esi
mov eax, dword [ebp + 0x6a8]
mov ebp, dword [ebp + 0x6ac]
mov esi, ebp
add esp, 0x2c
imul esi, eax
push 0
push 0x80
push 2
push 0
push 3
lea edx, [esp + 0xb8]
push 0x40000000
push edx
mov dword [esp + 0x40], eax
mov dword [esp + 0x30], ebp
shl esi, 2
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
lea eax, [esp + 0xa4]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40ad37
lea ecx, [esp + 0x10]
call sub.MFC42u.DLL_CString::CString_3
xor ecx, ecx
lea eax, [esi + 0x36]
mov dword [esp + 0x2c], ecx
lea edi, [esp + 0x54]
mov dword [esp + 0x30], ecx
mov dword [esp + 0x2e], eax
mov dword [esp + 0x34], ecx
xor eax, eax
mov word [esp + 0x38], cx
mov ecx, 0xa
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x14]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
xor edx, edx
mov dword [esp + 0x58], ecx
lea ecx, [esp + 0x18]
mov dword [esp + 0x2b4], edx
mov dword [esp + 0x18], edx
mov dword [esp + 0x64], edx
push edx
push ecx
lea edx, [esp + 0x34]
mov dword [esp + 0x64], eax
push 0xe
mov eax, 0x12c
push edx
push ebp
mov word [esp + 0x40], 0x4d42
mov dword [esp + 0x4a], 0x36
mov dword [esp + 0x68], 0x28
mov word [esp + 0x74], 1
mov word [esp + 0x76], 0x20
mov dword [esp + 0x7c], esi
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], eax
call edi
lea eax, [esp + 0x18]
push 0
push eax
lea ecx, [esp + 0x5c]
push 0x28
push ecx
push ebp
call edi
mov eax, dword [esp + 0x28]
lea edx, [esp + 0x18]
push 0
push edx
mov ecx, dword [eax + 0x6b0]
push esi
push ecx
push ebp
call edi
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0xa4]
mov eax, dword [esp + 0x2bc]
and edx, 0xffff
inc eax
push edx
push eax
push ecx
mov ecx, esp
mov dword [esp + 0x30], esp
push 0x41b074
call sub.MFC42u.DLL_CString::CString_2
push ecx
mov byte [esp + 0x2c4], 1
mov ecx, esp
mov dword [esp + 0x60], esp
push str.default.lang
call sub.MFC42u.DLL_CString::CString_2
push ecx
mov byte [esp + 0x2c8], 2
mov ecx, esp
mov dword [esp + 0x30], esp
push str.SAVEPICTURE
call sub.MFC42u.DLL_CString::CString_2
lea ecx, [esp + 0x28]
mov byte [esp + 0x2c8], 0
push ecx
call fcn.00404dc0
add esp, 0x10
mov ecx, eax
mov byte [esp + 0x2bc], 3
call fcn.00408a80
lea edx, [esp + 0x18]
push eax
push edx
call sub.MFC42u.DLL_CString::Format
add esp, 0x10
lea ecx, [esp + 0x14]
mov byte [esp + 0x2b4], 0
call sub.MFC42u.DLL_CString::CString
mov ecx, dword [ebx + 0x16518]
lea eax, [esp + 0x10]
push eax
call fcn.004136c0
lea ecx, [esp + 0x10]
mov dword [esp + 0x2b4], 0xffffffff
call sub.MFC42u.DLL_CString::CString
jmp 0x40ad42
test ebp, ebp
je 0x40ad42
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x28]
mov ecx, dword [esi + 0x6b0]
push ecx
call sub.MFC42u.DLL_operatordelete
add esp, 4
mov dword [esi + 0x6b0], 0
mov ecx, dword [esp + 0x2ac]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x2a8
ret 4