Skip to content

Commit

Permalink
v1.0.8 Release, Add more tools for reverse.
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackINT3 committed Sep 2, 2020
1 parent d946e5c commit 6c1bc7f
Show file tree
Hide file tree
Showing 38 changed files with 1,073 additions and 645 deletions.
12 changes: 7 additions & 5 deletions src/OpenArk/common/cache/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ ProcInfo CacheGetProcInfo(unsigned int pid, ProcInfo& info)
}
static bool is_os64 = UNONE::OsIs64();
info.path = WStrToQ(path);
std::wstring corp, desc;
UNONE::FsGetFileInfoW(path, L"CompanyName", corp);
UNONE::FsGetFileInfoW(path, L"FileDescription", desc);
info.corp = WStrToQ(corp);
info.desc = WStrToQ(desc);
if (!path.empty() && path != L"System") {
std::wstring corp, desc;
UNONE::FsGetFileInfoW(path, L"CompanyName", corp);
UNONE::FsGetFileInfoW(path, L"FileDescription", desc);
info.corp = WStrToQ(corp);
info.desc = WStrToQ(desc);
}
if (info.name.isEmpty()) info.name = WStrToQ(UNONE::FsPathToNameW(path));
info.ctime = WStrToQ(ProcessCreateTime(pid));
if (is_os64 && !UNONE::PsIsX64(pid)) info.name.append(" *32");
Expand Down
13 changes: 13 additions & 0 deletions src/OpenArk/common/qt-wrapper/qt-wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ void SetDefaultTableViewStyle(QTableView* view, QStandardItemModel* model)
view->horizontalHeader()->setMinimumSectionSize(100);
view->verticalHeader()->setDefaultSectionSize(25);
view->selectionModel()->selectedIndexes();
view->setEditTriggers(false);
}

void SetDefaultTreeViewStyle(QTreeView* view, QStandardItemModel* model)
Expand Down Expand Up @@ -324,6 +325,18 @@ void ShellRun(QString cmdline, QString param)
ShellExecuteW(NULL, L"open", cmdline.toStdWString().c_str(), param.toStdWString().c_str(), NULL, SW_SHOW);
}

void ShellRunCmdExe(QString exe, int show)
{
auto cmdline = "cmd /c " + exe;
UNONE::PsCreateProcessW(cmdline.toStdWString(), show);
}

void ShellRunCmdDir(QString dir)
{
auto cmdline = "cmd /k cd /D" + dir;
UNONE::PsCreateProcessW(cmdline.toStdWString());
}

QString PidFormat(DWORD pid)
{
if (pid == -1) return "N/A";
Expand Down
2 changes: 2 additions & 0 deletions src/OpenArk/common/qt-wrapper/qt-wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,5 +227,7 @@ bool JsonGetValue(const QByteArray &data, const QString &key, QJsonValue &val);
//
void ShellOpenUrl(QString url);
void ShellRun(QString cmdline, QString param);
void ShellRunCmdExe(QString exe, int show = SW_SHOW);
void ShellRunCmdDir(QString dir);
QString PidFormat(DWORD pid);
QString NameFormat(QString name);
2 changes: 1 addition & 1 deletion src/OpenArk/kernel/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void Kernel::InitHotkeyView()
{ 180, tr("Title") },
{ 180, tr("ClassName") },
{ 300, tr("Path") },
{ 120, tr("Description") } };
{ 160, tr("Description") } };
SetDefaultTreeViewStyle(view, hotkey_model_, proxy_hotkey_, colum_layout, _countof(colum_layout));
view->viewport()->installEventFilter(this);
view->installEventFilter(this);
Expand Down
30 changes: 15 additions & 15 deletions src/OpenArk/kernel/network/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ void KernelNetwork::InitHostsView()
return std::move(hosts);
};

auto ReloadHostsData = [=]() {
auto RefreshHostsData = [=]() {
std::string data;
auto &&hosts = GetCurrentHostsPath();
UNONE::FsReadFileDataW(hosts, data);
Expand All @@ -383,7 +383,7 @@ void KernelNetwork::InitHostsView()
UNONE::FsWriteFileDataW(hosts, data);
};

auto ReloadHostsList = [=]() {
auto RefreshHostsList = [=]() {
auto row = ui_->hostsFileListWidget->currentRow();
ui_->hostsFileListWidget->clear();
std::vector<std::wstring> names;
Expand All @@ -402,12 +402,12 @@ void KernelNetwork::InitHostsView()
};

connect(ui_->hostsFileListWidget, &QListWidget::itemSelectionChanged, [=] {
ReloadHostsData();
RefreshHostsData();
});

connect(ui_->hostsReloadBtn, &QPushButton::clicked, [=] {
ReloadHostsData();
ReloadHostsList();
connect(ui_->hostsRefreshBtn, &QPushButton::clicked, [=] {
RefreshHostsData();
RefreshHostsList();
});

connect(ui_->hostsSaveBtn, &QPushButton::clicked, [=] {
Expand All @@ -423,7 +423,7 @@ void KernelNetwork::InitHostsView()
if (ok && !text.isEmpty()) {
auto &&hosts = hosts_dir_ + L"\\hosts-" + text.toStdWString();
WriteHostsData(hosts);
ReloadHostsList();
RefreshHostsList();
}
});

Expand All @@ -436,14 +436,14 @@ void KernelNetwork::InitHostsView()
});

if (!UNONE::FsIsExistedW(hosts_file_)) UNONE::FsWriteFileDataW(hosts_file_, "# 127.0.0.1 localhost\n# ::1 localhost");
ReloadHostsList();
RefreshHostsList();
ui_->hostsFileListWidget->setCurrentRow(0);

ui_->hostsFileListWidget->installEventFilter(this);
hosts_menu_ = new QMenu();
hosts_menu_->addAction(tr("Mark as Main"), kernel_, [=] {
WriteHostsData(hosts_file_);
ReloadHostsList();
RefreshHostsList();
ui_->hostsFileListWidget->setCurrentRow(0);
});
hosts_menu_->addAction(tr("Rename"), kernel_, [=] {
Expand All @@ -461,7 +461,7 @@ void KernelNetwork::InitHostsView()
hosts = hosts_dir_ + L"\\hosts";
}
WriteHostsData(hosts);
ReloadHostsList();
RefreshHostsList();
}
});
hosts_menu_->addAction(tr("Backup"), kernel_, [=] {
Expand All @@ -480,15 +480,15 @@ void KernelNetwork::InitHostsView()
}
ClipboardCopyData(UNONE::StrToA(data));
});
hosts_menu_->addAction(tr("Reload"), kernel_, [=] {
emit ui_->hostsReloadBtn->click();
hosts_menu_->addAction(tr("Refresh"), kernel_, [=] {
emit ui_->hostsRefreshBtn->click();
});

hosts_menu_->addAction(copy_menu->menuAction());
hosts_menu_->addSeparator();
hosts_menu_->addAction(tr("Delete"), kernel_, [=] {
DeleteFileW(GetCurrentHostsPath().c_str());
emit ui_->hostsReloadBtn->click();
emit ui_->hostsRefreshBtn->click();
}, QKeySequence::Delete);
hosts_menu_->addAction(tr("Delete Non-Main"), kernel_, [=] {
if (QMessageBox::warning(this, tr("Warning"), tr("Are you sure to delete all hosts file(include backups)?"),
Expand All @@ -501,7 +501,7 @@ void KernelNetwork::InitHostsView()
auto path = hosts_dir_ + L"\\" + QToWStr(name);
DeleteFileW(path.c_str());
}
emit ui_->hostsReloadBtn->click();
emit ui_->hostsRefreshBtn->click();
});
}

Expand All @@ -516,7 +516,7 @@ void KernelNetwork::InitPortView()
{ 145, tr("Foreign address") },
{ 100, tr("State") },
{ 50, tr("PID") },
{ 350, tr("Process Path") },
{ 530, tr("Process Path") },
};

SetDefaultTreeViewStyle(view, port_model_, proxy_port_, layout, _countof(layout));
Expand Down
2 changes: 1 addition & 1 deletion src/OpenArk/kernel/storage/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bool KernelStorage::eventFilter(QObject *obj, QEvent *e)
if (ui_->inputPathEdit->text().isEmpty()) {
QString tips(tr("Tips: \n1. You can copy file or directory and paste to here(Enter key to ShowHold).\n"
"2. You need enter kernel mode to view FileHold.\n"
"3. Path is case insensitive"));
"3. Path is case insensitive."));
QToolTip::showText(mouse->globalPos(), tips);
return true;
}
Expand Down
Loading

0 comments on commit 6c1bc7f

Please sign in to comment.