Function at 0x40ff80
Capabilities:
Check if file exists
Create directory
Get file attributes

Disassembly:
sub esp, 0x640
mov eax, dword [0x429008]
xor eax, esp
mov dword [esp + 0x63c], eax
push ebx
push ebp
mov ebp, dword [esp + 0x654]
mov ebx, ecx
push esi
mov esi, dword [esp + 0x650]
push edi
mov edi, dword [esp + 0x658]
test dword [esi + 0x58], 0x400000
je 0x40ffcb
push str..mdmp
push edi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40ffd8
cmp byte [ebx + 0xe193], 0
je 0x4101c5
mov edi, dword [esi + 0x18]
xor eax, eax
mov word [esp + 0x240], ax
test edi, edi
je 0x41008c
cmp word [edi], ax
je 0x41008c
push 0x200
push eax
lea eax, [esp + 0x48]
push eax
call sub.VCRUNTIME140.dll_memset
mov eax, dword [esi + 0x24]
add esp, 0xc
xor ecx, ecx
test eax, eax
je 0x41003d
cmp word [eax], cx
je 0x41003d
push ecx
push ecx
push 0xff
lea ecx, [esp + 0x24c]
push ecx
push 0
push 0
push 0
push 0
push eax
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__wsplitpath_s]
add esp, 0x24
mov ecx, 1
test ecx, ecx
lea eax, [esp + 0x240]
mov edx, 0x417708
cmove eax, edx
push eax
mov eax, 0x41f29c
cmove eax, edx
push eax
push str.SQLDmpr
push str._ls_ls_ls
lea eax, [esp + 0x50]
push 0x100
push eax
call fcn.00401fd0
add esp, 0x18
test eax, eax
jns 0x410093
push str.Failed_to_generate_dump_file_name_prefix.
push 1
push 0x429048
call fcn.00404d90
add esp, 0xc
xor eax, eax
jmp 0x4101d7
mov esi, dword [esi + 0x3c]
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
add esp, 4
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__gmtime64_s]
mov ecx, dword [ebx + 0x2def4]
add esp, 8
push ecx
test eax, eax
je 0x4100e4
push esi
lea eax, [esp + 0x48]
push eax
push str._ls._p.0._ls
lea eax, [esp + 0x450]
push 0x104
push eax
call fcn.00401fd0
add esp, 0x18
jmp 0x410124
push dword [esp + 0x20]
mov eax, dword [esp + 0x34]
push dword [esp + 0x28]
inc eax
push dword [esp + 0x30]
push dword [esp + 0x38]
push eax
mov eax, dword [esp + 0x48]
add eax, 0x76c
push eax
push esi
lea eax, [esp + 0x60]
push eax
push str._ls._p.GMT__4d__02d__02d__02d__02d__02d._ls
lea eax, [esp + 0x468]
push 0x104
push eax
call fcn.00401fd0
add esp, 0x30
test eax, eax
jns 0x410132
push str.Failed_to_generate_dump_filename
jmp 0x41007d
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x410142
test al, 0x10
jne 0x41016f
push 0
push edi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x41016f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push str.Failed_to_create_dump_directory__ls___Error_Code__0x_x
push 1
push 0x429048
call fcn.00404d90
add esp, 0x14
xor eax, eax
jmp 0x4101d7
cmp word [ebx + 0xdf8a], 0
lea esi, [ebx + 0xdf8a]
mov ecx, str.Dump_directory_changed_from___ls__to_Watson_WER_temp_folder.
mov eax, str.Dump_directory_is___ls_
push edi
cmovne eax, ecx
push eax
push 2
push 0x429048
call fcn.00404d90
cmp word [esi], 0
lea eax, [esp + 0x450]
push str..dmp
push eax
cmovne edi, esi
push edi
push 0
push 0x104
push ebp
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__wmakepath_s]
add esp, 0x28
mov eax, 1
jmp 0x4101d7
push dword [ebx + 0x2def4]
mov ecx, ebx
push ebp
push edi
push dword [esi + 0x14]
call fcn.00410200
mov ecx, dword [esp + 0x64c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00414600
add esp, 0x640
ret 0xc