INT_PTR MainDlg::OnSaveProfile( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { std::wstring path; #ifdef USE64 if (OpenSaveDialog( L"Xenos profiles (*.xpr64)\0*.xpr64\0", 1, path, true, L"xpr64" )) #else if (OpenSaveDialog( L"Xenos profiles (*.xpr)\0*.xpr\0", 1, path, true, L"xpr" )) #endif { SaveConfig( path ); _status.SetText( 0, blackbone::Utils::StripPath( path ) ); } return TRUE; }
/// <summary> /// Select executable image via file selection dialog /// </summary> /// <param name="selectedPath">Selected path</param> /// <returns>true if image was selected, false if canceled</returns> bool MainDlg::SelectExecutable( std::wstring& selectedPath ) { _profileMgr.config().processMode = _newProc.checked() ? NewProcess : ManualLaunch; auto res = OpenSaveDialog( L"All (*.*)\0*.*\0Executable image (*.exe)\0*.exe\0", 2, selectedPath ); UpdateInterface(); return res; }
bool Utils::OpenBmpDialog(CString& strFile, const CString& strDirectory) { std::vector<CString> filter; filter.push_back(Utils::GetString(IDS_FILTER_BMP_FILE)); filter.push_back("*.bmp"); if (exists(strDirectory)) { return OpenSaveDialog(strFile, filter, strDirectory); } else { return OpenSaveDialog(strFile, filter, getCurrentDirectory()); } }
INT_PTR MainDlg::OnLoadProfile( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { std::wstring path; #ifdef USE64 if (OpenSaveDialog( L"Xenos profiles (*.xpr64)\0*.xpr64\0", 1, path )) #else if (OpenSaveDialog( L"Xenos profiles (*.xpr)\0*.xpr\0", 1, path )) #endif { // Reset loaded images _profileMgr.config().images.clear(); _images.clear(); _modules.reset(); _exports.clear(); LoadConfig( path ); _status.SetText( 0, blackbone::Utils::StripPath( path ) ); } return TRUE; }
INT_PTR MainDlg::OnSelectExecutable( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { std::wstring path; if (OpenSaveDialog( L"All (*.*)\0*.*\0Executable image (*.exe)\0*.exe\0", 2, path )) SetActiveProcess( 0, path ); else _procList.reset(); _profileMgr.config().processMode = _newProc.checked() ? NewProcess : ManualLaunch; UpdateInterface( ); return TRUE; }
INT_PTR MainDlg::OnLoadImage( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { std::wstring path; bool res = OpenSaveDialog( L"All (*.*)\0*.*\0Dynamic link library (*.dll)\0*.dll\0System driver (*.sys)\0*.sys\0", (_profileMgr.config().injectMode == Kernel_DriverMap) ? 3 : 2, path ); // Reset init routine upon load if (res && LoadImageFile( path ) == ERROR_SUCCESS) _profileMgr.config().initRoutine = L""; return TRUE; }