Function at 0x140003590
Capabilities:
Check mutex on windows
Create process on windows
Print debug messages
Set environment variable
Write and execute a file
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x3c8]
sub rsp, 0x4a0
mov qword [rbp - 0x38], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov rax, qword [0x14000b008]
xor rax, rsp
mov qword [rbp + 0x390], rax
xor edx, edx
mov r8d, 0x208
lea rcx, [rbp + 0x180]
call sub.VCRUNTIME140.dll_memset
mov r8d, 0x208
lea rdx, [rbp + 0x180]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov edx, 0x5c
lea rcx, [rbp + 0x180]
call qword [sym.imp.api_ms_win_crt_multibyte_l1_1_0.dll__mbsrchr]
mov byte [rax + 1], 0
lea r8, str.DRWLog.log
mov edx, 0x208
lea rcx, [rbp + 0x180]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strcat_s]
xor edi, edi
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
mov edx, 0xc0000000
lea r8d, [rdi + 1]
lea rcx, [rbp + 0x180]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [rsp + 0x68], rax
lea rax, vtable.CFileMappingLog.0
mov qword [rbp - 0x78], rax
mov r14d, edi
mov qword [rbp - 0x68], rdi
mov esi, edi
mov qword [rbp - 0x58], rdi
mov r12d, edi
mov dword [rbp - 0x50], edi
mov dword [rbp - 0x48], 1
lea rax, str.DRW_1E956C11_4D20_49d7_B4C7_016A342A2D39
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x200000
xor r9d, r9d
xor edx, edx
lea rcx, [rdi - 1]
lea r8d, [rdi + 4]
call qword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov rbx, rax
mov qword [rbp - 0x70], rax
test rax, rax
jne 0x1400036bd
lea rcx, str.Failed_to_create_map_file__n
jmp 0x14000370f
mov qword [rsp + 0x20], 0x200000
xor r9d, r9d
xor r8d, r8d
mov edx, 0xf001f
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov r14, rax
mov qword [rbp - 0x68], rax
test rax, rax
je 0x1400036fb
mov rsi, rax
mov qword [rbp - 0x58], rax
mov r12d, 0x200000
mov dword [rbp - 0x50], r12d
mov dword [rax], edi
jmp 0x140003715
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp - 0x70], rdi
lea rcx, str.Failed_to_map_the_map_file__n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea r8, str.DRWLOG_1BFCF65F_0766_4a71_B7A3_2EB2CD1412DE
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexA]
mov qword [rbp - 0x60], rax
mov dword [rsp + 0x50], edi
lea rcx, str._______Start_DRW.
call qword [sym.imp.PubLog.dll_void___cdecl_DebugTrace_char_const____ptr64_]
xor eax, eax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rax
mov qword [rbp - 0x80], rax
xor edx, edx
lea r8d, [rax + 0x68]
lea rcx, [rbp - 0x30]
call sub.VCRUNTIME140.dll_memset
mov dword [rbp - 0x30], 0x68
xor edx, edx
mov r8d, 0x104
lea rcx, [rbp + 0x70]
call sub.VCRUNTIME140.dll_memset
xor eax, eax
mov qword [rbp + 0x40], rax
mov qword [rbp + 0x48], rax
lea rcx, [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [rbp + 0x4e]
movzx ecx, word [rbp + 0x4c]
movzx edx, word [rbp + 0x4a]
movzx r8d, word [rbp + 0x48]
movzx r10d, word [rbp + 0x46]
movzx r11d, word [rbp + 0x42]
movzx r9d, word [rbp + 0x40]
mov dword [rsp + 0x48], eax
mov dword [rsp + 0x40], ecx
mov dword [rsp + 0x38], edx
mov dword [rsp + 0x30], r8d
mov dword [rsp + 0x28], r10d
mov dword [rsp + 0x20], r11d
lea r8, str.startTS_d__d__d__d:_d:_d:_d
mov edx, 0x103
lea rcx, [rbp + 0x70]
call fcn.1400011a0
lea rdx, [rbp + 0x70]
lea rcx, str.startTS
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
lea rax, [rsp + 0x70]
mov qword [rsp + 0x48], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], rdi
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
lea rdx, str.DRWUI
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateProcessA]
mov dword [rsp + 0x5c], eax
test eax, eax
je 0x140003b0e
mov r15d, edi
mov rdx, qword [rsp + 0x70]
mov qword [rbp + 0x50], rdx
lea rcx, str._______hProcess___X
call qword [sym.imp.PubLog.dll_void___cdecl_DebugTrace_char_const____ptr64_]
mov edi, 1
lea r9, str.DRW_Crash_FC1A0E29_3523_4152_B110_3340363E5DB7
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r13, rax
mov rdx, rax
lea rcx, str._______CrashEvent___X
call qword [sym.imp.PubLog.dll_void___cdecl_DebugTrace_char_const____ptr64_]
test r13, r13
je 0x140003884
mov qword [rbp + 0x58], r13
mov edi, 2
lea r9, str.DRW_Memory_Crash_c3d61a40_a3e6_402b_b373_fd90d30893c8
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
mov qword [rbp - 0x40], rax
mov rdx, rax
lea rcx, str._______MemoryCrashEvent___X
call qword [sym.imp.PubLog.dll_void___cdecl_DebugTrace_char_const____ptr64_]
test r13, r13
je 0x1400038bd
mov ecx, edi
mov qword [rbp + rcx*8 + 0x50], rbx
inc edi
xor eax, eax
mov dword [rsp + 0x54], eax
mov dword [rsp + 0x58], eax
nop word [rax + rax]
mov r9d, 0x1388
xor r8d, r8d
lea rdx, [rbp + 0x50]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov ebx, eax
mov rcx, qword [rsp + 0x68]
dec rcx
cmp rcx, 0xfffffffffffffffd
ja 0x140003963
mov edx, 0x3e8
mov rcx, qword [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x140003956
test r14, r14
je 0x140003956
cmp dword [rsi], r12d
ja 0x140003934
xor eax, eax
mov dword [rsp + 0x60], eax
lea rdx, [rsi + 4]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x60]
mov r8d, dword [rsi]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_WriteFile]
xor eax, eax
mov rsi, r14
mov qword [rbp - 0x58], r14
mov r12d, 0x200000
mov dword [rbp - 0x50], r12d
mov dword [r14], eax
mov rcx, qword [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x140003963
lea rcx, str.Failed_to_request_the_permission_to_write_to_log_file__n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
inc r15d
cmp ebx, 0x102
je 0x1400038d0
cmp ebx, edi
jae 0x1400039c7
mov edx, ebx
lea rcx, str._______Pos___d
call qword [sym.imp.PubLog.dll_void___cdecl_DebugTrace_char_const____ptr64_]
mov rcx, qword [rbp + rbx*8 + 0x50]
cmp rcx, r13
jne 0x1400039b1
cmp dword [rsp + 0x50], 0
je 0x1400039a9
cmp r15d, 1
ja 0x1400039a9
mov dword [rsp + 0x50], 0
jmp 0x1400038d0
mov dword [rsp + 0x58], 1
cmp rcx, qword [rbp - 0x40]
jne 0x1400039c7
mov dword [rsp + 0x50], 1
mov r15d, 1
jmp 0x1400039cc
mov r15d, dword [rsp + 0x54]
cmp edi, 1
jbe 0x1400039ea
lea rbx, [rbp + 0x58]
dec edi
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rbx, [rbx + 8]
sub rdi, 1
jne 0x1400039d7
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r15d, r15d
je 0x140003b71
lea rcx, str._______Start_DRW.
call qword [sym.imp.PubLog.dll_void___cdecl_DebugTrace_char_const____ptr64_]
xor eax, eax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rax
mov qword [rbp - 0x80], rax
xor edx, edx
lea r8d, [rax + 0x68]
lea rcx, [rbp - 0x30]
call sub.VCRUNTIME140.dll_memset
mov dword [rbp - 0x30], 0x68
xor edx, edx
mov r8d, 0x104
lea rcx, [rbp + 0x70]
call sub.VCRUNTIME140.dll_memset
xor eax, eax
mov qword [rbp + 0x40], rax
mov qword [rbp + 0x48], rax
lea rcx, [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [rbp + 0x4e]
movzx ecx, word [rbp + 0x4c]
movzx edx, word [rbp + 0x4a]
movzx r8d, word [rbp + 0x48]
movzx r10d, word [rbp + 0x46]
movzx r11d, word [rbp + 0x42]
movzx r9d, word [rbp + 0x40]
mov dword [rsp + 0x48], eax
mov dword [rsp + 0x40], ecx
mov dword [rsp + 0x38], edx
mov dword [rsp + 0x30], r8d
mov dword [rsp + 0x28], r10d
mov dword [rsp + 0x20], r11d
lea r8, str.startTS_d__d__d__d:_d:_d:_d
mov edx, 0x103
lea rcx, [rbp + 0x70]
call fcn.1400011a0
lea rdx, [rbp + 0x70]
lea rcx, str.startTS
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
lea rax, [rsp + 0x70]
mov qword [rsp + 0x48], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x40], rax
xor edi, edi
mov qword [rsp + 0x38], rdi
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
lea rdx, str.DRWUI
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateProcessA]
mov dword [rsp + 0x5c], eax
test eax, eax
jne 0x140003831
mov ebx, edi
test r14, r14
je 0x140003b1e
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov rcx, qword [rbp - 0x70]
test rcx, rcx
je 0x140003b2d
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rbp - 0x60]
test rax, rax
je 0x140003b3f
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
mov rcx, qword [rbp + 0x390]
xor rcx, rsp
call fcn.1400054c0
lea r11, [rsp + 0x4a0]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rdi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
cmp dword [rsp + 0x58], 0
je 0x140003b81
call fcn.140003370
mov ebx, eax
jmp 0x140003b85
mov ebx, dword [rsp + 0x5c]
mov rcx, qword [rsp + 0x68]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140003b10
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140003b10