2018-12-01 19:12:45 -05:00
|
|
|
#pragma once
|
2018-07-21 15:40:16 -07:00
|
|
|
|
2018-08-22 12:24:55 -04:00
|
|
|
#include "qtcommon.h"
|
2019-02-09 00:30:38 -05:00
|
|
|
#include "extenwindow.h"
|
2018-10-28 02:27:24 -04:00
|
|
|
#include "host/host.h"
|
2018-07-21 15:40:16 -07:00
|
|
|
|
2018-07-23 12:25:02 -07:00
|
|
|
namespace Ui
|
|
|
|
{
|
2018-07-25 10:46:59 -07:00
|
|
|
class MainWindow;
|
2018-07-21 15:40:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
public:
|
2018-07-25 10:46:59 -07:00
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
2018-07-21 15:40:16 -07:00
|
|
|
|
|
|
|
private:
|
2019-02-18 23:12:12 -05:00
|
|
|
inline static constexpr auto HOOK_SAVE_FILE = u8"SavedHooks.txt";
|
|
|
|
inline static constexpr auto GAME_SAVE_FILE = u8"SavedGames.txt";
|
|
|
|
|
2019-01-11 17:14:49 -05:00
|
|
|
inline static thread_local bool ok = false;
|
|
|
|
|
2018-12-18 12:14:54 -05:00
|
|
|
void closeEvent(QCloseEvent*) override;
|
2018-11-27 15:54:04 -05:00
|
|
|
void ProcessConnected(DWORD processId);
|
|
|
|
void ProcessDisconnected(DWORD processId);
|
2019-02-04 15:18:47 -05:00
|
|
|
void ThreadAdded(TextThread& thread);
|
|
|
|
void ThreadRemoved(TextThread& thread);
|
|
|
|
bool SentenceReceived(TextThread& thread, std::wstring& sentence);
|
2019-07-13 19:15:43 +05:30
|
|
|
void OutputContextMenu(QPoint point);
|
2019-02-04 15:18:47 -05:00
|
|
|
QString TextThreadString(TextThread& thread);
|
2018-11-27 15:54:04 -05:00
|
|
|
ThreadParam ParseTextThreadString(QString ttString);
|
2018-08-22 15:11:40 -04:00
|
|
|
DWORD GetSelectedProcessId();
|
2019-02-09 00:30:38 -05:00
|
|
|
std::array<InfoForExtension, 10> GetMiscInfo(TextThread& thread);
|
2019-07-02 11:26:04 +05:30
|
|
|
std::optional<std::wstring> UserSelectedProcess();
|
2018-12-18 12:14:54 -05:00
|
|
|
void AttachProcess();
|
2019-01-11 17:14:49 -05:00
|
|
|
void LaunchProcess();
|
2018-12-18 12:14:54 -05:00
|
|
|
void DetachProcess();
|
2019-06-27 12:39:44 +05:30
|
|
|
void ForgetProcess();
|
2018-12-18 12:14:54 -05:00
|
|
|
void AddHook();
|
2019-06-10 01:49:11 -04:00
|
|
|
void RemoveHooks();
|
2018-12-18 12:14:54 -05:00
|
|
|
void SaveHooks();
|
2019-06-02 02:09:17 -04:00
|
|
|
void FindHooks();
|
2018-12-18 12:14:54 -05:00
|
|
|
void Settings();
|
|
|
|
void Extensions();
|
|
|
|
void ViewThread(int index);
|
2019-07-13 19:15:43 +05:30
|
|
|
void SetOutputFont(QString font);
|
2018-07-25 21:48:18 -07:00
|
|
|
|
2018-09-01 13:56:45 -04:00
|
|
|
Ui::MainWindow* ui;
|
2019-06-27 12:39:44 +05:30
|
|
|
ExtenWindow* extenWindow;
|
|
|
|
std::unordered_set<DWORD> alreadyAttached;
|
|
|
|
bool autoAttach = false, autoAttachSavedOnly = true;
|
|
|
|
uint64_t savedThreadCtx = 0, savedThreadCtx2 = 0;
|
|
|
|
wchar_t savedThreadCode[1000] = {};
|
|
|
|
TextThread* current = nullptr;
|
2018-07-21 15:40:16 -07:00
|
|
|
};
|