Function at 0x180021970
Capabilities:
Check if file exists
Create a process with modified i/o handles and window
Create process on windows

Disassembly:
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x70]
sub rsp, 0x170
mov qword [rbp - 8], 0xfffffffffffffffe
mov qword [rsp + 0x1c0], rbx
mov r12d, r9d
mov r14, r8
mov rsi, rcx
cmp qword [rcx + 0x170], 0
je 0x18002205f
test rdx, rdx
je 0x18002205f
cmp qword [r8 + 0x10], 1
jl 0x18002205f
mov ecx, 0x98
call qword [sym.imp.mfc100u.dll_CTagManager::CTagManager]
mov qword [rbp + 0xb0], rax
test rax, rax
je 0x1800219f1
mov rcx, rax
call qword [sym.imp.Hg3DExchangeHU.dll_public:_void___cdecl_CHg3DExchangeMng::constructor_void____ptr64]
mov rdi, rax
jmp 0x1800219f3
xor edi, edi
mov qword [rsp + 0x70], rdi
test rdi, rdi
je 0x18002205f
lea rdx, [0x1800a89f0]
lea rcx, [rbp - 0x38]
call qword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
nop
lea rdx, [rbp - 0x38]
mov rcx, rdi
call qword [sym.imp.Hg3DExchangeHU.dll_public:_class_CHg3DExchangeBase____ptr64___cdecl_CHg3DExchangeMng::GetExchange_class_ATL::CStringT_wchar_t__class_StrTraitMFC_DLL_wchar_t__class_ATL::ChTraitsCRT_wchar_t____const____ptr64____ptr64]
mov rbx, rax
mov qword [rbp - 0x30], rax
lea rcx, [rbp - 0x38]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
test rbx, rbx
je 0x180021a41
xor edx, edx
mov rcx, rbx
call qword [sym.imp.Hg3DExchangeHU.dll_public:_void___cdecl_CHg3DExchangeBase::SetVisibleProgress_int____ptr64]
mov rbx, qword [r14 + 0x10]
mov qword [rsp + 0x68], rbx
mov edx, 0x36ce
mov rcx, rsi
call qword [sym.imp.mfc100u.dll_CCmdTarget::GetCommandMap]
mov r13, rax
mov r15, qword [rbp + 0xd0]
test rax, rax
je 0x180021a8c
test r12d, r12d
je 0x180021a8c
cmp dword [r15], 0
jne 0x180021a8c
movzx r9d, bx
shl r9d, 0x10
xor r8d, r8d
mov edx, 0x401
mov rcx, qword [rax + 0x40]
call qword [sym.imp.USER32.dll_SendMessageW]
mov rcx, qword [rsi + 0x148]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x180021aa6
cmp dword [r15], eax
je 0x18002205f
xor eax, eax
mov qword [rbp - 0x60], rax
mov qword [rbp - 0x58], rax
mov qword [rbp - 0x50], rax
xor edx, edx
lea r8d, [rax + 0x68]
lea rcx, [rbp]
call sub.MSVCR100.dll_memset
mov dword [rbp], 0x68
mov dword [rbp + 0x3c], 0x101
mov eax, 5
mov word [rbp + 0x40], ax
mov dword [rsp + 0x60], 0
xor eax, eax
mov dword [rbp + 0xb0], eax
test ebx, ebx
jle 0x180021fe8
cmp dword [rsi + reloc.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____], 0
jne 0x180021fb4
test r13, r13
je 0x180021b2a
test r12d, r12d
je 0x180021b2a
cmp dword [r15], 0
jne 0x180021b2a
movsxd r8, eax
xor r9d, r9d
mov edx, 0x402
mov rcx, qword [r13 + 0x40]
call qword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [rbp + 0xb0]
movsxd rcx, eax
test eax, eax
js 0x180021fad
cmp rcx, qword [r14 + 0x10]
jge 0x180021fad
mov rax, qword [r14 + 8]
mov rcx, qword [rax + rcx*8]
mov edi, dword [rcx]
lea rcx, [rsp + 0x50]
call qword [0x18009c008]
nop
mov r12, qword [rsi + 0x170]
mov rcx, qword [r12 + 0xa80]
test rcx, rcx
je 0x180021f7d
test edi, edi
js 0x180021f7d
call sym.Hg3DUiHU.dll_public:_int___cdecl_CHgDrawingList::GetCountPage_void_const___ptr64
cmp edi, eax
jg 0x180021f7d
mov r10, qword [r12 + 0xa80]
test r10, r10
je 0x180021f7d
or r11d, 0xffffffff
or r9d, r11d
xor r8d, r8d
xor edx, edx
mov rbx, qword [r10 + 0x18]
test ebx, ebx
jle 0x180021f78
nop dword [rax + rax]
test r8d, r8d
jns 0x180021bbd
movsxd rax, r8d
cmp rax, rbx
jge 0x180021bfe
test rdx, rdx
js 0x180021fa6
cmp rdx, rbx
jge 0x180021fa6
mov rax, qword [r10 + 0x10]
mov rcx, qword [rax + rdx*8]
test rcx, rcx
je 0x180021bfe
cmp qword [rcx + 0x20], 0
je 0x180021bfe
inc r11d
cmp qword [rcx + 0x80], 0
je 0x180021bf9
cmp dword [rcx + 0x68], 0
jne 0x180021bf9
inc r9d
cmp edi, r9d
je 0x180021c0f
inc r8d
inc rdx
cmp r8d, ebx
jge 0x180021f78
jmp 0x180021bb0
test r11d, r11d
js 0x180021f78
mov edx, r11d
mov rcx, r12
call sym.Hg3DUiHU.dll_public:_class_CHgDrawingItem____ptr64___cdecl_CHgDrawingTreeListCtrl::GetDrawingItem_int____ptr64
mov rdi, rax
test rax, rax
je 0x180021f78
cmp qword [rax + 0x20], 0
je 0x180021f78
lea rcx, [rbp - 0x48]
call qword [0x18009c008]
nop
lea rcx, [rsp + 0x58]
call qword [0x18009c008]
nop
lea rcx, [rsp + 0x78]
call qword [0x18009c008]
nop
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0x58]
call qword [sym.imp.mfc100u.dll_CView::CView]
xor r8d, r8d
lea rdx, [0x1800a8e98]
lea rcx, [rsp + 0x58]
call qword [sym.imp.mfc100u.dll_CArchive::EnsureSchemaMapExists]
cmp eax, 0xffffffff
je 0x180021d05
nop word [rax + rax]
lea ebx, [rax + 1]
mov r8d, ebx
lea rdx, [rbp - 0x10]
lea rcx, [rsp + 0x58]
call qword [sym.imp.mfc100u.dll_CDWordArray::InsertAt]
nop
mov rdx, rax
lea rcx, [rsp + 0x78]
call qword [sym.imp.mfc100u.dll_]
nop
lea rcx, [rbp - 0x10]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
mov r8d, ebx
lea rdx, [rbp - 0x28]
lea rcx, [rsp + 0x58]
call qword [sym.imp.mfc100u.dll_COleControl::LoadState]
nop
mov rdx, rax
lea rcx, [rsp + 0x58]
call qword [sym.imp.mfc100u.dll_CView::CView]
nop
lea rcx, [rbp - 0x28]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
xor r8d, r8d
lea rdx, [0x1800a8e98]
lea rcx, [rsp + 0x58]
call qword [sym.imp.mfc100u.dll_CArchive::EnsureSchemaMapExists]
cmp eax, 0xffffffff
jne 0x180021c90
lea rdx, [rsp + 0x78]
lea rcx, [rbp - 0x48]
call qword [sym.imp.mfc100u.dll_CView::CView]
nop
lea rcx, [rsp + 0x78]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
lea rcx, [rbp - 0x78]
call qword [0x18009c008]
nop
lea r8, str.Drawing_Plot_:__s___d__d_plotting...
lea rdx, str.Eng_Hg3D
lea rcx, [rbp - 0x18]
call fcn.180032230
nop
mov r9d, dword [rbp + 0xb0]
inc r9d
mov rbx, qword [rsp + 0x68]
mov dword [rsp + 0x20], ebx
mov r8, qword [rsp + 0x58]
mov rdx, qword [rax]
lea rcx, [rbp - 0x78]
call qword [sym.imp.mfc100u.dll_CMFCRibbonRecentFilesList::FillList]
nop
lea rcx, [rbp - 0x18]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
mov edx, 0x36d5
mov rcx, rsi
call qword [sym.imp.mfc100u.dll_CCmdTarget::GetCommandMap]
mov rcx, rax
mov rdx, qword [rbp - 0x78]
call qword [sym.imp.mfc100u.dll_COleServerItem::XOleObject::SetMoniker]
nop
lea rcx, [rbp - 0x78]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
nop
lea rcx, [rsp + 0x58]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
nop
lea rcx, [rbp - 0x48]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
mov r11, qword [rsi]
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], r15
lea r9, [rbp + 0xb0]
xor r8d, r8d
lea rdx, [rbp - 0x20]
mov rcx, rsi
call qword [r11 + 0x338]
nop
mov rdx, rax
lea rcx, [rsp + 0x50]
call qword [sym.imp.mfc100u.dll_CView::CView]
nop
lea rcx, [rbp - 0x20]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
lea r11, [rsp + 0x50]
mov qword [rsp + 0x20], r11
mov r9, rdi
mov r8, qword [rbp - 0x30]
mov rdx, qword [rbp + 0xb8]
mov rcx, rsi
call sym.Hg3DUiHU.dll_private:_int___cdecl_CHgExportDrawing::MakeTargetFile_class_CHg3DData____ptr64__class_CHg3DExchangeDwg____ptr64__class_CHgDrawingItem____ptr64__class_ATL::CStringT_wchar_t__class_StrTraitMFC_DLL_wchar_t__class_ATL::ChTraitsCRT_wchar_t____const____ptr64____ptr64
test eax, eax
jne 0x180021e18
jmp 0x180021f7d
lea r8, [rsp + 0x50]
mov rax, qword [rbp + 0xd8]
mov rdx, qword [rax + 0x10]
mov rcx, rax
call qword [sym.imp.mfc100u.dll_RFX_Single_Bulk]
cmp dword [rsi + 0x12c], 0
je 0x180021f76
cmp dword [rsi + reloc.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____], 0
jne 0x180021f76
mov rax, qword [rbp + 0xe0]
cmp dword [rax], 0
jne 0x180021f76
lea rcx, [rbp - 0x80]
call qword [sym.imp.HgUtilGeometryU.dll_public:_static_class_ATL::CStringT_wchar_t__class_StrTraitMFC_DLL_wchar_t__class_ATL::ChTraitsCRT_wchar_t______cdecl_CUtilGeometric::GetPathExe_void_]
nop
lea rdx, str.HgPlotU.exe
lea rcx, [rbp - 0x80]
call qword [sym.imp.mfc100u.dll_COleCurrency::operator_]
lea rcx, [rbp - 0x68]
call qword [0x18009c008]
nop
mov r9, qword [rsp + 0x50]
mov r8, qword [rsi + 0x178]
lea rdx, str._Print____s____s___Y_
lea rcx, [rbp - 0x68]
call qword [sym.imp.mfc100u.dll_CMFCRibbonRecentFilesList::FillList]
cmp dword [rsp + 0x60], 0
je 0x180021ed6
mov rcx, qword [rbp - 0x60]
test rcx, rcx
je 0x180021ed6
mov edx, 0xea60
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rbp - 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp - 0x60], 0
lea r8, [0x1800a8ea4]
lea rdx, [rbp - 0x80]
lea rcx, [rbp - 0x70]
call fcn.180024b80
nop
lea r8, [rbp - 0x68]
mov rdx, rax
lea rcx, [rbp - 0x40]
call fcn.180024c10
nop
lea rcx, [rbp - 0x70]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
xor edx, edx
lea rcx, [rbp - 0x40]
call qword [sym.imp.mfc100u.dll_CTaskDialog::FreeStruct]
mov rdx, rax
lea rax, [rbp - 0x60]
mov qword [rsp + 0x48], rax
lea rax, [rbp]
mov qword [rsp + 0x40], rax
xor eax, eax
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], 0x10
mov dword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateProcessW]
mov dword [rsp + 0x60], eax
lea rcx, [rbp - 0x40]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
nop
lea rcx, [rbp - 0x68]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
nop
lea rcx, [rbp - 0x80]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
nop
jmp 0x180021f7d
mov rbx, qword [rsp + 0x68]
lea rcx, [rsp + 0x50]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
mov eax, dword [rbp + 0xb0]
inc eax
mov dword [rbp + 0xb0], eax
mov r12d, dword [rbp + 0xc8]
cmp eax, ebx
jge 0x180021fb4
jmp 0x180021af2
call qword [sym.imp.mfc100u.dll_AfxPropSheetCallback]
nop
call qword [sym.imp.mfc100u.dll_AfxPropSheetCallback]
int3
cmp dword [rsp + 0x60], 0
je 0x180021fe3
mov rcx, qword [rbp - 0x60]
test rcx, rcx
je 0x180021fe3
mov edx, 0xea60
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rbp - 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdi, qword [rsp + 0x70]
test r12d, r12d
je 0x18002204d
cmp dword [r15], 0
jne 0x18002204d
test r13, r13
je 0x18002200d
movsxd r8, ebx
xor r9d, r9d
mov edx, 0x402
mov rcx, qword [r13 + 0x40]
call qword [sym.imp.USER32.dll_SendMessageW]
lea r8, str.Print_Drawing_:_Complete.
lea rdx, str.Eng_Hg3D
lea rcx, [rbp - 0x70]
call fcn.180032230
nop
mov rbx, qword [rax]
mov edx, 0x36d5
mov rcx, rsi
call qword [sym.imp.mfc100u.dll_CCmdTarget::GetCommandMap]
mov rcx, rax
mov rdx, rbx
call qword [sym.imp.mfc100u.dll_COleServerItem::XOleObject::SetMoniker]
nop
lea rcx, [rbp - 0x70]
call qword [sym.imp.mfc100u.dll_CWinApp::CWinApp]
mov rcx, rdi
call qword [sym.imp.Hg3DExchangeHU.dll_public:_void___cdecl_CHg3DExchangeMng::destructor_void____ptr64]
mov rcx, rdi
call qword [sym.imp.mfc100u.dll_CThreadLocalObject::CThreadLocalObject]
mov rbx, qword [rsp + 0x1c0]
add rsp, 0x170
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret