| 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 | { |
nothing calls this directly
no test coverage detected