forked from Public-Mirror/Textractor
tabs to spaces and bugfixes
This commit is contained in:
parent
9c5be4be80
commit
d0b1efd033
@ -19,11 +19,6 @@ add_definitions(
|
||||
/DITH_HAS_CRT
|
||||
)
|
||||
|
||||
include_directories(
|
||||
.
|
||||
texthook
|
||||
)
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug)
|
||||
|
@ -41,7 +41,7 @@ QString TextThreadString(TextThread* thread)
|
||||
QString::number(tp.hook, 16),
|
||||
QString::number(tp.retn, 16),
|
||||
QString::number(tp.spl, 16)
|
||||
).toUpper() + QString::fromWCharArray(Host::GetHookName(tp.pid, tp.hook).c_str());
|
||||
).toUpper();
|
||||
}
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
@ -78,29 +78,31 @@ void MainWindow::AddProcess(unsigned int processId)
|
||||
|
||||
void MainWindow::RemoveProcess(unsigned int processId)
|
||||
{
|
||||
processCombo->removeItem(processCombo->findText(QString::number(processId), Qt::MatchStartsWith));
|
||||
processCombo->removeItem(processCombo->findText(QString::number(processId) + ":", Qt::MatchStartsWith));
|
||||
}
|
||||
|
||||
void MainWindow::AddThread(TextThread* thread)
|
||||
{
|
||||
ttCombo->addItem(TextThreadString(thread));
|
||||
ttCombo->addItem(
|
||||
TextThreadString(thread) +
|
||||
QString::fromWCharArray(Host::GetHookName(thread->GetThreadParameter().pid, thread->GetThreadParameter().hook).c_str())
|
||||
);
|
||||
}
|
||||
|
||||
void MainWindow::RemoveThread(TextThread* thread)
|
||||
{
|
||||
int threadIndex = ttCombo->findText(QString::number(thread->Number()), Qt::MatchStartsWith);
|
||||
int threadIndex = ttCombo->findText(QString::number(thread->Number()) + ":", Qt::MatchStartsWith);
|
||||
ttCombo->removeItem(threadIndex);
|
||||
if (threadIndex == ttCombo->currentIndex())
|
||||
{
|
||||
ttCombo->setCurrentIndex(0);
|
||||
on_ttCombo_activated(0);
|
||||
}
|
||||
delete thread;
|
||||
}
|
||||
|
||||
void MainWindow::ThreadOutput(TextThread* thread, QString output)
|
||||
{
|
||||
if (TextThreadString(thread) == ttCombo->currentText())
|
||||
if (ttCombo->currentText().startsWith(TextThreadString(thread)))
|
||||
{
|
||||
textOutput->moveCursor(QTextCursor::End);
|
||||
textOutput->insertPlainText(output);
|
||||
@ -121,4 +123,5 @@ void MainWindow::on_detachButton_clicked()
|
||||
void MainWindow::on_ttCombo_activated(int index)
|
||||
{
|
||||
textOutput->setText(QString::fromWCharArray(Host::GetThread(ttCombo->itemText(index).split(":")[0].toInt())->GetStore().c_str()));
|
||||
textOutput->moveCursor(QTextCursor::End);
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ void RemoveThreads(bool(*RemoveIf)(ThreadParameter, ThreadParameter), ThreadPara
|
||||
{
|
||||
if (onRemove) onRemove(i.second);
|
||||
//delete i.second; // Artikash 7/24/2018: FIXME: Qt GUI updates on another thread, so I can't delete this yet.
|
||||
//i.second->Clear(); // Temp workaround to free some memory.
|
||||
i.second->Clear(); // Temp workaround to free some memory.
|
||||
removedThreads.push_back(i.first);
|
||||
}
|
||||
for (auto i : removedThreads) textThreadsByParams.erase(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user