Function at 0x140041970
Capabilities:
Create directory
Get common file path
Get system information on windows
Print debug messages
Write file on windows

Disassembly:
mov qword [rsp + 8], rcx
push rbp
lea rbp, [rsp - 0x1950]
mov eax, 0x1a50
call fcn.140145640
sub rsp, rax
cmp byte [reloc.d2d1.dll_Ordinal_1], 0
je 0x140041f78
mov qword [rsp + 0x1a68], rbx
xor ecx, ecx
mov qword [rsp + 0x1a30], r13
mov byte [reloc.d2d1.dll_Ordinal_1], 0
call fcn.140010630
call qword [sym.imp.dbghelp.dll_SymGetOptions]
mov ecx, 0x80000050
call qword [sym.imp.dbghelp.dll_SymSetOptions]
call fcn.1400356c0
mov r8d, 0x104
lea rdx, [rbp + 0x3c0]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov edx, 0x5c
lea rcx, [rbp + 0x3c0]
call fcn.140166a3c
mov byte [rax], 0
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov r13d, 1
lea rdx, [rbp + 0x3c0]
mov rcx, rax
mov r8d, r13d
call qword [sym.imp.dbghelp.dll_SymInitialize]
test eax, eax
jne 0x140041a32
xor r9d, r9d
lea r8, str.Message
lea rdx, str.VExceptionHandler_Win:_Symbol_server_could_not_be_initialized.
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxA]
xor edx, edx
lea rcx, [rbp + 0x4d0]
mov r8d, 0x410
call fcn.1401666a0
mov r8d, 0x206
lea rdx, [rbp + 0x4d0]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x140041a73
lea rdx, [0x1401c1270]
lea rcx, [rbp + 0x4d0]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
lea rcx, [rbp + 0x4d0]
nop word [rax + rax]
movzx eax, word [rcx]
add rcx, 2
test ax, ax
jne 0x140041a80
nop dword [rax]
movzx eax, word [rcx - 2]
lea rdx, [rbp + 0x4d0]
add rcx, 0xfffffffffffffffe
cmp rcx, rdx
je 0x140041aaa
cmp ax, 0x5c
jne 0x140041a90
xor edx, edx
cmp ax, 0x5c
cmovne rcx, rdx
lea rbx, [rcx + 2]
test rcx, rcx
jne 0x140041ac4
lea rbx, [rbp + 0x4d0]
mov rdx, rbx
lea rcx, [rbp + 0x1510]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
mov rdx, rbx
lea rcx, [rbp + 0x8e0]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
mov edx, 0x2e
lea rcx, [rbp + 0x8e0]
call fcn.140166d68
test rax, rax
je 0x140041b12
mov edx, 0x2e
lea rcx, [rbp + 0x8e0]
call fcn.140166d68
xor ebx, ebx
mov word [rax], bx
jmp 0x140041b14
xor ebx, ebx
xor edx, edx
lea rcx, [rbp - 0x50]
mov r8d, 0x410
call fcn.1401666a0
xor r9d, r9d
lea rax, [rbp - 0x50]
xor r8d, r8d
mov qword [rsp + 0x20], rax
xor ecx, ecx
lea edx, [r9 + 5]
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jns 0x140041b56
lea rcx, str.Error_getting_my_documents_directory_r_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x140041f68
lea rcx, [rbp - 0x50]
sub rcx, 2
nop
cmp word [rcx + 2], 0
lea rcx, [rcx + 2]
jne 0x140041b60
mov eax, dword [0x1401c12e0]
xor edx, edx
movups xmm0, xmmword [str.BFD_Drums]
movups xmmword [rcx], xmm0
mov dword [rcx + 0x10], eax
movzx eax, word [0x1401c12e4]
mov word [rcx + 0x14], ax
lea rcx, [rbp - 0x50]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
cmp eax, 3
jne 0x140041bac
lea rcx, [0x1401c1300]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x140041f68
lea rax, [rbp - 0x50]
sub rax, 2
cmp word [rax + 2], 0
lea rax, [rax + 2]
jne 0x140041bb4
movups xmm0, xmmword [str.Crash_Logs]
lea rcx, [rbp - 0x50]
xor edx, edx
movsd xmm1, qword [0x1401c12f8]
movups xmmword [rax], xmm0
movsd qword [rax + 0x10], xmm1
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
cmp eax, 3
jne 0x140041bf9
lea rcx, str.Error_creating_crash_log_directory_r_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x140041f68
lea rcx, [rbp - 0x50]
mov qword [rsp + 0x1a28], r14
sub rcx, 2
nop dword [rax]
cmp word [rcx + 2], 0
lea rcx, [rcx + 2]
jne 0x140041c10
mov eax, dword [0x1401c1104]
mov dword [rcx], eax
lea rcx, [rsp + 0x40]
mov word [rbp + 0xcf0], bx
call qword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx ecx, word [rsp + 0x4a]
movzx edx, word [rsp + 0x48]
movzx eax, word [rsp + 0x4c]
movzx r10d, word [rsp + 0x46]
movzx r9d, word [rsp + 0x42]
movzx r8d, word [rsp + 0x40]
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x30], ecx
lea rcx, [rbp + 0xcf0]
mov dword [rsp + 0x28], edx
lea rdx, str._02d._02d._02d__02d_02d__02d
mov dword [rsp + 0x20], r10d
call qword [sym.imp.USER32.dll_wsprintfW]
lea rcx, [rbp - 0x50]
sub rcx, 2
cmp word [rcx + 2], 0
lea rcx, [rcx + 2]
jne 0x140041c83
lea r8, [rbp + 0xcf0]
xor edx, edx
nop word [rax + rax]
movzx eax, word [r8 + rdx*2]
mov word [rcx + rdx*2], ax
lea rdx, [rdx + 1]
test ax, ax
jne 0x140041ca0
lea rcx, [rbp - 0x50]
sub rcx, 2
nop word [rax + rax]
cmp word [rcx + 2], 0
lea rcx, [rcx + 2]
jne 0x140041cc0
lea r8, [rbp + 0x8e0]
xor edx, edx
nop dword [rax]
nop dword [rax + rax]
movzx eax, word [r8 + rdx*2]
mov word [rcx + rdx*2], ax
lea rdx, [rdx + 1]
test ax, ax
jne 0x140041ce0
lea rcx, [rbp - 0x50]
sub rcx, 2
nop word [rax + rax]
cmp word [rcx + 2], 0
lea rcx, [rcx + 2]
jne 0x140041d00
mov eax, dword [0x1401c113c]
lea rdx, [rbp - 0x50]
mov dword [rcx], eax
lea rcx, [rbp + 0x1100]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
lea rcx, [rbp - 0x50]
sub rcx, 2
nop dword [rax]
cmp word [rcx + 2], 0
lea rcx, [rcx + 2]
jne 0x140041d30
movups xmm0, xmmword [0x1401c13e0]
mov eax, dword [0x1401c13f0]
xor r9d, r9d
mov qword [rsp + 0x30], rbx
xor r8d, r8d
movups xmmword [rcx], xmm0
mov dword [rcx + 0x10], eax
mov edx, 0x40000000
lea rcx, [rbp - 0x50]
mov dword [rsp + 0x28], 0x80000080
mov dword [rsp + 0x20], 2
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r14, rax
cmp rax, 0xffffffffffffffff
jne 0x140041d93
lea rcx, str.Error_creating_exception_report_r_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x140041f60
mov qword [rsp + 0x1a48], rsi
mov r9d, 2
mov qword [rsp + 0x1a40], rdi
xor r8d, r8d
mov qword [rsp + 0x1a38], r12
xor edx, edx
mov rcx, r14
mov qword [rsp + 0x1a20], r15
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
lea rcx, [rbp - 0x80]
call qword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov edi, dword [rbp - 0x7c]
xor edx, edx
mov eax, 0x40000000
mov rsi, rbx
div rdi
mov r15, rbx
mov r12, rax
shl r12, 2
test r12, r12
je 0x140041e5f
mov rcx, rsi
lea rdx, [rsp + 0x50]
imul rcx, rdi
mov r8d, 0x30
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
xor edx, edx
test rax, rax
je 0x140041e4a
mov rax, qword [rsp + 0x68]
test rax, rax
je 0x140041e4a
div rdi
cmp dword [rsp + 0x70], 0x1000
mov rbx, rax
jne 0x140041e55
mov rdx, qword [rsp + 0x58]
cmp rdx, r15
jbe 0x140041e55
mov r8d, r13d
mov rcx, r14
mov r15, rdx
call fcn.1400421a0
test al, al
je 0x140041e55
inc r13d
jmp 0x140041e55
mov eax, 0x10000
div rdi
mov rbx, rax
add rsi, rbx
cmp rsi, r12
jb 0x140041df0
xor ebx, ebx
lea r8, str.Crash.txt
mov rcx, r14
lea rdx, str._r_n__end_of__s___r_n
call fcn.140042410
cmp dword [0x14024d900], 0
mov r15, qword [rsp + 0x1a20]
mov r12, qword [rsp + 0x1a38]
mov rdi, qword [rsp + 0x1a40]
mov rsi, qword [rsp + 0x1a48]
jle 0x140041ed1
lea rcx, [0x140245900]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
lea r9, [rbp + 0x1970]
mov qword [rsp + 0x20], rbx
lea rdx, [0x140245900]
mov rcx, r14
lea r8d, [rax + rax]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [0x14024d900], ebx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, [rbp + 0x1100]
sub rcx, 2
cmp word [rcx + 2], 0
lea rcx, [rcx + 2]
jne 0x140041ee5
movups xmm0, xmmword [str.Crash.dmp]
mov eax, dword [0x1401c14a8]
xor r9d, r9d
mov qword [rsp + 0x30], rbx
xor r8d, r8d
movups xmmword [rcx], xmm0
mov dword [rcx + 0x10], eax
mov edx, 0x40000000
lea rcx, [rbp + 0x1100]
mov dword [rsp + 0x28], 0x80000080
mov dword [rsp + 0x20], 2
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x140041f51
mov rdx, qword [rbp + 0x1960]
mov rcx, rax
call fcn.1400420f0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
call qword [sym.imp.dbghelp.dll_SymCleanup]
mov r14, qword [rsp + 0x1a28]
mov rbx, qword [rsp + 0x1a68]
mov r13, qword [rsp + 0x1a30]
xor eax, eax
add rsp, 0x1a50
pop rbp
ret