This commit is contained in:
恍兮惚兮 2024-05-11 02:54:31 +08:00
parent f5243e1d2c
commit 692b8b5969
4 changed files with 18 additions and 12 deletions

View File

@ -61,8 +61,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/version)
include(generate_product_version)
set(VERSION_MAJOR 3)
set(VERSION_MINOR 1)
set(VERSION_PATCH 6)
set(VERSION_MINOR 2)
set(VERSION_PATCH 0)
set(VERSION_REVISION 0)
if(BUILD_CORE)

View File

@ -215,12 +215,10 @@ LunaHost::LunaHost(){
g_hListBox_listtext->oncurrentchange=[&](int idx){
uint64_t handle = g_hListBox_listtext->getdata(idx);
std::wstring get;
for(auto& _:savetext.at(handle)){
get+=_;
get+=L"\n";
}
currentselect=handle;
showtext(get,true);
std::wstring copy=Host::GetThread(handle)->storage->c_str();
strReplace(copy,L"\n",L"\r\n");
showtext(copy,true);
};
g_hListBox_listtext->on_menu=[&]()->maybehavemenu{
auto handle = g_hListBox_listtext->getdata(g_hListBox_listtext->currentidx());
@ -403,10 +401,10 @@ bool LunaHost::on_text_recv(TextThread& thread, std::wstring& output){
updatelisttext(output,thread.handle);
savetext.at(thread.handle).push_back(output);
if(currentselect==thread.handle){
showtext(output,false);
}
output+=L'\n';
return true;
}
void LunaHost::on_thread_create(TextThread& thread){
@ -418,7 +416,6 @@ void LunaHost::on_thread_create(TextThread& thread){
thread.tp.ctx,
thread.tp.ctx2
);
savetext.insert({thread.handle,{}});
int index=g_hListBox_listtext->additem(buff,NULL);
g_hListBox_listtext->setdata(index,thread.handle);
}

View File

@ -79,7 +79,6 @@ public:
};
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;

View File

@ -44,6 +44,7 @@ C_LUNA_API void Luna_Start(ProcessEvent Connect, ProcessEvent Disconnect, Thread
{
XXXX
Output(hookcode, name, thread.tp, output.c_str());
output+=L'\n';
return true;
},
[=](std::wstring &output)
@ -72,12 +73,13 @@ C_LUNA_API void Luna_Detach(DWORD pid)
Host::DetachProcess(pid);
}
C_LUNA_API void Luna_Settings(int flushDelay, bool filterRepetition, int defaultCodepage, int maxBufferSize)
C_LUNA_API void Luna_Settings(int flushDelay, bool filterRepetition, int defaultCodepage, int maxBufferSize, int maxHistorySize)
{
TextThread::flushDelay = flushDelay;
TextThread::filterRepetition = filterRepetition;
Host::defaultCodepage = defaultCodepage;
TextThread::maxBufferSize = maxBufferSize;
TextThread::maxHistorySize=maxHistorySize;
}
C_LUNA_API bool Luna_InsertHookCode(DWORD pid, LPCWSTR hookcode)
@ -87,7 +89,15 @@ C_LUNA_API bool Luna_InsertHookCode(DWORD pid, LPCWSTR hookcode)
Host::InsertHook(pid, hp.value());
return hp.has_value();
}
C_LUNA_API wchar_t* Luna_QueryThreadHistory(ThreadParam tp){
auto s=Host::GetThread(tp).storage.Acquire();
auto str=(wchar_t*)malloc(sizeof(wchar_t)*(s->size()+1));
wcscpy(str,s->c_str());
return str;
}
C_LUNA_API void Luna_FreePtr(void* ptr){
free(ptr);
}
C_LUNA_API void Luna_RemoveHook(DWORD pid, uint64_t addr)
{
Host::RemoveHook(pid, addr);