mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-23 22:05:36 +08:00
3352075e4c
1 Update LunaHost.cpp Update LunaHost.cpp Update LunaHost.cpp
130 lines
3.7 KiB
C++
130 lines
3.7 KiB
C++
#include"window.h"
|
|
#include"controls.h"
|
|
#include"textthread.h"
|
|
#include"pluginmanager.h"
|
|
#include"confighelper.h"
|
|
class LunaHost;
|
|
class Pluginwindow:public mainwindow{
|
|
listbox* listplugins;
|
|
Pluginmanager* pluginmanager;
|
|
public:
|
|
Pluginwindow(mainwindow*,Pluginmanager*);
|
|
void on_size(int w,int h);
|
|
void pluginrankmove(int);
|
|
};
|
|
class Settingwindow:public mainwindow{
|
|
checkbox* ckbfilterrepeat;
|
|
spinbox* g_timeout;
|
|
spinbox* g_codepage;
|
|
checkbox* g_check_clipboard;
|
|
checkbox* readonlycheck;
|
|
checkbox* autoattach;
|
|
checkbox* autoattach_so;
|
|
checkbox* copyselect;
|
|
spinbox* spinmaxbuffsize;
|
|
spinbox* spinmaxhistsize;
|
|
gridlayout* mainlayout;
|
|
public:
|
|
Settingwindow(LunaHost*);
|
|
};
|
|
|
|
class processlistwindow:public mainwindow{
|
|
gridlayout* mainlayout;
|
|
lineedit* g_hEdit;
|
|
button* g_hButton;
|
|
listview* g_hListBox;
|
|
button* g_refreshbutton;
|
|
std::unordered_map<std::wstring,std::vector<int>> g_exe_pid;
|
|
void PopulateProcessList(listview*,std::unordered_map<std::wstring,std::vector<int>>&);
|
|
public:
|
|
processlistwindow(mainwindow* parent=0);
|
|
void on_show();
|
|
};
|
|
class HooksearchText:public mainwindow{
|
|
gridlayout* layout;
|
|
lineedit* edittext;
|
|
button* checkok;
|
|
spinbox* codepage;
|
|
public:
|
|
HooksearchText(mainwindow*);
|
|
void call(std::set<DWORD>pids);
|
|
};
|
|
class Hooksearchsetting:public mainwindow{
|
|
gridlayout* layout;
|
|
spinbox* spinduration;
|
|
spinbox* spinoffset;
|
|
spinbox* spincap;
|
|
spinbox* spincodepage;
|
|
lineedit* editpattern;
|
|
lineedit* editmodule;
|
|
lineedit* editmaxaddr;
|
|
lineedit* editminaddr;
|
|
spinbox* spinpadding;
|
|
lineedit* editregex;
|
|
button* start;
|
|
public:
|
|
Hooksearchsetting(mainwindow*);
|
|
void call(std::set<DWORD>pids,std::wstring);
|
|
};
|
|
class Hooksearchwindow:public mainwindow{
|
|
checkbox* cjkcheck;
|
|
button* hs_default,*hs_text,*hs_user;
|
|
gridlayout* layout;
|
|
Hooksearchsetting* hooksearchsetting=0;
|
|
HooksearchText* hooksearchText=0;
|
|
public:
|
|
Hooksearchwindow(LunaHost* parent);
|
|
};
|
|
class LunaHost:public mainwindow{
|
|
Pluginwindow* pluginwindow=0;
|
|
std::map<int64_t,std::vector<std::wstring>>savetext;
|
|
std::set<DWORD>attachedprocess;
|
|
std::mutex settextmutex;
|
|
lineedit* g_hEdit_userhook;
|
|
gridlayout* mainlayout;
|
|
button* g_hButton_insert;
|
|
button* btnplugin;
|
|
//listbox* g_hListBox_listtext;
|
|
listview*g_hListBox_listtext;
|
|
multilineedit* g_showtexts;
|
|
button* g_selectprocessbutton;
|
|
button* btndetachall;
|
|
button* btnsearchhooks;
|
|
button* btnshowsettionwindow;
|
|
//button* btnsavehook;
|
|
processlistwindow *_processlistwindow=0;
|
|
Settingwindow *settingwindow=0;
|
|
Pluginmanager* plugins;
|
|
Hooksearchwindow * hooksearchwindow=0;
|
|
bool on_text_recv(TextThread& thread, std::wstring& sentence);
|
|
void on_text_recv_checkissaved(TextThread& thread);
|
|
void on_thread_create(TextThread& thread);
|
|
void on_thread_delete(TextThread& thread);
|
|
void on_proc_connect(DWORD pid);
|
|
void on_proc_disconnect(DWORD pid);
|
|
|
|
void showtext(const std::wstring&text,bool clear);
|
|
void updatelisttext(const std::wstring&text,LONG_PTR data);
|
|
public:
|
|
confighelper* configs;
|
|
int64_t currentselect=0;
|
|
bool check_toclipboard;
|
|
bool check_toclipboard_selection;
|
|
bool autoattach;
|
|
bool autoattach_savedonly;
|
|
std::set<std::string>autoattachexes;
|
|
std::unordered_map<std::string,nlohmann::json>savedhookcontext;
|
|
std::set<int>userdetachedpids;
|
|
std::set<int64_t>onceautoselectthread;
|
|
void on_close();
|
|
LunaHost();
|
|
friend class Settingwindow;
|
|
friend class Hooksearchwindow;
|
|
private:
|
|
void loadsettings();
|
|
void savesettings();
|
|
|
|
void doautoattach();
|
|
|
|
};
|