Пример #1
0
int main(int argc, char *argv[])
{

#ifdef CHECK_LICENSE
	if ( !CheckLicense() )
		return -1;
#endif

	DbgHelper::InstallDbgHelper();

	Test();

	PROCESS_INFORMATION procInfo = ProcessProxy::CreateProcess((Utils::GetExePath() + L"\\GenymotionMonitor.exe").c_str());
	CloseHandle(procInfo.hThread);
	CloseHandle(procInfo.hProcess);

	QApplication a(argc, argv);
	a.setWindowIcon(QIcon(QPixmap(":/Image/icon.png")));

	QTranslator* ts = new QTranslator;
	ts->load(":/qt_zh_CN.qm");
	a.installTranslator(ts);

	FramelessDlg dlg(0);
	AppDlg* app = new AppDlg(&dlg);

	dlg.SetDlg(app);
	dlg.SetTitle(Utils::GetConfigValue("title", "value"));
	dlg.SetSubTitle(Utils::stoq("未选择要分析的设备"));
	dlg.setMinimumSize(1020, 600);

	QObject::connect(app, SIGNAL(AddMenuAction(QAction*)), &dlg, SLOT(AddMenuAction(QAction*)));
	QObject::connect(app, SIGNAL(AddSubMenu(QMenu*)), &dlg, SLOT(AddSubMenu(QMenu*)));
	QObject::connect(app, SIGNAL(RemoveMenuAction(QAction*)), &dlg, SLOT(RemoveMenuAction(QAction*)));
	QObject::connect(app, SIGNAL(SetSubTitle(QString)), &dlg, SLOT(SetSubTitle(QString)));

	app->InitAction();
	InitStyle(a);

	dlg.show();
	dlg.CenterWindow();

	app->AnalyzeDir(GetDefaultForensicsDir());

	a.exec();

	ProcessProxy::KillProcess(L"GenymotionMonitor.exe");

	return 0;
}
Пример #2
0
void Page::OnPropertySet( Property::Index index, Property::Value propertyValue )
{
  if( index == mPropertyTitle )
  {
    std::string title( propertyValue.Get<std::string>() );
    SetTitle(title);
  }
  else if( index == mPropertySubTitle )
  {
    std::string subTitle( propertyValue.Get<std::string>() );
    SetSubTitle(subTitle);
  }
}
Пример #3
0
void SelectDirDlg::ListDevices()
{
	QString dir = ui.edtPath->text();
	ui.lstDevices->clear();
	m_dm.Clear();
	m_dm.SetDirPath(Utils::qtow(dir));

	if ( !m_dm.ParseCaseInfo() )
	{
		MsgBox::Information(this, Utils::stoq("解析失败"), Utils::stoq("解析失败,指定目录中不存在案例配置文件"));
		return;
	}

	const std::list<CASE_INFO>& cases = m_dm.GetCaseList();

	for ( std::list<CASE_INFO>::const_iterator it = cases.begin();
		it != cases.end();
		++it )
	{
		const wchar_t* deviceName = it->wzDirPath;
		m_dm.ParseDeviceInfo(deviceName);
		DeviceInfoMap& deviceInfo = m_dm.GetDeviceMap();
		DEV_INFO info = deviceInfo[deviceName];

		QListWidgetItem* item = new QListWidgetItem;
		item->setText(Utils::wtoq(deviceName));

		if ( info.baseDevInfo.devType == DEV_TYPE_ANDROID )
			item->setIcon(QIcon(QPixmap(":/Image/android_icon.png")));
		else
			item->setIcon(QIcon(QPixmap(":/Image/ios.png")));

		ui.lstDevices->addItem(item);
	}

	ui.stack->show();
	emit Resize(QSize(400, 300));
	emit CenterWindow();

	ui.stack->setCurrentIndex(0);

	emit SetSubTitle(Utils::stoq("选择要分析的设备"));
}
Пример #4
0
int SelectDirDlg::Invoke(QString dir)
{
	FramelessDlg container(0, CLOSE_BUTTON);
	SelectDirDlg* dlg = new SelectDirDlg(&container);

	connect(dlg, SIGNAL(OK()), &container, SLOT(accept()));
	connect(dlg, SIGNAL(Resize(QSize)), &container, SLOT(Resize(QSize)));
	connect(dlg, SIGNAL(CenterWindow()), &container, SLOT(CenterWindow()));
	connect(dlg, SIGNAL(SetSubTitle(QString)), &container, SLOT(SetTitle(QString)));

	container.SetDlg(dlg);
	container.SetTitle(Utils::stoq("选择案例所在目录"));
	container.setFixedSize(400, 110);
	container.CenterWindow();

	dlg->SetDataDir(dir);

	return container.exec();	
}
Пример #5
0
void SelectDirDlg::SelectForensicsType()
{
	QList<QListWidgetItem*> items = ui.lstDevices->selectedItems();
	std::wstring device = Utils::qtow(items[0]->text());
	m_dm.SetCurrentDevice(device);

	ui.stack->setCurrentIndex(1);

	ui.lstForensicsType->clear();
	DeviceDataDirMap& dirs = m_dm.GetDeviceDataDirMap();
	ForensicsTypeMap& types = m_dm.GetForensicsTypeMap();

	int count = dirs.count(device);
	DeviceDataDirMap::iterator it = dirs.find(device);

	if ( count == 1 )
	{
		DataManager::GetInstance().SetCurrentForensicsDir((*it).second);

		QString dir = ui.edtPath->text();
		DataManager::GetInstance().SetDirPath(Utils::qtow(dir));
		DataManager::GetInstance().SetCurrentDevice(device);
		emit OK();
		return;
	}

	for ( int i = 0; i != count ; ++i, ++it )
	{
		QListWidgetItem* item = new QListWidgetItem;
		std::wstring name = types[(*it).second].name;
		item->setText(Utils::wtoq(name));
		item->setData(Qt::UserRole, Utils::wtoq((*it).second));
		item->setIcon(QPixmap(Utils::wtoq(types[(*it).second].icon)));
		ui.lstForensicsType->insertItem(0, item);
	}

	emit SetSubTitle(Utils::stoq("选择取证数据类型"));
}
Пример #6
0
int DataDevice::CopyFrom(DataDevice *t)
/*!\brief Daten kopieren
 *
 * Mit dieser Funktion werden die Daten einers anderen DataDevice Datensatzes in diesen hineinkopiert.
 * Bereits vorhandene Daten werden dabei überschrieben.
 *
 * \param[in] t Pointer auf einen anderen Datensatz vom Typ DataDevice
 *
 * \returns Konnten die Daten erfolgreich kopiert werden, liefert die Funktion 1 zurück, im Fehlerfall 0.
 *
 * \attention
 * Auch die Storage-Datenm werden von \p t übernommen.
 */
{
	if (!t) {
		ppl6::SetError(194,"int DataDevice::CopyFrom(==> DataDevice *t <==)");
		return 0;
	}
	Clear();
	SetTitle(t->Title);
	SetSubTitle(t->SubTitle);
	DeviceId=t->DeviceId;
	Length=t->Length;
	Recorded=t->Recorded;
	LabelId=t->LabelId;
	PurchaseDate=t->PurchaseDate;
	DateCreated=t->DateCreated;
	FirstDate=t->FirstDate;
	LastDate=t->LastDate;
	NumTracks=t->NumTracks;
	PurchasePrice=t->PurchasePrice;
	PurchaseId=t->PurchaseId;
	DeviceType=t->DeviceType;
	Pages=t->Pages;
	CopyStorageFrom(t);
	return 1;
}