mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 23:53:54 +08:00
some
This commit is contained in:
parent
f19773372b
commit
78c88dae3b
@ -20,7 +20,7 @@
|
||||
- **HOOK** 支持使用HOOK方式获取文本,支持使用特殊码,支持自动保存游戏及HOOK、自动加载HOOK等。对于部分引擎,还支持内嵌翻译。对于不支持或支持不好的游戏,请[提交反馈](https://github.com/HIllya51/LunaTranslator/issues/new?assignees=&labels=enhancement&projects=&template=01_game_request.yaml)
|
||||
|
||||
|
||||
- **OCR** 支持 **离线OCR** ( 除内置OCR引擎外,还支持WindowsOCR、Tessearact5、manga-ocr、WeChat/QQ OCR ) 和 **在线OCR** ( 百度、有道、飞书、讯飞、Google Lens、Google Cloud Vision、docsumo、ocrspace、Gemini、ChatGPT兼容接口 )
|
||||
- **OCR** 支持 **离线OCR** ( 除内置OCR引擎外,还支持WindowsOCR、Tessearact5、manga-ocr、WeChat/QQ OCR ) 和 **在线OCR** ( 百度、有道、讯飞、Google Lens、Google Cloud Vision、docsumo、ocrspace、Gemini、ChatGPT兼容接口 )
|
||||
|
||||
- **剪贴板** 支持从剪贴板中获取文本进行翻译
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
- **免费在线翻译** 支持使用百度、必应、谷歌、阿里、有道、彩云、搜狗、讯飞、腾讯、字节、火山、DeepL/DeepLX、papago、yandex、lingva、reverso、TranslateCom、ModernMT
|
||||
|
||||
- **注册在线翻译** 支持使用用户注册的 **传统翻译** ( 百度、腾讯、有道、小牛、彩云、火山、DeepL、yandex、google、ibm、Azure、飞书 ) 和 **大模型翻译** ( ChatGPT兼容接口、claude、cohere、gemini、百度千帆、腾讯混元 )
|
||||
- **注册在线翻译** 支持使用用户注册的 **传统翻译** ( 百度、腾讯、有道、小牛、彩云、火山、DeepL、yandex、google、ibm、Azure ) 和 **大模型翻译** ( ChatGPT兼容接口、claude、cohere、gemini、百度千帆、腾讯混元 )
|
||||
|
||||
- **离线翻译** 支持 **传统翻译** ( J北京7、金山快译、译典通、ezTrans、Sugoi、MT5 ) 和离线部署的 **大模型翻译** ( ChatGPT兼容接口、Sakura大模型 )
|
||||
|
||||
|
@ -101,7 +101,7 @@ bool InsertAliceHook()
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool Alice::attach_function()
|
||||
bool Alice::attach_function_()
|
||||
{
|
||||
|
||||
return InsertAliceHook();
|
||||
|
@ -6,7 +6,10 @@ public:
|
||||
Alice()
|
||||
{
|
||||
|
||||
check_by = CHECK_BY::ALL_TRUE;
|
||||
check_by = CHECK_BY::CUSTOM;
|
||||
check_by_target = [this]()
|
||||
{ return attach_function_(); };
|
||||
};
|
||||
bool attach_function();
|
||||
bool attach_function_();
|
||||
bool attach_function() { return true; }
|
||||
};
|
@ -1,25 +1,50 @@
|
||||
#include "TerraLunar.h"
|
||||
|
||||
bool TerraLunar::attach_function()
|
||||
namespace
|
||||
{
|
||||
const BYTE bytes[] = {
|
||||
// らくえん~あいかわらずなぼく。の場合~
|
||||
0x8A, 0x08,
|
||||
0x81, 0xF9, 0x9F, 0x00, 0x00, 0x00,
|
||||
0x7E};
|
||||
auto addrs = Util::SearchMemory(bytes, sizeof(bytes), PAGE_EXECUTE, processStartAddress, processStopAddress);
|
||||
auto succ = false;
|
||||
for (auto addr : addrs)
|
||||
bool H1()
|
||||
{
|
||||
const BYTE bytes[] = {
|
||||
// らくえん~あいかわらずなぼく。の場合~
|
||||
0x8A, 0x08,
|
||||
0x81, 0xF9, 0x9F, 0x00, 0x00, 0x00,
|
||||
0x7E};
|
||||
auto addrs = Util::SearchMemory(bytes, sizeof(bytes), PAGE_EXECUTE, processStartAddress, processStopAddress);
|
||||
auto succ = false;
|
||||
for (auto addr : addrs)
|
||||
{
|
||||
HookParam hp;
|
||||
hp.address = addr;
|
||||
hp.offset = get_reg(regs::eax);
|
||||
hp.type = USING_STRING;
|
||||
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
|
||||
{
|
||||
StringFilter(buffer, "[w]", 3);
|
||||
};
|
||||
succ |= NewHook(hp, "TerraLunar");
|
||||
}
|
||||
return succ;
|
||||
}
|
||||
bool H2()
|
||||
{
|
||||
const BYTE bytes[] = {
|
||||
// https://vndb.org/v2416
|
||||
// ナースのお勉強 応用編~受けシチュ以外は絶対禁止!~
|
||||
0X8B, 0X4D, 0X0C, 0X0F, 0XBE, 0X51, 0X01, 0XB8, 0X00, 0X01, 0X00, 0X00};
|
||||
auto addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
|
||||
if (!addr)
|
||||
return false;
|
||||
addr = MemDbg::findEnclosingAlignedFunction(addr);
|
||||
if (!addr)
|
||||
return false;
|
||||
HookParam hp;
|
||||
hp.address = addr;
|
||||
hp.offset = get_reg(regs::eax);
|
||||
hp.offset = get_stack(2);
|
||||
hp.type = USING_STRING;
|
||||
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
|
||||
{
|
||||
StringFilter(buffer, "[w]", 3);
|
||||
};
|
||||
succ |= NewHook(hp, "TerraLunar");
|
||||
return NewHook(hp, "AtelierD");
|
||||
}
|
||||
return succ;
|
||||
}
|
||||
bool TerraLunar::attach_function()
|
||||
{
|
||||
|
||||
return H2() | H1();
|
||||
}
|
@ -50,7 +50,7 @@ bool monodll()
|
||||
return succ;
|
||||
}
|
||||
|
||||
bool mono::attach_function()
|
||||
bool mono::attach_function_()
|
||||
{
|
||||
|
||||
bool common = monocommon::hook_mono_il2cpp();
|
||||
|
@ -1,10 +1,15 @@
|
||||
|
||||
|
||||
class mono:public ENGINE{
|
||||
public:
|
||||
mono(){
|
||||
|
||||
check_by=CHECK_BY::ALL_TRUE;
|
||||
class mono : public ENGINE
|
||||
{
|
||||
public:
|
||||
mono()
|
||||
{
|
||||
|
||||
check_by = CHECK_BY::CUSTOM;
|
||||
check_by_target = [this]()
|
||||
{ return attach_function_(); };
|
||||
};
|
||||
bool attach_function();
|
||||
bool attach_function_();
|
||||
bool attach_function() { return true; }
|
||||
};
|
||||
|
@ -81,7 +81,7 @@ namespace
|
||||
return suc;
|
||||
}
|
||||
}
|
||||
bool mono::attach_function()
|
||||
bool mono::attach_function_()
|
||||
{
|
||||
bool common = monocommon::hook_mono_il2cpp();
|
||||
return common;
|
||||
|
@ -6,7 +6,10 @@ public:
|
||||
mono()
|
||||
{
|
||||
|
||||
check_by = CHECK_BY::ALL_TRUE;
|
||||
check_by = CHECK_BY::CUSTOM;
|
||||
check_by_target = [this]()
|
||||
{ return attach_function_(); };
|
||||
};
|
||||
bool attach_function();
|
||||
bool attach_function_();
|
||||
bool attach_function() { return true; }
|
||||
};
|
||||
|
@ -1,22 +1,29 @@
|
||||
|
||||
#include"python/python.h"
|
||||
#include "python/python.h"
|
||||
|
||||
class Renpy:public ENGINE{
|
||||
public:
|
||||
Renpy(){
|
||||
//使用lunatranslator启动游戏,会把cwd修改成exe所在目录,其中没有.py
|
||||
check_by=CHECK_BY::ALL_TRUE;
|
||||
// check_by=CHECK_BY::CUSTOM;
|
||||
// check_by_target=[](){
|
||||
// //Renpy - sample game https://vndb.org/v19843
|
||||
// return Util::CheckFile(L"*.py")|| GetModuleHandleW(L"librenpython.dll");
|
||||
// };
|
||||
};
|
||||
bool attach_function(){
|
||||
#ifndef _WIN64
|
||||
class Renpy : public ENGINE
|
||||
{
|
||||
public:
|
||||
Renpy()
|
||||
{
|
||||
// 使用lunatranslator启动游戏,会把cwd修改成exe所在目录,其中没有.py
|
||||
// check_by=CHECK_BY::CUSTOM;
|
||||
// check_by_target=[](){
|
||||
// //Renpy - sample game https://vndb.org/v19843
|
||||
// return Util::CheckFile(L"*.py")|| GetModuleHandleW(L"librenpython.dll");
|
||||
// };
|
||||
|
||||
check_by = CHECK_BY::CUSTOM;
|
||||
check_by_target = [this]()
|
||||
{ return attach_function_(); };
|
||||
};
|
||||
bool attach_function() { return true; }
|
||||
bool attach_function_()
|
||||
{
|
||||
#ifndef _WIN64
|
||||
return InsertRenpyHook();
|
||||
#else
|
||||
return InsertRenpyHook()||InsertRenpy3Hook();
|
||||
#endif
|
||||
#else
|
||||
return InsertRenpyHook() || InsertRenpy3Hook();
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
@ -111,6 +111,5 @@ bool InsertRenpyHook()
|
||||
}
|
||||
}
|
||||
}
|
||||
ConsoleOutput("Ren'py failed: failed to find python2X.dll");
|
||||
return false;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
set(VERSION_MAJOR 5)
|
||||
set(VERSION_MINOR 58)
|
||||
set(VERSION_PATCH 4)
|
||||
set(VERSION_PATCH 5)
|
||||
set(VERSION_REVISION 0)
|
||||
add_definitions(-DVERSION_MAJOR=${VERSION_MAJOR})
|
||||
add_definitions(-DVERSION_MINOR=${VERSION_MINOR})
|
||||
|
@ -157,10 +157,6 @@ If your account has multiple applications, the last application you operated wil
|
||||
|
||||
https://www.xfyun.cn/doc/platform/quickguide.html
|
||||
|
||||
#### **Feishu**
|
||||
|
||||
https://open.feishu.cn/document/server-docs/ai/optical_char_recognition-v1/basic_recognize
|
||||
|
||||
#### **Google Cloud Vision**
|
||||
|
||||
https://cloud.google.com/vision/docs
|
||||
|
@ -153,10 +153,6 @@ https://yandex.cloud/en/services/translate
|
||||
|
||||
https://www.huaweicloud.com/product/nlpmt.html
|
||||
|
||||
#### **Feishu**
|
||||
|
||||
https://open.feishu.cn/document/server-docs/ai/translation-v1/translate
|
||||
|
||||
#### **IBM**
|
||||
|
||||
https://cloud.ibm.com/apidocs/language-translator
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
- **HOOK** Supports obtaining text using HOOK methods, supports the use of special codes, supports automatic saving of games and HOOKs, automatic loading of HOOKs, etc. For some engines, it also supports embedded translation. For games that are not supported or not well supported, please [submit feedback](https://github.com/HIllya51/LunaTranslator/issues/new?assignees=&labels=enhancement&projects=&template=01_game_request.yaml)
|
||||
|
||||
- **OCR** supports **offline OCR** (in addition to the built-in OCR engine, it also supports WindowsOCR, Tesseract5, manga-ocr, WeChat/QQ OCR) and **online OCR** (Baidu, Youdao, Feishu, iFlytek, Google Lens, Google Cloud Vision, docsumo, ocrspace, Gemini, ChatGPT-compatible interfaces).
|
||||
- **OCR** supports **offline OCR** (in addition to the built-in OCR engine, it also supports WindowsOCR, Tesseract5, manga-ocr, WeChat/QQ OCR) and **online OCR** (Baidu, Youdao, iFlytek, Google Lens, Google Cloud Vision, docsumo, ocrspace, Gemini, ChatGPT-compatible interfaces).
|
||||
|
||||
- **Clipboard** Supports obtaining text from the clipboard for translation
|
||||
|
||||
@ -32,7 +32,7 @@ Supports almost all conceivable translation engines, including:
|
||||
|
||||
- **Free Online Translation** Supports Baidu, Bing, Google, Alibaba, Youdao, Caiyun, Sogou, iFlytek, Tencent, ByteDance, Volcano, DeepL/DeepLX, papago, yandex, lingva, reverso, TranslateCom, ModernMT
|
||||
|
||||
- **Registered Online Translation** Supports user-registered **traditional translation** (Baidu, Tencent, Youdao, Xiaoniu, Caiyun, Volcano, DeepL, yandex, google, ibm, Azure, Lark) and **large model translation** (ChatGPT compatible interface, claude, cohere, gemini, Baidu Qianfan, Tencent Hunyuan)
|
||||
- **Registered Online Translation** Supports user-registered **traditional translation** (Baidu, Tencent, Youdao, Xiaoniu, Caiyun, Volcano, DeepL, yandex, google, ibm, Azure) and **large model translation** (ChatGPT compatible interface, claude, cohere, gemini, Baidu Qianfan, Tencent Hunyuan)
|
||||
|
||||
- **Offline Translation** Supports **traditional translation** (J Beijing 7, Kingsoft, Yidiantong, ezTrans, Sugoi, MT5) and offline deployed **large model translation** (ChatGPT compatible interface, Sakura large model)
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
- **HOOK** Поддерживает получение текста с использованием метода HOOK, поддерживает использование специальных кодов, поддерживает автоматическое сохранение игр и HOOK, автоматическое загрузка HOOK и т.д. Для некоторых движков также поддерживается встроенная трансляция. Для игр, которые не поддерживаются или плохо поддерживаются, пожалуйста, [отправьте обратную связь](https://github.com/HIllya51/LunaTranslator/issues/new?assignees=&labels=enhancement&projects=&template=01_game_request.yaml)
|
||||
|
||||
|
||||
- **OCR** поддерживает **офлайн OCR** (помимо встроенного OCR-движка, также поддерживает WindowsOCR, Tesseract5, manga-ocr, WeChat/QQ OCR) и **онлайн OCR** (Baidu, Youdao, Feishu, iFlytek, Google Lens, Google Cloud Vision, docsumo, ocrspace, Gemini, совместимые интерфейсы ChatGPT).
|
||||
- **OCR** поддерживает **офлайн OCR** (помимо встроенного OCR-движка, также поддерживает WindowsOCR, Tesseract5, manga-ocr, WeChat/QQ OCR) и **онлайн OCR** (Baidu, Youdao, iFlytek, Google Lens, Google Cloud Vision, docsumo, ocrspace, Gemini, совместимые интерфейсы ChatGPT).
|
||||
|
||||
- **Буфер обмена** Поддерживает получение текста из буфера обмена для перевода
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
- **Бесплатные онлайн переводы** Поддерживает использование Baidu, Bing, Google, Alibaba, Youdao, Caiyun, Sogou, iFlytek, Tencent, ByteDance, Volcano, DeepL/DeepLX, papago, yandex, lingva, reverso, TranslateCom, ModernMT
|
||||
|
||||
- **Зарегистрированные онлайн переводы** Поддерживает использование зарегистрированных пользователем **традиционных переводов** ( Baidu, Tencent, Youdao, Xiaoniu, Caiyun, Volcano, DeepL, yandex, google, ibm, Azure, Lark ) и **больших моделей перевода** ( интерфейс совместимый с ChatGPT, claude, cohere, gemini, Baidu Qianfan, Tencent Hunyuan )
|
||||
- **Зарегистрированные онлайн переводы** Поддерживает использование зарегистрированных пользователем **традиционных переводов** ( Baidu, Tencent, Youdao, Xiaoniu, Caiyun, Volcano, DeepL, yandex, google, ibm, Azure ) и **больших моделей перевода** ( интерфейс совместимый с ChatGPT, claude, cohere, gemini, Baidu Qianfan, Tencent Hunyuan )
|
||||
|
||||
- **Оффлайн перевод** Поддерживает **традиционный перевод** ( J Beijing 7, Kingsoft, Yidiantong, ezTrans, Sugoi, MT5 ) и оффлайн развернутый **большой модельный перевод** ( интерфейс совместимый с ChatGPT, Sakura большой модель )
|
||||
|
||||
|
@ -161,10 +161,6 @@ https://www.volcengine.com/docs/6790/116978
|
||||
|
||||
https://www.xfyun.cn/doc/platform/quickguide.html
|
||||
|
||||
#### **Feishu**
|
||||
|
||||
https://open.feishu.cn/document/server-docs/ai/optical_char_recognition-v1/basic_recognize
|
||||
|
||||
#### **Google Cloud Vision**
|
||||
|
||||
https://cloud.google.com/vision/docs
|
||||
|
@ -154,10 +154,6 @@ https://yandex.cloud/en/services/translate
|
||||
|
||||
https://www.huaweicloud.com/product/nlpmt.html
|
||||
|
||||
#### **Feishu**
|
||||
|
||||
https://open.feishu.cn/document/server-docs/ai/translation-v1/translate
|
||||
|
||||
#### **IBM**
|
||||
|
||||
https://cloud.ibm.com/apidocs/language-translator
|
||||
|
@ -161,9 +161,9 @@ https://www.volcengine.com/docs/6790/116978
|
||||
|
||||
https://www.xfyun.cn/doc/platform/quickguide.html
|
||||
|
||||
#### **飞书**
|
||||
<!-- #### **飞书**
|
||||
|
||||
https://open.feishu.cn/document/server-docs/ai/optical_char_recognition-v1/basic_recognize
|
||||
https://open.feishu.cn/document/server-docs/ai/optical_char_recognition-v1/basic_recognize -->
|
||||
|
||||
#### **Google Cloud Vision**
|
||||
|
||||
|
@ -154,9 +154,9 @@ https://yandex.cloud/en/services/translate
|
||||
|
||||
https://www.huaweicloud.com/product/nlpmt.html
|
||||
|
||||
#### **飞书**
|
||||
<!-- #### **飞书**
|
||||
|
||||
https://open.feishu.cn/document/server-docs/ai/translation-v1/translate
|
||||
https://open.feishu.cn/document/server-docs/ai/translation-v1/translate -->
|
||||
|
||||
#### **IBM**
|
||||
|
||||
|
@ -191,7 +191,7 @@ class TableViewW(QTableView):
|
||||
def removeselectedrows(self):
|
||||
curr = self.currentIndex()
|
||||
if not curr.isValid():
|
||||
return
|
||||
return []
|
||||
row = curr.row()
|
||||
col = curr.column()
|
||||
skip = []
|
||||
|
@ -11,7 +11,7 @@ from myutils.utils import (
|
||||
parsemayberegexreplace,
|
||||
safe_escape,
|
||||
is_ascii_symbo,
|
||||
is_ascii_control
|
||||
is_ascii_control,
|
||||
)
|
||||
from myutils.config import (
|
||||
postprocessconfig,
|
||||
@ -191,10 +191,8 @@ def _13_fEX(line: str):
|
||||
|
||||
|
||||
def _1_f(line):
|
||||
r = re.compile(r"\{(.*?)/.*?\}")
|
||||
line = r.sub(lambda x: x.groups()[0], line)
|
||||
r = re.compile(r"\{(.*?):.*?\}")
|
||||
line = r.sub(lambda x: x.groups()[0], line)
|
||||
line = re.sub(r"\{(\w+)\}(.*?)\{\/\1\}", r"\2", line)
|
||||
line = re.sub(r"\{(.*?)[:/](.*?)\}", r"\1", line)
|
||||
return line
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user