MCPcopy Create free account
hub / github.com/Artikash/Textractor / SaveHooks

Function SaveHooks

GUI/mainwindow.cpp:313–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311 }
312
313 void SaveHooks()
314 {
315 auto processName = GetModuleFilename(selectedProcessId);
316 if (!processName) return;
317 QHash<uint64_t, QString> hookCodes;
318 for (int i = 0; i < ui.ttCombo->count(); ++i)
319 {
320 ThreadParam tp = ParseTextThreadString(ui.ttCombo->itemText(i));
321 if (tp.processId == selectedProcessId)
322 {
323 HookParam hp = Host::GetThread(tp).hp;
324 if (!(hp.type & HOOK_ENGINE)) hookCodes[tp.addr] = S(HookCode::Generate(hp, tp.processId));
325 }
326 }
327 auto hookInfo = QStringList() << S(processName.value()) << hookCodes.values();
328 ThreadParam tp = current->tp;
329 if (tp.processId == selectedProcessId) hookInfo << QString("|%1:%2:%3").arg(tp.ctx).arg(tp.ctx2).arg(S(HookCode::Generate(current->hp, tp.processId)));
330 QTextFile(HOOK_SAVE_FILE, QIODevice::WriteOnly | QIODevice::Append).write((hookInfo.join(" , ") + "\n").toUtf8());
331 }
332
333 void FindHooks()
334 {

Callers

nothing calls this directly

Calls 6

GetModuleFilenameFunction · 0.85
ParseTextThreadStringFunction · 0.85
GetThreadFunction · 0.85
SFunction · 0.85
GenerateFunction · 0.85
QTextFileClass · 0.85

Tested by

no test coverage detected