This commit is contained in:
恍兮惚兮 2024-11-09 19:44:30 +08:00
parent 222c0c56d0
commit 86703a520a
37 changed files with 77 additions and 77 deletions

View File

@ -99,3 +99,4 @@
#define PROC_DISCONN L"處理程序已中斷連接 %d"
#define COPYSELECTION L"自動將文字框中選取的文字複製到剪貼簿"
#define FONTSELECT L"選擇字體"
#define UNMATCHABLEVERSION L"LunaHook和LunaHost版本不匹配可能無法正常工作"

View File

@ -99,3 +99,4 @@
#define PROC_DISCONN L"process disconnected %d"
#define COPYSELECTION L"auto send selected text in textbox to clipboard"
#define FONTSELECT L"Select Font"
#define UNMATCHABLEVERSION L"LunaHook and LunaHost versions do not match, may not work properly!"

View File

@ -99,3 +99,4 @@
#define PROC_DISCONN L"Процесс отключен %d"
#define COPYSELECTION L"Автоматически копировать выделенный текст в буфер обмена"
#define FONTSELECT L"Выбрать шрифт"
#define UNMATCHABLEVERSION L"Версии LunaHook и LunaHost не совпадают и могут не работать должным образом!"

View File

@ -99,3 +99,4 @@
#define PROC_DISCONN L"进程已断开连接 %d"
#define COPYSELECTION L"自动将文本框中选取的文本复制到剪贴板"
#define FONTSELECT L"选择字体"
#define UNMATCHABLEVERSION L"LunaHook和LunaHost版本无法匹配可能无法正常工作"

View File

@ -34,6 +34,8 @@ DWORD WINAPI Pipe(LPVOID)
*(DWORD *)buffer = GetCurrentProcessId();
WriteFile(hookPipe, buffer, sizeof(DWORD), &count, nullptr);
WORD hookversion[4]=LUNA_VERSION;
WriteFile(hookPipe, hookversion, sizeof(hookversion), &count, nullptr);
ConsoleOutput(PIPE_CONNECTED);
HIJACK();

View File

@ -3,7 +3,7 @@ if(BUILD_GUI)
add_executable(LunaHost WIN32 confighelper.cpp controls.cpp main.cpp processlistwindow.cpp LunaHost.cpp window.cpp luna.rc pluginmanager.cpp Plugin/extensionimpl.cpp Plugin/copyclipboard.cpp QtLoader_inline.cpp app.manifest ${versioninfohost})
target_precompile_headers(LunaHost REUSE_FROM pch)
set_target_properties(LunaHost PROPERTIES OUTPUT_NAME "LunaHost${bitappendix}")
target_link_libraries(LunaHost comctl32 winhttp version pch host ${YY_Thunks_for_WinXP} nlohmann)
target_link_libraries(LunaHost comctl32 winhttp pch host ${YY_Thunks_for_WinXP} nlohmann)
endif()
if(BUILD_PLUGIN)

View File

@ -139,44 +139,6 @@ void LunaHost::on_proc_connect(DWORD pid)
}
}
bool queryversion(WORD *_1, WORD *_2, WORD *_3, WORD *_4)
{
wchar_t fileName[MAX_PATH];
GetModuleFileNameW(NULL, fileName, MAX_PATH);
DWORD dwHandle;
DWORD dwSize = GetFileVersionInfoSizeW(fileName, &dwHandle);
if (dwSize == 0)
{
return false;
}
std::vector<char> versionInfoBuffer(dwSize);
if (!GetFileVersionInfoW(fileName, dwHandle, dwSize, versionInfoBuffer.data()))
{
return false;
}
VS_FIXEDFILEINFO *pFileInfo;
UINT fileInfoSize;
if (!VerQueryValueW(versionInfoBuffer.data(), L"\\", reinterpret_cast<LPVOID *>(&pFileInfo), &fileInfoSize))
{
return false;
}
DWORD ms = pFileInfo->dwFileVersionMS;
DWORD ls = pFileInfo->dwFileVersionLS;
WORD majorVersion = HIWORD(ms);
WORD minorVersion = LOWORD(ms);
WORD buildNumber = HIWORD(ls);
WORD revisionNumber = LOWORD(ls);
*_1 = majorVersion;
*_2 = minorVersion;
*_3 = buildNumber;
*_4 = revisionNumber;
return true;
}
LunaHost::LunaHost()
{
@ -348,11 +310,11 @@ LunaHost::LunaHost()
} })
.detach();
WORD _1, _2, _3, _4;
WORD version[4] = LUNA_VERSION;
WCHAR vs[32];
if (queryversion(&_1, &_2, &_3, &_4))
{
wsprintf(vs, L" | %s v%d.%d.%d", VersionCurrent, _1, _2, _3);
wsprintf(vs, L" | %s v%d.%d.%d", VersionCurrent, version[0], version[1], version[2]);
title += vs;
settext(title);
std::thread([&]()

View File

@ -101,6 +101,12 @@ namespace
OnConnect(processId);
Host::AddConsoleOutput(FormatString(PROC_CONN,processId));
//CreatePipe();
WORD hookversion[4];
WORD hostversion[4]=LUNA_VERSION;
if( ReadFile(hookPipe, hookversion, sizeof(hookversion), &bytesRead, nullptr)){
if(memcmp(hostversion,hookversion,sizeof(hookversion))!=0)
Host::Warning(UNMATCHABLEVERSION);
}
while (ReadFile(hookPipe, buffer, PIPE_BUFFER_SIZE, &bytesRead, nullptr))
switch (*(HostNotificationType*)buffer)

View File

@ -1,8 +1,6 @@
#pragma once
// texthook/const.h
// 8/23/2013 jichi
// Branch: ITH/common.h, rev 128
#define LUNA_VERSION {VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_REVISION}
enum
{

View File

@ -2,5 +2,9 @@
set(VERSION_MAJOR 5)
set(VERSION_MINOR 56)
set(VERSION_PATCH 8)
set(VERSION_REVISION 0)
add_definitions(-DVERSION_MAJOR=${VERSION_MAJOR})
add_definitions(-DVERSION_MINOR=${VERSION_MINOR})
add_definitions(-DVERSION_PATCH=${VERSION_PATCH})
add_definitions(-DVERSION_REVISION=${VERSION_REVISION})
include(${CMAKE_CURRENT_LIST_DIR}/version/generate_product_version.cmake)

View File

@ -3,7 +3,7 @@ from traceback import print_exc
from myutils.proxy import getproxy
# fmt: off
allkata="ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶヽヾ",
allkata="ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶヽヾ"
allhira="ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔゕゖゝゞ"
hira_s=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","きゃ","きぃ","きゅ","きぇ","きょ","しゃ","しぃ","しゅ","しぇ","しょ","ちゃ","ちぃ","ちゅ","ちぇ","ちょ","にゃ","にぃ","にゅ","にぇ","にょ","ひゃ","ひぃ","ひゅ","ひぇ","ひょ","みゃ","みぃ","みゅ","みぇ","みょ","りゃ","りぃ","りゅ","りぇ","りょ","ぎゃ","ぎぃ","ぎゅ","ぎぇ","ぎょ","じゃ","じぃ","じゅ","じぇ","じょ","ぢゃ","ぢぃ","ぢゅ","ぢぇ","ぢょ","びゃ","びぃ","びゅ","びぇ","びょ","ぴゃ","ぴぃ","ぴゅ","ぴぇ","ぴょ","ぐぁ","ぐぃ","ぐぅ","ぐぇ","ぐぉ","つぁ","つぃ","つぇ","つぉ","ふぁ","ふぃ","ふぇ","ふぉ","うぁ","うぃ","うぅ","うぇ","うぉ","ヴぁ","ヴぃ","","ヴぇ","ヴぉ","でゃ","でぃ","でゅ","でぇ","でょ","てゃ","てぃ","てゅ","てぇ","てょ",""]
kata_s=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","キャ","キィ","キュ","キェ","キョ","シャ","シィ","シュ","シェ","ショ","チャ","チィ","チュ","チェ","チョ","ニャ","ニィ","ニュ","ニェ","ニョ","ヒャ","ヒィ","ヒュ","ヒェ","ヒョ","ミャ","ミィ","ミュ","ミェ","ミョ","リャ","リィ","リュ","リェ","リョ","ギャ","ギィ","ギュ","ギェ","ギョ","ジャ","ジィ","ジュ","ジェ","ジョ","ヂャ","ヂィ","ヂュ","ヂェ","ヂョ","ビャ","ビィ","ビュ","ビェ","ビョ","ピャ","ピィ","ピュ","ピェ","ピョ","グァ","グィ","グゥ","グェ","グォ","ツァ","ツィ","ツェ","ツォ","ファ","フィ","フェ","フォ","ウァ","ウィ","ウゥ","ウェ","ウォ","ヴァ","ヴィ","","ヴェ","ヴォ","デャ","ディ","デュ","デェ","デョ","テャ","ティ","テュ","テェ","テョ",""]

View File

@ -588,6 +588,7 @@ def _TR(k: str):
__ = "(" + __ + ")"
if not __:
__ = k
languageshow[k] = ""
return __

View File

@ -1,6 +1,7 @@
from myutils.subproc import subproc_w, autoproc
from translator.basetranslator import basetrans
import os, time
from myutils.config import _TR
import windows
@ -46,7 +47,7 @@ class TS(basetrans):
def x64(self, content):
if self.checkpath() == False:
return "error"
raise Exception(_TR("翻译器加载失败"))
ress = []
for line in content.split("\n"):
if len(line) == 0:

View File

@ -1,5 +1,6 @@
from myutils.subproc import subproc_w, autoproc
from translator.basetranslator import basetrans
from myutils.config import _TR
import os, time
import windows
@ -61,7 +62,7 @@ class TS(basetrans):
def x64(self, content):
if self.checkpath() == False:
return "error"
raise Exception(_TR("翻译器加载失败"))
codes = {"zh": "gbk", "ja": "shift-jis", "en": "utf8"}
ress = []
for line in content.split("\n"):

View File

@ -1,5 +1,5 @@
from translator.basetranslator import basetrans
import ctypes
from myutils.config import _TR
import os, time
import windows
from myutils.subproc import subproc_w, autoproc
@ -57,7 +57,7 @@ class TS(basetrans):
def x64(self, content: str):
if self.checkpath() == False:
return "error"
raise Exception(_TR("翻译器加载失败"))
content = content.replace("\r", "\n")
code1 = content.encode("utf-16-le")

View File

@ -2,6 +2,7 @@ from translator.basetranslator import basetrans
import ctypes
import os, time
import windows
from myutils.config import _TR
from myutils.subproc import subproc_w, autoproc
@ -69,9 +70,8 @@ class TS(basetrans):
def x64(self, content: str):
if self.tgtlang not in ["936", "950"]:
return ""
t = time.time()
if self.checkpath() == False:
return "error"
raise Exception(_TR("翻译器加载失败"))
content = content.replace("\r", "\n")
lines = content.split("\n")
ress = []

View File

@ -1,5 +1,6 @@
from myutils.subproc import subproc_w, autoproc
from translator.basetranslator import basetrans
from myutils.config import _TR
import os, time
import windows
@ -65,7 +66,7 @@ class TS(basetrans):
def x64(self, content):
if self.checkpath() == False:
return "error"
raise Exception(_TR("翻译器加载失败"))
ress = []
for line in content.split("\n"):
if len(line) == 0:

View File

@ -810,5 +810,6 @@
"无可用语言": "لا توجد لغة متاحة",
"过时的词典": "قاموس عفا عليها الزمن",
"其他工具": "أدوات أخرى",
"过时的翻译器": "عفا عليها الزمن مترجم"
"过时的翻译器": "عفا عليها الزمن مترجم",
"翻译器加载失败": "المترجم فشل التحميل"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "無可用語言",
"过时的词典": "過時的詞典",
"其他工具": "其他工具",
"过时的翻译器": "過時的翻譯器"
"过时的翻译器": "過時的翻譯器",
"翻译器加载失败": "翻譯器加載失敗"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Žádné dostupné jazyky",
"过时的词典": "Zastaralý slovník",
"其他工具": "Ostatní nástroje",
"过时的翻译器": "Zastaralý překladatel"
"过时的翻译器": "Zastaralý překladatel",
"翻译器加载失败": "Načítání překladatele selhalo"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Keine verfügbaren Sprachen",
"过时的词典": "Veraltetes Wörterbuch",
"其他工具": "Andere Werkzeuge",
"过时的翻译器": "Veralteter Übersetzer"
"过时的翻译器": "Veralteter Übersetzer",
"翻译器加载失败": "Laden des Übersetzers fehlgeschlagen"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "No available languages",
"过时的词典": "Outdated dictionary",
"其他工具": "Other tools",
"过时的翻译器": "Outdated translator"
"过时的翻译器": "Outdated translator",
"翻译器加载失败": "Translator loading failed"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "No hay idiomas disponibles",
"过时的词典": "Diccionarios obsoletos",
"其他工具": "Otras herramientas",
"过时的翻译器": "Traductores obsoletos"
"过时的翻译器": "Traductores obsoletos",
"翻译器加载失败": "Falló la carga del traductor"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Aucune langue disponible",
"过时的词典": "Dictionnaire obsolète",
"其他工具": "Autres outils",
"过时的翻译器": "Traducteur obsolète"
"过时的翻译器": "Traducteur obsolète",
"翻译器加载失败": "Le chargement du traducteur a échoué"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Nessuna lingua disponibile",
"过时的词典": "Dizionario obsoleto",
"其他工具": "Altri strumenti",
"过时的翻译器": "Traduttore obsoleto"
"过时的翻译器": "Traduttore obsoleto",
"翻译器加载失败": "Caricamento del traduttore non riuscito"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "使用可能な言語はありません",
"过时的词典": "時代遅れの辞書",
"其他工具": "その他のツール",
"过时的翻译器": "古い翻訳機"
"过时的翻译器": "古い翻訳機",
"翻译器加载失败": "翻訳機のロードに失敗しました"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "사용 가능한 언어 없음",
"过时的词典": "구식 사전",
"其他工具": "기타 도구",
"过时的翻译器": "오래된 번역기"
"过时的翻译器": "오래된 번역기",
"翻译器加载失败": "번역기 로드 실패"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Geen beschikbare talen",
"过时的词典": "Verouderd woordenboek",
"其他工具": "Andere hulpmiddelen",
"过时的翻译器": "Verouderde vertaler"
"过时的翻译器": "Verouderde vertaler",
"翻译器加载失败": "Laden van vertaler mislukt"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Brak dostępnych języków",
"过时的词典": "Przestarzały słownik",
"其他工具": "Inne narzędzia",
"过时的翻译器": "Przestarzały tłumacz"
"过时的翻译器": "Przestarzały tłumacz",
"翻译器加载失败": "Wczytanie tłumacza nie powiodło się"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Sem línguas disponíveis",
"过时的词典": "Dicionário desatualizado",
"其他工具": "Outras ferramentas",
"过时的翻译器": "Tradutor desatualizado"
"过时的翻译器": "Tradutor desatualizado",
"翻译器加载失败": "O carregamento do tradutor falhou"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Нет доступных языков",
"过时的词典": "Устаревший словарь",
"其他工具": "Другие инструменты",
"过时的翻译器": "Устаревший переводчик"
"过时的翻译器": "Устаревший переводчик",
"翻译器加载失败": "Ошибка загрузки переводчика"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Inga tillgängliga språk",
"过时的词典": "Föråldrad ordlista",
"其他工具": "Andra verktyg",
"过时的翻译器": "Föråldrad översättare"
"过时的翻译器": "Föråldrad översättare",
"翻译器加载失败": "Laddning av översättare misslyckades"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "ไม่มีภาษา",
"过时的词典": "พจนานุกรมที่ล้าสมัย",
"其他工具": "เครื่องมืออื่นๆ",
"过时的翻译器": "นักแปลล้าสมัย"
"过时的翻译器": "นักแปลล้าสมัย",
"翻译器加载失败": "โหลดนักแปลล้มเหลว"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Mevcut diller yok",
"过时的词典": "Eski sözlük",
"其他工具": "Diğer araçlar",
"过时的翻译器": "Eski çeviriciler"
"过时的翻译器": "Eski çeviriciler",
"翻译器加载失败": "Çevirme yüklemesi başarısız oldu"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Немає доступних мов",
"过时的词典": "Outdated dictionary",
"其他工具": "Інші інструменти",
"过时的翻译器": "Старений перекладач"
"过时的翻译器": "Старений перекладач",
"翻译器加载失败": "Спроба завантаження перекладача зазнала невдачі"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "Không có ngôn ngữ",
"过时的词典": "Từ điển lỗi thời",
"其他工具": "Công cụ khác",
"过时的翻译器": "Trình dịch lỗi thời"
"过时的翻译器": "Trình dịch lỗi thời",
"翻译器加载失败": "Trình dịch không tải được"
}

View File

@ -810,5 +810,6 @@
"无可用语言": "",
"过时的词典": "",
"过时的翻译器": "",
"其他工具": ""
"其他工具": "",
"翻译器加载失败": ""
}