This commit is contained in:
恍兮惚兮 2024-11-19 16:00:45 +08:00
parent 8c9e12f989
commit 8807005d45
88 changed files with 463 additions and 329 deletions

View File

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

View File

@ -99,4 +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!"
#define UNMATCHABLEVERSION L"The file version cannot be matched, may not work properly, please re-download again!"

View File

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

View File

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

View File

@ -4,7 +4,7 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(enginepath "engine64")
set(collector "enginecollection64.cpp")
else()
set(enginessrc Winters Cage AGE_System AksysGames RPGMaker Stronger TACTICS Onscripter Sceplay DISCOVERY Erogos godot A98SYS GuruGuruSMF4 TeethingRing Fizz CoffeeMaker VALKYRIA mirage CisLugI tamasoft FrontWing solfasys Diskdream splushwave ransel akatombo GASTRO GSX Aksys ScrPlayer SYSD KISS IGScript Jellyfish BKEngine Overflow SRPGStudio Suika2 FVP LCScript Ohgetsu RPGMakerRGSS3 ONScripterru OVERDRIVE HXP Palette Purple Ruf RUNE Tarte Tomato Sakuradog Troy VitaminSoft UnknownEngine TSSystem Xbangbang Anisetta Nijyuei Interheart LovaGame Giga Jisatu101 EntisGLS Ciel ACTGS TerraLunar PPSSPP jukujojidai PCSX2 VanillawareGC cef V8 mono PONScripter Bishop sakanagl Lightvn KiriKiri SideB BGI Bootup morning shyakunage Regista NNNConfig Eushully Majiro littlecheese Elf Silkys CMVS Wolf Circus1 Circus2 Cotopha Artemis CatSystem Atelier Tenco QLIE Pal AIL2 NeXAS LunaSoft Unicorn Rejet Interlude AdobeAir Retouch Malie Live Nexton Lucifen Waffle TinkerBell SystemAoi Yuris Nitroplus2 Bruns EME RRE Candy Speed ApricoT Triangle AB2Try MBLMED GameMaker DxLib CodeX Minori Sprite RpgmXP Eagls Debonosu C4 WillPlus Tanuki GXP AOS Mink YukaSystem2 sakusesu Exp Syuntada Pensil Anim hibiki Nitroplus Reallive Siglus Taskforce2 RUGP IronGameSystem Anex86 ShinyDaysGame MarineHeart ShinaRio CaramelBox UnisonShift Escude Ryokucha Alice Footy2 utawarerumono System4x Abalone Abel 5pb HorkEye XUSE Leaf Nekopack AXL AGS AdobeFlash10 FocasLens Tamamo Ages3ResT)
set(enginessrc Aromarie Winters Cage AGE_System AksysGames RPGMaker Stronger TACTICS Onscripter Sceplay DISCOVERY Erogos godot A98SYS GuruGuruSMF4 TeethingRing Fizz CoffeeMaker VALKYRIA mirage CisLugI tamasoft FrontWing solfasys Diskdream splushwave ransel akatombo GASTRO GSX Aksys ScrPlayer SYSD KISS IGScript Jellyfish BKEngine Overflow SRPGStudio Suika2 FVP LCScript Ohgetsu RPGMakerRGSS3 ONScripterru OVERDRIVE HXP Palette Purple Ruf RUNE Tarte Tomato Sakuradog Troy VitaminSoft UnknownEngine TSSystem Xbangbang Anisetta Nijyuei Interheart LovaGame Giga Jisatu101 EntisGLS Ciel ACTGS TerraLunar PPSSPP jukujojidai PCSX2 VanillawareGC cef V8 mono PONScripter Bishop sakanagl Lightvn KiriKiri SideB BGI Bootup morning shyakunage Regista NNNConfig Eushully Majiro littlecheese Elf Silkys CMVS Wolf Circus1 Circus2 Cotopha Artemis CatSystem Atelier Tenco QLIE Pal AIL2 NeXAS LunaSoft Unicorn Rejet Interlude AdobeAir Retouch Malie Live Nexton Lucifen Waffle TinkerBell SystemAoi Yuris Nitroplus2 Bruns EME RRE Candy Speed ApricoT Triangle AB2Try MBLMED GameMaker DxLib CodeX Minori Sprite RpgmXP Eagls Debonosu C4 WillPlus Tanuki GXP AOS Mink YukaSystem2 sakusesu Exp Syuntada Pensil Anim hibiki Nitroplus Reallive Siglus Taskforce2 RUGP IronGameSystem Anex86 ShinyDaysGame MarineHeart ShinaRio CaramelBox UnisonShift Escude Ryokucha Alice Footy2 utawarerumono System4x Abalone Abel 5pb HorkEye XUSE Leaf Nekopack AXL AGS AdobeFlash10 FocasLens Tamamo Ages3ResT)
set(enginepath "engine32")
set(collector "enginecollection32.cpp")
endif()
@ -14,8 +14,17 @@ set(enginessrc "${enginepath}/${enginessrc}.cpp")
message("${enginessrc}")
set_source_files_properties(${enginessrc} PROPERTIES SOURCE_ENCODING "UTF-8")
add_library(pchhook pchhook.cpp)
target_precompile_headers(pchhook PUBLIC pchhook.h)
add_library(hostmain main.cc)
target_link_libraries(hostmain VERSION_DEF minhook)
target_precompile_headers(hostmain REUSE_FROM pchhook)
set(texthook_src
main.cc
texthook.cc
hookfinder.cc
${enginessrc}
@ -26,11 +35,6 @@ set(texthook_src
veh_hook.cpp
)
add_library(pchhook pchhook.cpp)
target_precompile_headers(pchhook PUBLIC pchhook.h)
add_subdirectory(util)
add_subdirectory(engines)
@ -51,4 +55,4 @@ target_precompile_headers(LunaHook REUSE_FROM pchhook)
set_target_properties(LunaHook PROPERTIES OUTPUT_NAME "LunaHook${bitappendix}")
target_link_libraries(LunaHook Version httpapi ws2_32 Shlwapi pch minhook commonengine utils ${YY_Thunks_for_WinXP})
target_link_libraries(LunaHook hostmain Version httpapi ws2_32 Shlwapi pch minhook commonengine utils ${YY_Thunks_for_WinXP})

View File

@ -116,13 +116,13 @@ void detachall()
}
void solvefont(HookParam hp)
{
if (hp.hook_font)
if (hp.embed_hook_font)
{
attachFunction(hp.hook_font);
attachFunction(hp.embed_hook_font);
}
if (hp.hook_font & F_MultiByteToWideChar)
if (hp.embed_hook_font & F_MultiByteToWideChar)
disable_mbwc = true;
if (hp.hook_font & F_WideCharToMultiByte)
if (hp.embed_hook_font & F_WideCharToMultiByte)
disable_wcmb = true;
if (auto current_patch_fun = patch_fun.exchange(nullptr))
@ -208,12 +208,12 @@ bool waitforevent(UINT32 timems, const ThreadParam &tp, const std::wstring &orig
void TextHook::parsenewlineseperator(TextBuffer *buff)
{
if (!(hp.newlineseperator))
if (!(hp.lineSeparator))
return;
if (hp.type & CODEC_UTF16)
{
StringCharReplacer(buff, hp.newlineseperator, wcslen(hp.newlineseperator), L'\n');
StringCharReplacer(buff, hp.lineSeparator, wcslen(hp.lineSeparator), L'\n');
}
else if (hp.type & CODEC_UTF32)
return;
@ -221,8 +221,8 @@ void TextHook::parsenewlineseperator(TextBuffer *buff)
{
// ansi/utf8newlineseperator都是简单字符
std::string newlineseperatorA;
for (int i = 0; i < wcslen(hp.newlineseperator); i++)
newlineseperatorA += (char)hp.newlineseperator[i];
for (int i = 0; i < wcslen(hp.lineSeparator); i++)
newlineseperatorA += (char)hp.lineSeparator[i];
StringCharReplacer(buff, newlineseperatorA.c_str(), newlineseperatorA.size(), '\n');
}
}
@ -267,8 +267,8 @@ bool TextHook::waitfornotify(TextBuffer *buff, ThreadParam tp)
return false;
translatecache.insert(std::make_pair(hash, translate));
}
if (hp.newlineseperator)
strReplace(translate, L"\n", hp.newlineseperator);
if (hp.lineSeparator)
strReplace(translate, L"\n", hp.lineSeparator);
translate = adjustSpacesSTD(translate, hp);
if (commonsharedmem->keeprawtext)
translate = origin + L" " + translate;

View File

@ -605,7 +605,7 @@ namespace
hp.address = addr;
hp.offset = get_stack(1);
hp.type = USING_STRING | CODEC_UTF8 | EMBED_ABLE | EMBED_AFTER_NEW;
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
return NewHook(hp, "5bp");
}
bool __()
@ -699,7 +699,7 @@ namespace
xx = std::regex_replace(xx, std::wregex(L"\\\\x%l(.*?);(.*?);(.*?);#;"), L"$1");
buffer->from(xx);
};
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
return NewHook(hp, "5bp");
}

View File

@ -23,7 +23,7 @@ bool A98SYS::attach_function()
hp.address = addr;
hp.offset = get_stack(1);
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS;
hp.hook_font = F_ExtTextOutA;
hp.embed_hook_font = F_ExtTextOutA;
return NewHook(hp, "A98SYS");
}

View File

@ -52,6 +52,6 @@ bool AGE_System::attach_function()
hp.address = addr21;
hp.offset = get_stack(3);
hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | EMBED_AFTER_NEW;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
return NewHook(hp, "AGE_System");
}

View File

@ -14,7 +14,7 @@ bool InsertAnimHook()
myhp.address = addr + 10;
myhp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_AFTER_OVERWRITE | EMBED_DYNA_SJIS; // /HQ 不使用上下文区分 把所有线程的文本都提取
myhp.hook_font = F_GetGlyphOutlineA;
myhp.embed_hook_font = F_GetGlyphOutlineA;
// data_offset
myhp.offset = get_reg(regs::ecx);
char nameForUser[HOOK_NAME_SIZE] = "Anim";
@ -34,7 +34,7 @@ bool InsertAnim2Hook()
}
HookParam myhp;
myhp.address = addr + 10;
myhp.hook_font = F_GetGlyphOutlineA;
myhp.embed_hook_font = F_GetGlyphOutlineA;
// メスつまみ3
// そんな俺に声をかけてきたのは、近所のスーパーで働いている主婦の、@n『@[赤羽:あかばね]@[千晶:ちあき]』さんだ。
myhp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
@ -43,7 +43,7 @@ bool InsertAnim2Hook()
result = std::regex_replace(result, std::regex("@\\[(.*?):(.*?)\\]", std::regex_constants::icase), "$1");
buffer->from(result);
};
myhp.newlineseperator = L"@n";
myhp.lineSeparator = L"@n";
myhp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_AFTER_OVERWRITE | EMBED_DYNA_SJIS;
// 僕がいない間に変貌えられた妻の秘肉 ~ラブラブ新婚妻は他の男に抱かれ淫らに喘ぐ夢を見るか~ 体験版

View File

@ -0,0 +1,80 @@
#include "Aromarie.h"
// https://vndb.org/v2330
// 月ノ光太陽ノ影
bool Aromarie::attach_function()
{
auto name = []()
{
char aSelectNameVoic[] = "select name,voiceBase,soundMode from envCharacter where name=?;";
auto paSelectNameVoic = MemDbg::findBytes(aSelectNameVoic, sizeof(aSelectNameVoic), processStartAddress, processStopAddress);
if (!paSelectNameVoic)
return false;
auto push = MemDbg::findPushAddress(paSelectNameVoic, processStartAddress, processStopAddress);
if (!push)
return false;
auto addr = MemDbg::findEnclosingAlignedFunction(push);
if (!addr)
return false;
auto checks = findxref_reverse_checkcallop(addr, processStartAddress, processStopAddress, 0xe8);
if (!checks.size())
return false;
auto last = checks[checks.size() - 1];
addr = MemDbg::findEnclosingAlignedFunction(last);
if (!addr)
return false;
HookParam hp;
hp.address = addr;
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_OVERWRITE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.offset = get_stack(1);
return NewHook(hp, "AromarieName");
}();
auto text = []()
{
BYTE sig[] = {
// if ( (unsigned __int8)((v6 ^ 0x20) + 95) < 0x3Cu )
/*
.text:0040799E mov cl, al
.text:004079A0 xor ecx, 20h
.text:004079A3 add ecx, 5Fh ; '_'
.text:004079A6 and ecx, 0FFh
.text:004079AC cmp ecx, 3Ch ; '<'
.text:004079AF jl loc_407C13
.text:004079B5 cmp al, 5Ch ; '\'
*/
0x8A, 0xC8,
0x83, 0xF1, 0x20,
0x83, 0xC1, 0x5F,
0x81, 0xE1, 0xFF, 0x00, 0x00, 0x00,
0x83, 0xF9, 0x3C,
0x0F, XX, XX4,
0x3C, 0x5C};
auto check = MemDbg::findBytes(sig, sizeof(sig), processStartAddress, processStopAddress);
if (!check)
return false;
auto addr = MemDbg::findEnclosingAlignedFunction(check);
if (!addr)
return false;
auto checks = findxref_reverse_checkcallop(addr, processStartAddress, processStopAddress, 0xe8);
if (!checks.size())
return false;
auto last = checks[checks.size() - 1];
addr = MemDbg::findEnclosingAlignedFunction(last);
if (!addr)
return false;
HookParam hp;
hp.address = addr;
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.offset = get_stack(1);
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
auto s = buffer->strA();
s = std::regex_replace(s, std::regex(R"(\\\w)"), "");
s = std::regex_replace(s, std::regex(R"(%.*?%)"), "");
buffer->from(s);
};
return NewHook(hp, "AromarieText");
}();
return name && text;
}

View File

@ -0,0 +1,15 @@
// https://vndb.org/v2330
// 月ノ光太陽ノ影
class Aromarie : public ENGINE
{
public:
Aromarie()
{
check_by = CHECK_BY::FILE_ALL;
check_by_target = check_by_list{L"scene.db", L"script.axr", L"se.axr", L"system.db", L"user.db", L"koe.axr", L"cg.axr", L"bgm.axr"};
is_engine_certain = false;
};
bool attach_function();
};

View File

@ -75,7 +75,7 @@ bool InsertAtelierKaguya2Hook()
hp.address = addr;
hp.offset = get_reg(regs::eax);
hp.type = USING_STRING | EMBED_AFTER_OVERWRITE | EMBED_ABLE | EMBED_DYNA_SJIS;
hp.hook_font = F_TextOutA;
hp.embed_hook_font = F_TextOutA;
hp.filter_fun = NewLineCharToSpaceFilterA;
ConsoleOutput("INSERT Atelier KAGUYA2");

View File

@ -1190,14 +1190,14 @@ bool InsertBGIDynamicHook(LPVOID addr, DWORD frame, DWORD stack)
*/
ULONG addr, funaddr;
HookParam hp;
hp.hook_font = F_TextOutA | F_TextOutW;
hp.embed_hook_font = F_TextOutA | F_TextOutW;
if (addr = search_bgi3(processStartAddress, processStopAddress))
{
// 有乱码,无法处理。
Private::textIndex_ = 3;
hp.offset = get_stack(Private::textIndex_);
Private::type_ = Private::Type_BGI3;
hp.hook_font |= F_GetTextExtentPoint32W;
hp.embed_hook_font |= F_GetTextExtentPoint32W;
if (addr - processStartAddress == 0x3B860) //[220729][1171051][きゃべつそふと] ジュエリー・ハーツ・アカデミア -We will wing wonder world-,无法处理的乱码,不知道怎么回事。
addr = 0;
}
@ -1594,7 +1594,7 @@ bool InsertBGI4Hook()
}
};
hp.type = CODEC_UTF16 | USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_AFTER_OVERWRITE;
hp.hook_font = F_TextOutW | F_GetTextExtentPoint32W;
hp.embed_hook_font = F_TextOutW | F_GetTextExtentPoint32W;
hp.filter_fun = BGI7Filter;
hp.offset = get_stack(2);
ConsoleOutput("BGI4");

View File

@ -1194,7 +1194,7 @@ namespace
hp.address = addr;
hp.offset = get_stack(1);
hp.type = EMBED_ABLE | USING_STRING | EMBED_AFTER_NEW | EMBED_DYNA_SJIS;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
std::string str = buffer->strA();

View File

@ -241,7 +241,7 @@ bool InsertCatSystem2Hook()
auto _ = std::regex_replace(buffer->strA(), std::regex(R"(\[(.+?)/.+\])"), "$1");
buffer->from(_);
};
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
return NewHook(hp, "CatSystem2new");
}
namespace
@ -831,8 +831,8 @@ namespace
else
hp.type |= EMBED_DYNA_SJIS;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_fun = Private::hookafter;
hp.embed_hook_font = F_GetGlyphOutlineA;
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
buffer->from(std::regex_replace(buffer->strA(), std::regex(R"(\[(.+?)/.+\])"), "$1"));
@ -843,7 +843,7 @@ namespace
if (p)
{
hp.type |= EMBED_DYNA_SJIS;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
patch_fun = []()
{
if (*(WORD *)p == 0xc985)

View File

@ -72,7 +72,7 @@ namespace{
hp.address =addr;
hp.offset=get_stack(2);
hp.type = USING_STRING|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS;
hp.hook_font=F_GetGlyphOutlineA;
hp.embed_hook_font=F_GetGlyphOutlineA;
return NewHook(hp, "Circus1");
}
}

View File

@ -85,7 +85,7 @@ namespace
hp.address = funcaddr;
hp.offset = get_stack(2);
hp.type = USING_STRING; //|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS;
// hp.hook_font=F_GetGlyphOutlineA;
// hp.embed_hook_font=F_GetGlyphOutlineA;
// it will split a long to many lines
hp.filter_fun = filter;
@ -321,8 +321,8 @@ namespace
hp.address = addr;
hp.filter_fun = filter;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_fun = Private::hookafter;
hp.embed_hook_font = F_GetGlyphOutlineA;
hp.type = USING_STRING | EMBED_ABLE | NO_CONTEXT | EMBED_DYNA_SJIS;
return NewHook(hp, "EmbedCircus");

View File

@ -44,7 +44,7 @@ bool InsertCodeXHook()
hp.offset = get_reg(regs::eax);
hp.index = 0;
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_OVERWRITE | NO_CONTEXT; // 无法解决中文乱码
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
hp.filter_fun = CodeXFilter;
ConsoleOutput("INSERT CodeX");
@ -136,7 +136,7 @@ namespace
hp.offset = get_stack(1);
hp.split = get_stack(2);
hp.type = USING_STRING | FULL_STRING | NO_CONTEXT | USING_SPLIT | EMBED_ABLE | EMBED_AFTER_OVERWRITE;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
hp.filter_fun = CodeXFilter;
return NewHook(hp, "CodeX2");
}

View File

@ -777,7 +777,7 @@ namespace
hp.address = addr;
hp.offset = get_stack(3);
hp.type = CODEC_UTF16 | USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW;
hp.hook_font = F_GetGlyphOutlineW;
hp.embed_hook_font = F_GetGlyphOutlineW;
return NewHook(hp, "Cotopha5");
}
}

View File

@ -21,7 +21,7 @@ namespace
*split = FIXED_SPLIT_VALUE;
buffer->from_cs((char *)*(DWORD *)(stack->base + hp->offset));
}
void hook_after(hook_stack *s, TextBuffer buffer)
void embed_fun(hook_stack *s, TextBuffer buffer)
{
static std::string ts;
ts = buffer.viewA();
@ -60,8 +60,8 @@ namespace
hp.address = hook_addr;
hp.text_fun = SpecialHookDebonosuScenario;
// hp.type = USING_STRING;
hp.hook_after = hook_after;
hp.hook_font = F_MultiByteToWideChar | F_GetTextExtentPoint32A;
hp.embed_fun = embed_fun;
hp.embed_hook_font = F_MultiByteToWideChar | F_GetTextExtentPoint32A;
hp.type = USING_STRING | NO_CONTEXT | USING_SPLIT | FIXING_SPLIT | EMBED_ABLE | EMBED_DYNA_SJIS; // there is only one thread
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{

View File

@ -333,9 +333,9 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter1;
hp.embed_fun = Private::hookafter1;
hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.hook_font = F_TextOutA;
hp.embed_hook_font = F_TextOutA;
succ |= NewHook(hp, "EmbedElf");
hp.address = addr + 5;
hp.text_fun = Private::hookAfter;

View File

@ -24,7 +24,7 @@ bool EntisGLS::attach_function() {
HookParam hp;
hp.address = addr ;
hp.offset=get_stack(1);
hp.hook_font=F_GetGlyphOutlineW;
hp.embed_hook_font=F_GetGlyphOutlineW;
hp.type = USING_STRING|CODEC_UTF16|EMBED_ABLE|EMBED_AFTER_NEW;
return NewHook(hp, "EntisGLS");

View File

@ -216,7 +216,7 @@ namespace
*role = arg->role();
buffer->from_cs(trimmedText);
}
void hook_after(hook_stack *s, TextBuffer buffer)
void embed_fun(hook_stack *s, TextBuffer buffer)
{
static std::string data_;
data_ = buffer.strA();
@ -249,12 +249,12 @@ bool InsertEscudeHook()
HookParam hp;
hp.address = addr;
hp.text_fun = hook_before;
hp.hook_after = hook_after;
hp.hook_font = F_TextOutA | F_GetTextExtentPoint32A;
hp.embed_fun = embed_fun;
hp.embed_hook_font = F_TextOutA | F_GetTextExtentPoint32A;
hp.text_fun = SpecialHookEscude;
hp.filter_fun = EscudeFilter;
hp.type = USING_STRING | USING_SPLIT | NO_CONTEXT | EMBED_ABLE | EMBED_DYNA_SJIS; // NO_CONTEXT as this function is only called by one caller anyway
hp.newlineseperator = L"<r>";
hp.lineSeparator = L"<r>";
ConsoleOutput("INSERT Escude");
return NewHook(hp, "Escude");

View File

@ -519,7 +519,7 @@ bool InsertEushullyHook()
hp.address = lastCaller;
hp.type = USING_STRING | FIXING_SPLIT | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; // merging all threads
hp.offset = arg2_lpString; // arg2 = 0x4 * 2
hp.hook_font = F_MultiByteToWideChar | F_GetTextExtentPoint32A | F_GetGlyphOutlineA | F_CreateFontA;
hp.embed_hook_font = F_MultiByteToWideChar | F_GetTextExtentPoint32A | F_GetGlyphOutlineA | F_CreateFontA;
ConsoleOutput("INSERT Eushully");
bool succ = NewHook(hp, "ARCGameEngine");
if (thisCaller)

View File

@ -476,7 +476,7 @@ namespace
hp.address = addr;
hp.offset = get_stack(1);
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS;
hp.hook_font = F_DrawTextA | F_GetGlyphOutlineA;
hp.embed_hook_font = F_DrawTextA | F_GetGlyphOutlineA;
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
buffer->from(std::regex_replace(buffer->strA(), std::regex("\\[.+\\|(.+?)\\]"), "$1"));

View File

@ -412,10 +412,10 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hook2a;
hp.embed_fun = Private::hook2a;
hp.type = EMBED_ABLE | CODEC_UTF16 | USING_STRING | NO_CONTEXT;
hp.newlineseperator = L"%r";
hp.hook_font = F_GetGlyphOutlineW;
hp.lineSeparator = L"%r";
hp.embed_hook_font = F_GetGlyphOutlineW;
bool succ = NewHook(hp, "EmbedGXP");
hp.address = addr + 5;
hp.text_fun = Private::hookAfter;
@ -493,10 +493,10 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hook2a;
hp.embed_fun = Private::hook2a;
hp.type = EMBED_ABLE | CODEC_UTF16 | USING_STRING | NO_CONTEXT;
hp.newlineseperator = L"%r";
hp.hook_font = F_GetGlyphOutlineW;
hp.lineSeparator = L"%r";
hp.embed_hook_font = F_GetGlyphOutlineW;
bool succ = NewHook(hp, "EmbedGXP2");
hp.address = addr + 5;
hp.text_fun = Private::hookAfter;

View File

@ -256,9 +256,9 @@ bool InsertHorkEyeHook()
hp.offset = get_reg(regs::ebx);
hp.type = USING_STRING | NO_CONTEXT | FIXING_SPLIT | EMBED_ABLE | EMBED_DYNA_SJIS;
hp.text_fun = hookBefore<-4 - 1>;
hp.hook_after = hookafter<-4 - 1>;
hp.embed_fun = hookafter<-4 - 1>;
hp.filter_fun = HorkEyeFilter;
hp.newlineseperator = L"[n]";
hp.lineSeparator = L"[n]";
ConsoleOutput("INSERT HorkEye");
return NewHook(hp, "HorkEye");
@ -282,7 +282,7 @@ bool InsertHorkEyeHook()
hp.offset = get_stack(1);
hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.text_fun = hookBefore<1>;
hp.hook_after = hookafter<1>;
hp.embed_fun = hookafter<1>;
return NewHook(hp, "HorkEye2");
}
@ -325,7 +325,7 @@ bool InsertHorkEye3Hook()
hp.offset = get_stack(1);
hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.text_fun = hookBefore<1>;
hp.hook_after = hookafter<1>;
hp.embed_fun = hookafter<1>;
return NewHook(hp, "HorkEye3");
}
@ -359,7 +359,7 @@ bool InsertHorkEye4Hook()
hp.offset = get_reg(regs::eax);
hp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_DYNA_SJIS;
hp.text_fun = hookBefore<-1 - 1>;
hp.hook_after = hookafter<-1 - 1>;
hp.embed_fun = hookafter<-1 - 1>;
return NewHook(hp, "HorkEye4");
}

View File

@ -29,7 +29,7 @@ bool InsertKissHook() {
hp.address = addr;
hp.offset=get_reg(regs::esi);
hp.type = USING_STRING | NO_CONTEXT|EMBED_DYNA_SJIS|EMBED_ABLE|EMBED_AFTER_NEW;
hp.hook_font=F_GetTextExtentPoint32A|F_ExtTextOutA;
hp.embed_hook_font=F_GetTextExtentPoint32A|F_ExtTextOutA;
ConsoleOutput("INSERT Kiss");
return NewHook(hp, "Kiss");
}

View File

@ -1417,7 +1417,7 @@ namespace
hp.address = addr;
hp.type = EMBED_ABLE | CODEC_UTF16 | NO_CONTEXT;
hp.text_fun = hookBefore;
hp.hook_after = hookafter;
hp.embed_fun = hookafter;
return NewHook(hp, "EmbedKrkr2");
}
@ -1609,9 +1609,9 @@ dl 16
hp.address = addr;
hp.type = EMBED_ABLE | CODEC_UTF8 | NO_CONTEXT | USING_STRING;
hp.text_fun = hookBeforez;
hp.hook_after = after;
hp.newlineseperator = L"\\n";
hp.hook_font = F_GetTextExtentPoint32W | F_GetGlyphOutlineW;
hp.embed_fun = after;
hp.lineSeparator = L"\\n";
hp.embed_hook_font = F_GetTextExtentPoint32W | F_GetGlyphOutlineW;
succ |= NewHook(hp, "EmbedKrkrZ");
// return true;
}
@ -1682,7 +1682,7 @@ namespace
return buffer->clear();
buffer->from(t);
};
hp.hook_after = [](hook_stack *s, TextBuffer buffer)
hp.embed_fun = [](hook_stack *s, TextBuffer buffer)
{
auto t = std::wstring((wchar_t *)s->stack[off / 4]);
auto newText = buffer.strW();
@ -1692,7 +1692,7 @@ namespace
newText = newText + L"[r]"; // 揺り籠より天使まで
wcscpy((wchar_t *)s->stack[off / 4], newText.c_str());
};
hp.hook_font = F_GetTextExtentPoint32W | F_GetGlyphOutlineW;
hp.embed_hook_font = F_GetTextExtentPoint32W | F_GetGlyphOutlineW;
return NewHook(hp, "Krkr2wcs");
}
}

View File

@ -676,16 +676,16 @@ namespace
HookParam hp;
hp.address = addr1;
hp.text_fun = Private::hook1;
hp.hook_after = Private::hookafter;
hp.embed_fun = Private::hookafter;
hp.type = EMBED_ABLE | NO_CONTEXT;
hp.newlineseperator = L"\x01";
hp.hook_font = F_GetGlyphOutlineA;
hp.lineSeparator = L"\x01";
hp.embed_hook_font = F_GetGlyphOutlineA;
if (dyna)
{
static ULONG dynas;
dynas = dyna;
hp.type |= EMBED_DYNA_SJIS;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
patch_fun = []()
{
ReplaceFunction((PVOID)dynas, (PVOID)(ULONG)isLeadByteChar);

View File

@ -455,14 +455,14 @@ bool InsertLeafHook()
// 这个会卡死,无解
// hp.address=addr1+7;
// hp.hook_before=Private::hook1;
// hp.hook_after=Private::hookafterbf;
// hp.embed_fun=Private::hookafterbf;
// hp.type=EMBED_ABLE;
// NewHook(hp,"EmbedLeaf");
hp1.address = addr2 + 7;
hp1.text_fun = hook2;
hp1.hook_after = hook2a;
hp1.embed_fun = hook2a;
hp1.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp1.newlineseperator = L"\\n";
hp1.lineSeparator = L"\\n";
succ |= NewHook(hp1, "EmbedLeaf");
return succ;
}
@ -770,7 +770,7 @@ namespace
hp.address = addr;
hp.offset = get_stack(1);
hp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_DYNA_SJIS | EMBED_AFTER_NEW;
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
hp.filter_fun = AquaplusFilter;
return NewHook(hp, "wa2special");
}

View File

@ -506,7 +506,7 @@ namespace
HookParam hp;
hp.address = addr1;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter1;
hp.embed_fun = Private::hookafter1;
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
auto succ = NewHook(hp, "EMBEDLUNA");
hp.address = addr2;

View File

@ -233,7 +233,7 @@ bool InsertMajiroHook3x() {
hp.offset=get_reg(regs::ecx);
hp.type = USING_STRING | NO_CONTEXT;//|EMBED_ABLE|EMBED_AFTER_OVERWRITE|EMBED_DYNA_SJIS;
//可以内嵌但是必须保持「」且DynamicEncoding编码的文字会被自动替换成引擎内的某的字符导致可读性低。
//hp.hook_font=F_TextOutA|F_GetTextExtentPoint32A;
//hp.embed_hook_font=F_TextOutA|F_GetTextExtentPoint32A;
//https://vndb.org/v17376
//私が好きなら「好き」って言って!
hp.text_fun= [](hook_stack *stack, HookParam *hp, TextBuffer *buffer, uintptr_t *split){

View File

@ -1473,7 +1473,7 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.embed_fun = Private::hookafter;
hp.type = CODEC_UTF16 | EMBED_ABLE | NO_CONTEXT;
return NewHook(hp, "EmbedMalie");
}

View File

@ -665,9 +665,9 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBeforehookBefore;
hp.hook_after = Private::hookafter;
hp.embed_fun = Private::hookafter;
hp.type = EMBED_ABLE | USING_STRING | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
buffer->from(std::regex_replace(buffer->strA(), std::regex("\\{.*?\\}"), ""));
@ -678,7 +678,7 @@ namespace
HookParam hp;
hp.address = addr + 5;
hp.text_fun = Private::hookAfter;
hp.hook_after = Private::hookafter;
hp.embed_fun = Private::hookafter;
count |= NewHook(hp, "EmbedMinori");
}
return true; // replace all functions

View File

@ -310,7 +310,7 @@ bool InsertNeXASHookA()
hp.address = addrx + sizeof(sig2) - 5;
hp.offset = get_reg(regs::eax);
hp.type = USING_STRING;
hp.newlineseperator = L"@n";
hp.lineSeparator = L"@n";
hp.filter_fun = [](TextBuffer *buffer, HookParam *)
{
auto s = buffer->strA();
@ -483,7 +483,7 @@ namespace
}
}
};
hp.newlineseperator = L"@n";
hp.lineSeparator = L"@n";
return NewHook(hp, "NeXAS3");
}
}

View File

@ -757,7 +757,7 @@ bool attach(ULONG startAddress, ULONG stopAddress) // attach scenario
hp.type=USING_STRING|EMBED_ABLE|EMBED_AFTER_NEW| EMBED_DYNA_SJIS|NO_CONTEXT;
hp.offset=get_stack(1);
hp.text_fun=Private::hookBefore;
hp.hook_font=F_GetGlyphOutlineA;
hp.embed_hook_font=F_GetGlyphOutlineA;
return NewHook(hp,"EmbedNexton");
}

View File

@ -133,7 +133,7 @@ namespace
hp.address = addr;
hp.offset = get_stack(2);
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
return NewHook(hp, "Basil2");
}
}

View File

@ -177,12 +177,12 @@ static bool InsertNewPal1Hook()
hp.offset = get_stack(2); // arg2
hp.type = USING_STRING | EMBED_ABLE | NO_CONTEXT;
hp.text_fun = before;
hp.hook_after = after;
hp.embed_fun = after;
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
buffer->from(rubyRemove(buffer->strA()));
};
hp.hook_font = F_CreateFontIndirectA | F_CreateFontA;
hp.embed_hook_font = F_CreateFontIndirectA | F_CreateFontA;
ConsoleOutput("INSERT Pal1");
return NewHook(hp, "Pal");
}
@ -239,7 +239,7 @@ namespace
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW;
// 无法编码的字符无法显示若开启dyna则会直接略过这个字还不如不开。
//[230929] [ユニゾンシフト] 恋とHしかしていない
hp.newlineseperator = L"<br>";
hp.lineSeparator = L"<br>";
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
buffer->from(rubyRemove(buffer->strA()));

View File

@ -665,7 +665,7 @@ namespace
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS;
hp.offset = get_stack(2);
hp.filter_fun = pensilfilter;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
return NewHook(hp, "EmbedPensil");
};
if (addr && _do(addr))
@ -702,7 +702,7 @@ namespace
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS;
hp.offset = get_stack(1);
hp.filter_fun = pensilfilter;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
return NewHook(hp, "EmbedPensilChoice");
}

View File

@ -1014,10 +1014,10 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.newlineseperator = L"[n]";
hp.embed_fun = Private::hookafter;
hp.lineSeparator = L"[n]";
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | USING_STRING | NO_CONTEXT;
hp.hook_font = F_ExtTextOutA | F_GetTextExtentPoint32A;
hp.embed_hook_font = F_ExtTextOutA | F_GetTextExtentPoint32A;
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
buffer->from(std::regex_replace(buffer->strA(), std::regex("\\[rb,(.*?),.+\\]"), "$1"));

View File

@ -725,9 +725,9 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter2;
hp.embed_fun = Private::hookafter2;
hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE | NO_CONTEXT;
hp.hook_font = F_GetGlyphOutlineW;
hp.embed_hook_font = F_GetGlyphOutlineW;
auto succ = NewHook(hp, "EmbedRGSS3");
hp.address = addr + 5;
hp.text_fun = Private::hookAfter;
@ -890,9 +890,9 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter2;
hp.embed_fun = Private::hookafter2;
hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE | NO_CONTEXT;
hp.hook_font = F_GetGlyphOutlineW;
hp.embed_hook_font = F_GetGlyphOutlineW;
functionAddress = addr;
return NewHook(hp, "EmbedRGSS3Choice");
@ -1348,9 +1348,9 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter2;
hp.embed_fun = Private::hookafter2;
hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE | NO_CONTEXT;
hp.hook_font = F_GetGlyphOutlineW;
hp.embed_hook_font = F_GetGlyphOutlineW;
return NewHook(hp, "EmbedRGSS3Other");
}

View File

@ -31,7 +31,7 @@ bool InsertRetouch1Hook()
hp.address = addr;
hp.offset=get_stack(1);
hp.type = USING_STRING|NO_CONTEXT|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS;
hp.hook_font=F_GetGlyphOutlineA;
hp.embed_hook_font=F_GetGlyphOutlineA;
hp.text_fun = SpecialHookRetouch1;
ConsoleOutput("INSERT Retouch");
return NewHook(hp, "Retouch");
@ -56,7 +56,7 @@ bool InsertRetouch2Hook()
hp.address = addr;
hp.offset=get_stack(1);
hp.type = USING_STRING|NO_CONTEXT|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS;
hp.hook_font=F_GetGlyphOutlineA;
hp.embed_hook_font=F_GetGlyphOutlineA;
ConsoleOutput("INSERT Retouch");
return NewHook(hp, "Retouch");
}
@ -87,7 +87,7 @@ bool attach() // attach scenario
hp.address = addr;
hp.offset=get_stack(1);
hp.type = USING_STRING|NO_CONTEXT|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS;
hp.hook_font=F_GetGlyphOutlineA;
hp.embed_hook_font=F_GetGlyphOutlineA;
return NewHook(hp, "RetouchHistory");
}

View File

@ -24,7 +24,7 @@ bool ScrPlayer_attach_function1()
hp.offset = get_stack(5);
// 会把多行分开导致翻译不对。
hp.type = USING_STRING; //|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS;
// hp.hook_font=F_GetGlyphOutlineA;
// hp.embed_hook_font=F_GetGlyphOutlineA;
hp.filter_fun = [](TextBuffer *buffer, HookParam *)
{
static int idx = 0;

View File

@ -974,10 +974,10 @@ namespace
HookParam hp;
hp.address = (ULONG)::GetTextExtentPoint32A;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.embed_fun = Private::hookafter;
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.newlineseperator = L"_r";
hp.hook_font = F_GetGlyphOutlineA;
hp.lineSeparator = L"_r";
hp.embed_hook_font = F_GetGlyphOutlineA;
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
buffer->from(std::regex_replace(buffer->strA(), std::regex("_t!.*?[/>]"), ""));

View File

@ -1783,8 +1783,8 @@ namespace
hp.address = addr;
hp.type = EMBED_ABLE | CODEC_UTF16 | EMBED_INSERT_SPACE_AFTER_UNENCODABLE | NO_CONTEXT; // 0x41
hp.text_fun = Private::text_fun;
hp.hook_after = Private::hookafter;
hp.hook_font = F_GetGlyphOutlineW;
hp.embed_fun = Private::hookafter;
hp.embed_hook_font = F_GetGlyphOutlineW;
return NewHook(hp, "EmbedSiglus");
}
}
@ -1872,8 +1872,8 @@ namespace OtherHook
hp.address = addr;
hp.type = EMBED_ABLE | CODEC_UTF16 | EMBED_INSERT_SPACE_AFTER_UNENCODABLE | NO_CONTEXT; // 0x41
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter2;
hp.hook_font = F_GetGlyphOutlineW;
hp.embed_fun = Private::hookafter2;
hp.embed_hook_font = F_GetGlyphOutlineW;
return NewHook(hp, "EmbedSiglus");
}

View File

@ -313,8 +313,8 @@ bool InsertSilkysHook()
hp.address = addr;
hp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.text_fun = hookBefore;
hp.hook_after = hookafter1;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_fun = hookafter1;
hp.embed_hook_font = F_GetGlyphOutlineA;
succ_ |= NewHook(hp, "EmbedSilkys");
}
{
@ -373,7 +373,7 @@ namespace
HookParam hp;
hp.address = addr;
hp.offset = get_stack(1);
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE | EMBED_AFTER_NEW;
return NewHook(hp, "EmbedSilkysX");
}
@ -650,7 +650,7 @@ bool Silkyssakura::attach_function()
hp_embed.address = addr;
hp_embed.offset = get_stack(2);
hp_embed.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | CODEC_UTF16;
hp_embed.hook_font = F_GetGlyphOutlineW;
hp_embed.embed_hook_font = F_GetGlyphOutlineW;
return NewHook(hp_embed, "embedSilkyssakura"); // 这个是分两层分别绘制文字和阴影,需要两个都内嵌。
}
}
@ -688,7 +688,7 @@ namespace
HookParam hp;
hp.address = addr;
hp.offset = get_reg(regs::ecx);
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS;
return NewHook(hp, "SilkysX");
}
@ -719,7 +719,7 @@ bool Silkysveryveryold_attach_function()
HookParam hp;
hp.address = addr;
hp.offset = get_stack(1);
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
hp.type = USING_STRING;
return NewHook(hp, "SilkysX");
}

View File

@ -1423,7 +1423,7 @@ namespace
hp.address = addr;
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter2;
hp.embed_fun = Private::hookafter2;
auto succ = NewHook(hp, "EmbedSysmtem44");
hp.address = addr + 5;
hp.text_fun = Private::hookAfter;

View File

@ -762,7 +762,7 @@ namespace
{
hp.type |= CODEC_UTF16;
hp.text_fun = beforeAgsSpriteCreateTextW;
hp.hook_after = afterAgsSpriteCreateTextW;
hp.embed_fun = afterAgsSpriteCreateTextW;
succ |= NewHook(hp, "SystemAoiW");
ULONG addr = findAoiProc(hModule, "AgsSpriteCreateTextEx", 1);
@ -773,7 +773,7 @@ namespace
hp.offset = get_stack(2);
hp.type = CODEC_UTF16 | EMBED_ABLE; //|EMBED_AFTER_OVERWRITE;
hp.text_fun = beforeAgsSpriteCreateTextExW;
hp.hook_after = afterAgsSpriteCreateTextExW;
hp.embed_fun = afterAgsSpriteCreateTextExW;
succ |= NewHook(hp, "SystemAoiExW");
}
@ -782,8 +782,8 @@ namespace
else
{
hp.text_fun = beforeAgsSpriteCreateTextA;
hp.hook_after = afterAgsSpriteCreateTextA;
hp.hook_font = F_DrawTextExA;
hp.embed_fun = afterAgsSpriteCreateTextA;
hp.embed_hook_font = F_DrawTextExA;
if (AgsPatchA::attach(processStartAddress, processStopAddress) == false)
hp.type |= EMBED_DYNA_SJIS;
succ |= NewHook(hp, "SystemAoiA");

View File

@ -29,7 +29,7 @@ bool InsertTanukiHook()
hp.address = j;
hp.offset=get_stack(1);
hp.type = USING_STRING | NO_CONTEXT|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS;
hp.hook_font=F_GetGlyphOutlineA;
hp.embed_hook_font=F_GetGlyphOutlineA;
ConsoleOutput("INSERT TanukiSoft");
return NewHook(hp, "TanukiSoft");
}

View File

@ -392,8 +392,8 @@ namespace
HookParam hp;
hp.address = addr + addr_offset;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_fun = Private::hookafter;
hp.embed_hook_font = F_GetGlyphOutlineA;
hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
return NewHook(hp, "EmbedTaskforce");
}

View File

@ -56,7 +56,7 @@ bool Triangle::attach_function()
hp.offset = get_stack(4);
hp.split = get_stack(1);
hp.type = USING_STRING | USING_SPLIT;
hp.hook_font = F_TextOutA;
hp.embed_hook_font = F_TextOutA;
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
{
// ▼

View File

@ -481,11 +481,11 @@ namespace
HookParam hp;
hp.address = beforeAddress;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter2;
hp.embed_fun = Private::hookafter2;
hp.offset = get_stack(1);
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
auto suc = NewHook(hp, "EMbedUnicorn");
hp.address = afterAddress;
hp.text_fun = Private::hookAfter;
@ -784,10 +784,10 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.embed_fun = Private::hookafter;
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.newlineseperator = L"\\n";
hp.hook_font = F_GetGlyphOutlineA;
hp.lineSeparator = L"\\n";
hp.embed_hook_font = F_GetGlyphOutlineA;
return NewHook(hp, "EMbedUnicornOther");
}

View File

@ -484,9 +484,9 @@ namespace
HookParam hp;
hp.address = addr;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.embed_fun = Private::hookafter;
hp.index = 4;
hp.hook_font = F_TextOutA | F_GetTextExtentPoint32A;
hp.embed_hook_font = F_TextOutA | F_GetTextExtentPoint32A;
hp.type = DATA_INDIRECT | USING_STRING | EMBED_ABLE | NO_CONTEXT | EMBED_DYNA_SJIS;
if (role == Engine::NameRole)
count += NewHook(hp, "EmbedWaffle_name");

View File

@ -601,8 +601,8 @@ bool InsertWillPlus4Hook()
// hp.filter_fun = WillPlus_extra_filter;
hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE;
hp.text_fun = will3::hookBefore;
hp.newlineseperator = L"\\n";
hp.hook_after = will3::hookafter;
hp.lineSeparator = L"\\n";
hp.embed_fun = will3::hookafter;
return NewHook(hp, "EmbedWillplus3");
}
bool InsertWillPlus5Hook()
@ -860,9 +860,9 @@ namespace
savetyperef[_type] = _tinfo;
hp.text_fun = hookBefore<_type>;
hp.type = EMBED_ABLE | CODEC_UTF16 | NO_CONTEXT;
hp.newlineseperator = L"\\n";
hp.hook_after = hookafter<_type>;
hp.hook_font = F_MultiByteToWideChar | F_GetGlyphOutlineW;
hp.lineSeparator = L"\\n";
hp.embed_fun = hookafter<_type>;
hp.embed_hook_font = F_MultiByteToWideChar | F_GetGlyphOutlineW;
char _[] = "EmbedWillplusW0";
_[sizeof(_) - 2] += _type;
return NewHook(hp, _);
@ -1571,15 +1571,15 @@ namespace
hp.text_fun = Private::hookBefore;
hp.type = EMBED_ABLE | NO_CONTEXT;
hp.newlineseperator = L"\\n";
hp.hook_after = Private::hookafter;
hp.hook_font = F_GetGlyphOutlineA | F_TextOutA;
hp.lineSeparator = L"\\n";
hp.embed_fun = Private::hookafter;
hp.embed_hook_font = F_GetGlyphOutlineA | F_TextOutA;
static ULONG paddr = (PatchA::patchEncoding(startAddress, stopAddress));
ConsoleOutput("%p", paddr);
if (paddr)
{
hp.type |= EMBED_DYNA_SJIS;
hp.hook_font = F_GetGlyphOutlineA | F_TextOutA;
hp.embed_hook_font = F_GetGlyphOutlineA | F_TextOutA;
patch_fun = []()
{
PatchA::replace_near_call(paddr + 5, (ULONG)PatchA::Private::isLeadByteChar);

View File

@ -871,9 +871,9 @@ namespace
hp.offset = get_reg(regs::ecx);
hp.index = 4;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter2;
hp.embed_fun = Private::hookafter2;
hp.type = USING_STRING | DATA_INDIRECT | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
return NewHook(hp, "EmbedWolf");
}

View File

@ -194,7 +194,7 @@ bool libcefhook(HMODULE module)
hp.address = addr + 4;
hp.offset = get_stack(1);
hp.filter_fun = ceffileter;
hp.newlineseperator = L"<br>";
hp.lineSeparator = L"<br>";
hp.length_offset = 2;
hp.type = USING_STRING | CODEC_UTF16 | NO_CONTEXT;
hp.user_value = (DWORD) new std::wstring;

View File

@ -147,8 +147,8 @@ bool attach_navel(ULONG startAddress, ULONG stopAddress) // attach scenario
hp.address = addr;
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.text_fun = hookBefore_navel;
hp.hook_after = hookafter_navel;
hp.hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A;
hp.embed_fun = hookafter_navel;
hp.embed_hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A;
return NewHook(hp, "LucifenEmbed");
}
namespace
@ -751,8 +751,8 @@ namespace
hp.address = addr;
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A;
hp.embed_fun = Private::hookafter;
hp.embed_hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A;
return NewHook(hp, "EmbedLucifen");
}
} // namespace ScenarioHook
@ -950,8 +950,8 @@ namespace
hp.address = addr;
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.text_fun = Private::hookBefore;
hp.hook_after = Private::hookafter;
hp.hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A;
hp.embed_fun = Private::hookafter;
hp.embed_hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A;
return NewHook(hp, "lucifen_choice");
}
} // namespace ChoiceHook
@ -1016,9 +1016,9 @@ namespace
hp.address = addr;
hp.offset = get_stack(1);
hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT;
hp.hook_after = hookafter;
hp.embed_fun = hookafter;
hp.text_fun = hookBefore;
hp.hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A;
hp.embed_hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A;
return NewHook(hp, "Embedlucifen2");
}
}

View File

@ -24,7 +24,7 @@ bool utawarerumonoh()
return false;
HookParam hp;
hp.address = addr;
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
hp.offset = get_stack(1);
hp.type = CODEC_UTF8 | USING_STRING | NO_CONTEXT;
ConsoleOutput("utawarerumono");
@ -46,7 +46,7 @@ bool utawarerumonoh2()
hp.address = addr + 2;
hp.offset = get_reg(regs::esi);
hp.type = CODEC_UTF8 | USING_STRING | NO_CONTEXT;
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
ConsoleOutput("utawarerumono %p", addr);
succ |= NewHook(hp, "utawarerumono");
}

View File

@ -35,7 +35,7 @@ namespace
hp.offset = get_reg(regs::rdx);
hp.type = EMBED_ABLE | USING_STRING | EMBED_AFTER_NEW | EMBED_DYNA_SJIS;
hp.hook_font = F_GetGlyphOutlineA;
hp.embed_hook_font = F_GetGlyphOutlineA;
res |= NewHook(hp, "EmbedCMVS");
}
return res;

View File

@ -136,7 +136,7 @@ namespace
buffer->from(str);
};
hp.filter_fun = commonfilter;
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
return NewHook(hp, "Light.VN.16");
}

View File

@ -30,7 +30,7 @@ bool InsertENTERGRAM()
hp.type = USING_STRING | CODEC_UTF16 | NO_CONTEXT;
hp.filter_fun = ENTERGRAMfilter;
hp.offset = get_reg(regs::rsi);
hp.newlineseperator = L"\\n";
hp.lineSeparator = L"\\n";
return NewHook(hp, "UnrealEngine");
}
bool UnrealEngine::attach_function()

View File

@ -23,6 +23,7 @@
#include "engine32/PONScripter.h"
#include "engine32/Stronger.h"
#include "engine32/Fizz.h"
#include "engine32/Aromarie.h"
#include "engine32/Ruf.h"
#include "engine32/SYSD.h"
#include "engine32/Diskdream.h"
@ -412,5 +413,6 @@ std::vector<ENGINE *> check_engines()
new AGE_System,
new Cage,
new Winters,
new Aromarie,
};
}

View File

@ -38,7 +38,7 @@ void commonsolvemonostring(uintptr_t offset, TextBuffer *buffer)
buffer->from(sw.value());
}
void unity_ui_string_hook_after(uintptr_t *offset, TextBuffer buff)
void unity_ui_string_embed_fun(uintptr_t *offset, TextBuffer buff)
{
auto view = buff.viewW();
auto newstring = il2cppfunctions::create_string(view);

View File

@ -1,6 +1,6 @@
#define RESOLVE_IMPORT(name) name = (decltype(name))(GetProcAddress(game_module, #name))
#pragma once
void commonsolvemonostring(uintptr_t offset, TextBuffer *buffer);
void unity_ui_string_hook_after(uintptr_t *offset, TextBuffer buff);
void unity_ui_string_embed_fun(uintptr_t *offset, TextBuffer buff);
uintptr_t tryfindmonoil2cpp(const char *_dll, const char *_namespace, const char *_class, const char *_method, int paramCoun, bool strict = false);

View File

@ -1,6 +1,6 @@
#include "python.h"
#include <dwrite.h>
extern "C" __declspec(dllexport) const wchar_t *internal_renpy_call_host(const wchar_t *text, int split)
extern "C" __declspec(dllexport) const wchar_t *luna_internal_renpy_call_host(const wchar_t *text, int split)
{
return text;
}
@ -21,9 +21,9 @@ bool Luna_checkisusingembed(uint64_t address, uint64_t ctx2, bool usingsplit)
}
return false;
}
extern "C" __declspec(dllexport) bool internal_renpy_call_is_embed_using(int split, bool usingsplit)
extern "C" __declspec(dllexport) bool luna_internal_renpy_call_is_embed_using(int split, bool usingsplit)
{
return Luna_checkisusingembed((uint64_t)internal_renpy_call_host, split, usingsplit);
return Luna_checkisusingembed((uint64_t)luna_internal_renpy_call_host, split, usingsplit);
}
namespace
{
@ -62,11 +62,11 @@ namespace
void hook_internal_renpy_call_host()
{
HookParam hp_internal;
hp_internal.address = (uintptr_t)internal_renpy_call_host;
hp_internal.address = (uintptr_t)luna_internal_renpy_call_host;
hp_internal.offset = GETARG1;
hp_internal.split = GETARG2;
hp_internal.type = USING_SPLIT | USING_STRING | CODEC_UTF16 | EMBED_ABLE | EMBED_AFTER_NEW | NO_CONTEXT;
NewHook(hp_internal, "internal_renpy_call_host");
hp_internal.type = USING_SPLIT | USING_STRING | CODEC_UTF16 | EMBED_ABLE | EMBED_AFTER_NEW | NO_CONTEXT;
NewHook(hp_internal, "luna_internal_renpy_call_host");
PyRunScript(LoadResData(L"renpy_hook_text", L"PYSOURCE").c_str());
}
@ -268,7 +268,7 @@ namespace
}
}
extern "C" __declspec(dllexport) const wchar_t *internal_renpy_get_font()
extern "C" __declspec(dllexport) const wchar_t *luna_internal_renpy_get_font()
{
if (wcslen(commonsharedmem->fontFamily) == 0)
return NULL;

View File

@ -95,7 +95,7 @@ bool InsertRenpyHook()
if (PyUnicode_FromUnicode)
{
hp.type |= EMBED_ABLE;
hp.hook_after = [](hook_stack *stack, TextBuffer buffer)
hp.embed_fun = [](hook_stack *stack, TextBuffer buffer)
{
auto format = (PyObject *)stack->ARG1;
if (!format)

View File

@ -179,7 +179,7 @@ bool InsertRenpy3Hook()
if (PyUnicode_FromKindAndData)
{
hp.type |= EMBED_ABLE | EMBED_CODEC_UTF16;
hp.hook_after = [](hook_stack *stack, TextBuffer buffer)
hp.embed_fun = [](hook_stack *stack, TextBuffer buffer)
{
auto format = (PyObject *)stack->rcx;
if (!format)

View File

@ -128,7 +128,7 @@ auto makeserveronce(int port)
HTTP_BINDING_INFO BindingProperty;
HTTP_TIMEOUT_LIMIT_INFO CGTimeout;
auto url = std::wstring(L"http://127.0.0.1:") + std::to_wstring(port) + L"/fuck";
auto url = std::wstring(L"http://127.0.0.1:") + std::to_wstring(port) + L"/sakurakouji";
//
// Initialize HTTP APIs.
//

View File

@ -59,7 +59,7 @@ namespace
parsebefore((wchar_t *)GlobalLock(hClipboardData), hp, split, buffer);
GlobalUnlock(hClipboardData);
};
hp.hook_after = [](hook_stack *s, TextBuffer buffer)
hp.embed_fun = [](hook_stack *s, TextBuffer buffer)
{
std::wstring transwithfont = parseafter(buffer.viewW());
HGLOBAL hClipboardData = GlobalAlloc(GMEM_MOVEABLE, transwithfont.size() * 2 + 2);
@ -82,7 +82,7 @@ namespace
{
parsebefore((wchar_t *)stack->ARG1, hp, split, buffer);
};
hp.hook_after = [](hook_stack *s, TextBuffer buffer)
hp.embed_fun = [](hook_stack *s, TextBuffer buffer)
{
std::wstring transwithfont = parseafter(buffer.viewW());
s->ARG1 = (uintptr_t)allocateString(transwithfont);

View File

@ -28,7 +28,7 @@ function cppjsio(name, s_raw, lpsplit, embedable) {
s = magicsend + name + '\x03' + lpsplit.toString() + '\x04' + (embedable ? '1' : '0') + '\x02' + s_raw;
if (internal_http_port) {
var xhr = new XMLHttpRequest();
var url = 'http://127.0.0.1:' + internal_http_port + '/fuck'
var url = 'http://127.0.0.1:' + internal_http_port + '/sakurakouji'
xhr.open('POST', url, false);
xhr.send(s);
if (xhr.status === 200) {

View File

@ -3,11 +3,15 @@ def callLunaHostFont():
import ctypes
try:
internal_renpy_get_font = ctypes.CDLL("LunaHook64").internal_renpy_get_font
luna_internal_renpy_get_font = ctypes.CDLL(
"LunaHook64"
).luna_internal_renpy_get_font
except:
internal_renpy_get_font = ctypes.CDLL("LunaHook32").internal_renpy_get_font
internal_renpy_get_font.restype = ctypes.c_wchar_p
return internal_renpy_get_font()
luna_internal_renpy_get_font = ctypes.CDLL(
"LunaHook32"
).luna_internal_renpy_get_font
luna_internal_renpy_get_font.restype = ctypes.c_wchar_p
return luna_internal_renpy_get_font()
except:
return None
@ -17,17 +21,17 @@ def callLunaIsUsingEmbed_nosplit():
import ctypes
try:
internal_renpy_call_is_embed_using = ctypes.CDLL(
luna_internal_renpy_call_is_embed_using = ctypes.CDLL(
"LunaHook64"
).internal_renpy_call_is_embed_using
).luna_internal_renpy_call_is_embed_using
except:
internal_renpy_call_is_embed_using = ctypes.CDLL(
luna_internal_renpy_call_is_embed_using = ctypes.CDLL(
"LunaHook32"
).internal_renpy_call_is_embed_using
internal_renpy_call_is_embed_using.argstype = ctypes.c_int, ctypes.c_bool
internal_renpy_call_is_embed_using.restype = ctypes.c_bool
).luna_internal_renpy_call_is_embed_using
luna_internal_renpy_call_is_embed_using.argstype = ctypes.c_int, ctypes.c_bool
luna_internal_renpy_call_is_embed_using.restype = ctypes.c_bool
return internal_renpy_call_is_embed_using(0, False)
return luna_internal_renpy_call_is_embed_using(0, False)
except:
return False

View File

@ -3,21 +3,21 @@ def callLunaHost(text, split):
import ctypes
try:
internal_renpy_call_host = ctypes.CDLL(
luna_internal_renpy_call_host = ctypes.CDLL(
"LunaHook64"
).internal_renpy_call_host
).luna_internal_renpy_call_host
except:
internal_renpy_call_host = ctypes.CDLL(
luna_internal_renpy_call_host = ctypes.CDLL(
"LunaHook32"
).internal_renpy_call_host
internal_renpy_call_host.argstype = ctypes.c_wchar_p, ctypes.c_int
internal_renpy_call_host.restype = ctypes.c_wchar_p
).luna_internal_renpy_call_host
luna_internal_renpy_call_host.argstype = ctypes.c_wchar_p, ctypes.c_int
luna_internal_renpy_call_host.restype = ctypes.c_wchar_p
try:
_text = text.decode("utf8")
except:
_text = text
text = internal_renpy_call_host(_text, split)
text = luna_internal_renpy_call_host(_text, split)
except:
pass
return text
@ -28,17 +28,17 @@ def callLunaIsUsingEmbed(split):
import ctypes
try:
internal_renpy_call_is_embed_using = ctypes.CDLL(
luna_internal_renpy_call_is_embed_using = ctypes.CDLL(
"LunaHook64"
).internal_renpy_call_is_embed_using
).luna_internal_renpy_call_is_embed_using
except:
internal_renpy_call_is_embed_using = ctypes.CDLL(
luna_internal_renpy_call_is_embed_using = ctypes.CDLL(
"LunaHook32"
).internal_renpy_call_is_embed_using
internal_renpy_call_is_embed_using.argstype = ctypes.c_int, ctypes.c_bool
internal_renpy_call_is_embed_using.restype = ctypes.c_bool
).luna_internal_renpy_call_is_embed_using
luna_internal_renpy_call_is_embed_using.argstype = ctypes.c_int, ctypes.c_bool
luna_internal_renpy_call_is_embed_using.restype = ctypes.c_bool
return internal_renpy_call_is_embed_using(split, True)
return luna_internal_renpy_call_is_embed_using(split, True)
except:
return False

View File

@ -396,24 +396,28 @@ void TextHook::Send(uintptr_t lpDataBase)
{
if (hp.type & EMBED_AFTER_NEW)
{
auto _ = new char[max(lpCountsave, buff.size) + 10];
auto size = max(lpCountsave, buff.size + 1);
auto _ = new char[size];
memcpy(_, buff.buff, buff.size);
for (int i = buff.size; i < max(lpCountsave, buff.size) + 10; i++)
_[i] = 0;
memset(_ + buff.size, 0, size - buff.size);
*(uintptr_t *)plpdatain = (uintptr_t)_;
}
else if (hp.type & EMBED_AFTER_OVERWRITE)
{
memcpy((void *)lpDataIn, buff.buff, buff.size);
for (int i = buff.size; i < lpCountsave; i++)
((BYTE *)(lpDataIn))[i] = 0;
auto zeros = 1;
if (hp.type & CODEC_UTF16)
zeros = 2;
else if (hp.type & CODEC_UTF32)
zeros = 4;
memset((char *)lpDataIn + buff.size, 0, max(lpCountsave, zeros));
}
else if (hp.hook_after)
hp.hook_after(stack, buff);
else if (hp.embed_fun)
hp.embed_fun(stack, buff);
else if (hp.type & SPECIAL_JIT_STRING)
{
if (hp.jittype == JITTYPE::UNITY)
unity_ui_string_hook_after(argidx(stack, hp.argidx), buff);
unity_ui_string_embed_fun(argidx(stack, hp.argidx), buff);
}
}
}

View File

@ -16,7 +16,7 @@ add_library(host
)
target_precompile_headers(host REUSE_FROM pch)
target_include_directories(host PUBLIC .)
target_link_libraries(host VERSION_DEF)
add_library(LunaHostDll MODULE LunaHostDll.cpp ${versioninfohost})
target_precompile_headers(LunaHostDll REUSE_FROM pch)

View File

@ -1,7 +1,5 @@
#pragma once
#define LUNA_VERSION {VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_REVISION}
enum
{
STRING = 12,

View File

@ -299,7 +299,7 @@ namespace
{
HCode += L"E";
if (hp.hook_after)
if (hp.embed_fun)
HCode += L'X';
else
{

View File

@ -113,9 +113,9 @@ struct HookParam
ALIGNPTR(uint64_t __12, uintptr_t user_value);
ALIGNPTR(uint64_t __2, void (*text_fun)(hook_stack *stack, HookParam *hp, TextBuffer *buffer, uintptr_t *split))
ALIGNPTR(uint64_t __3, void (*filter_fun)(TextBuffer *buffer, HookParam *hp)); // jichi 10/24/2014: Add filter function. Return false to skip the text
ALIGNPTR(uint64_t __7, void (*hook_after)(hook_stack *stack, TextBuffer buffer));
uint64_t hook_font;
ALIGNPTR(uint64_t __9, const wchar_t *newlineseperator);
ALIGNPTR(uint64_t __7, void (*embed_fun)(hook_stack *stack, TextBuffer buffer));
uint64_t embed_hook_font;
ALIGNPTR(uint64_t __9, const wchar_t *lineSeparator);
char name[HOOK_NAME_SIZE];
wchar_t hookcode[HOOKCODE_LEN];
HookParam()

View File

@ -1,10 +1,14 @@
set(VERSION_MAJOR 6)
set(VERSION_MINOR 3)
set(VERSION_PATCH 4)
set(VERSION_MINOR 5)
set(VERSION_PATCH 0)
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})
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
add_library(VERSION_DEF INTERFACE)
target_compile_definitions(VERSION_DEF INTERFACE
VERSION_MAJOR=${VERSION_MAJOR}
VERSION_MINOR=${VERSION_MINOR}
VERSION_PATCH=${VERSION_PATCH}
VERSION_REVISION=${VERSION_REVISION}
LUNA_VERSION=${LUNA_VERSION})
include(${CMAKE_CURRENT_LIST_DIR}/version/generate_product_version.cmake)

View File

@ -21,10 +21,15 @@ def overridepathexists():
def prepareqtenv():
import windows
from myutils.config import get_platform
# win7 no vcredist2015
windows.addenvpath("./files/runtime/")
windows.LoadLibraryW("./files/runtime/PyQt5/Qt5/bin/Qt5Core.dll")
if get_platform() != "xp":
windows.LoadLibraryW("./files/runtime/PyQt5/Qt5/bin/Qt5Core.dll")
else:
windows.addenvpath("./files/runtime/Lib/site-packages/PyQt5")
windows.LoadLibraryW("./files/runtime/Lib/site-packages/PyQt5/Qt5Core.dll")
from qtsymbols import QApplication, isqt5, Qt, QFont, QLocale
@ -32,10 +37,15 @@ def prepareqtenv():
if isqt5:
# 中文字符下不能自动加载
plgs = "./files/runtime/PyQt5/Qt5/plugins"
if get_platform() != "xp":
plgs = "./files/runtime/PyQt5/Qt5/plugins"
else:
plgs = "./files/runtime/Lib/site-packages/PyQt5/plugins"
if os.path.exists(plgs):
QApplication.addLibraryPath(plgs)
QApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling)
if get_platform() != "xp":
QApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling)
QApplication.setAttribute(Qt.ApplicationAttribute.AA_UseHighDpiPixmaps)
if os.path.exists("./files/runtime/PyQt5/Qt5/bin/Qt5WebEngineCore.dll"):
# maybe use qwebengine
@ -46,10 +56,10 @@ def prepareqtenv():
QApplication.setAttribute(
Qt.ApplicationAttribute.AA_DontCreateNativeWidgetSiblings
)
QApplication.setHighDpiScaleFactorRoundingPolicy(
Qt.HighDpiScaleFactorRoundingPolicy.PassThrough
)
if get_platform() != "xp":
QApplication.setHighDpiScaleFactorRoundingPolicy(
Qt.HighDpiScaleFactorRoundingPolicy.PassThrough
)
font = QFont()
font.setStyleStrategy(QFont.StyleStrategy.PreferAntialias)
font.setHintingPreference(QFont.HintingPreference.PreferFullHinting)

View File

@ -1,7 +1,7 @@
import functools, os
import gobject
from myutils.utils import splitocrtypes
from myutils.config import globalconfig, _TR
from myutils.config import globalconfig, _TR, get_platform
from gui.inputdialog import multicolorset, autoinitdialog
from gui.inputdialog import autoinitdialog, autoinitdialog_items
from gui.usefulwidget import (
@ -96,6 +96,9 @@ def _checkmaybefailed(self, idx):
def _createseletengeinecombo_1(self):
webviews = ["MSHTML", "WebView2", "QWebEngine"]
if get_platform() == "xp":
webviews = ["MSHTML"]
self.seletengeinecombo_1 = getsimplecombobox(
webviews,
globalconfig,

View File

@ -5,18 +5,23 @@ from gui.setting_display_text import xianshigrid_style
from gui.setting_display_ui import uisetting
from gui.setting_display_scale import makescalew
from gui.usefulwidget import makesubtab_lazy, makescrollgrid
from myutils.config import get_platform
def setTabThree_lazy(self, basel):
titles = ["文本设置", "界面设置", "工具按钮", "窗口缩放"]
funcs = [
lambda l: makescrollgrid(xianshigrid_style(self), l),
functools.partial(uisetting, self),
functools.partial(createbuttonwidget, self),
functools.partial(makescalew, self),
]
if get_platform() == "xp":
titles.pop(3)
funcs.pop(3)
tab, do = makesubtab_lazy(
["文本设置", "界面设置", "工具按钮", "窗口缩放"],
[
lambda l: makescrollgrid(xianshigrid_style(self), l),
functools.partial(uisetting, self),
functools.partial(createbuttonwidget, self),
functools.partial(makescalew, self),
],
titles,
funcs,
delay=True,
)

View File

@ -1,7 +1,7 @@
from qtsymbols import *
import functools, platform
import gobject, os, zipfile
from myutils.config import globalconfig, static_data, _TR
from myutils.config import globalconfig, static_data, _TR, get_platform
from gui.inputdialog import autoinitdialog
from myutils.wrapper import tryprint
from myutils.utils import dynamiclink, translate_exits, copytree, getannotatedapiname
@ -296,6 +296,9 @@ def _createseletengeinecombo(self):
visengine = ["Qt", "Webview2"]
visengine_internal = ["textbrowser", "webview"]
if get_platform() == "xp":
visengine.pop(1)
visengine_internal.pop(1)
self.seletengeinecombo = getsimplecombobox(
visengine,
globalconfig,

View File

@ -1,12 +1,11 @@
from qtsymbols import *
import os, functools, re
from myutils.config import globalconfig
from myutils.config import globalconfig, get_platform
from myutils.utils import splittranslatortypes, translate_exits
from gui.usefulwidget import (
D_getsimpleswitch,
makegrid,
makesubtab_lazy,
LGroupBox,
makescrollgrid,
D_getsimplecombobox,
)
@ -128,28 +127,32 @@ def makeproxytab():
l=globalconfig["update"],
item="update",
)
titles = [
"在线翻译",
"注册在线翻译",
"OCR",
"语音合成",
"辞书",
"元数据",
"离线翻译",
"自动更新",
]
funcs = [
functools.partial(makegridW, mianfei),
functools.partial(makegridW, shoufei),
functools.partial(makegridW, ocrs),
functools.partial(makegridW, readers),
functools.partial(makegridW, cishus),
functools.partial(makegridW, meta),
functools.partial(makegridW, lixians),
functools.partial(makegridW, github),
]
if get_platform() == "xp":
titles.pop(2)
funcs.pop(2)
tab, dotab = makesubtab_lazy(
[
"在线翻译",
"注册在线翻译",
"OCR",
"语音合成",
"辞书",
"元数据",
"离线翻译",
"自动更新",
],
[
functools.partial(makegridW, mianfei),
functools.partial(makegridW, shoufei),
functools.partial(makegridW, ocrs),
functools.partial(makegridW, readers),
functools.partial(makegridW, cishus),
functools.partial(makegridW, meta),
functools.partial(makegridW, lixians),
functools.partial(makegridW, github),
],
titles,
funcs,
delay=True,
)
dotab()
@ -157,42 +160,42 @@ def makeproxytab():
def setTab_proxy(self, l):
grids = [
[
(
dict(
title="网络请求",
type="grid",
grid=[
[
"HTTP",
(
D_getsimplecombobox(
["winhttp", "libcurl"],
globalconfig,
"network",
static=True,
),
5,
grids1 = [
(
dict(
title="网络请求",
type="grid",
grid=[
[
"HTTP",
(
D_getsimplecombobox(
["winhttp", "libcurl"],
globalconfig,
"network",
static=True,
),
"",
"WebSocket",
(
D_getsimplecombobox(
["winhttp", "libcurl"],
globalconfig,
"network_websocket",
static=True,
),
5,
5,
),
"",
"WebSocket",
(
D_getsimplecombobox(
["winhttp", "libcurl"],
globalconfig,
"network_websocket",
static=True,
),
],
5,
),
],
),
0,
"group",
)
],
],
),
0,
"group",
)
]
grids = [
[
(
dict(
@ -239,4 +242,6 @@ def setTab_proxy(self, l):
)
],
]
if get_platform() != "xp":
grids.insert(0, grids1)
makescrollgrid(grids, l)

View File

@ -9,6 +9,7 @@ from myutils.config import (
get_launchpath,
savehook_new_list,
static_data,
get_platform,
)
from traceback import print_exc
@ -280,6 +281,8 @@ def selectgameuid(self):
button.button(QDialogButtonBox.StandardButton.Ok).setText(_TR("确定"))
button.button(QDialogButtonBox.StandardButton.Cancel).setText(_TR("取消"))
if dialog.exec():
if not _internal:
return None
return _internal[combo.currentIndex()]
@ -642,6 +645,8 @@ def setTabOne_lazy(self, basel: QVBoxLayout):
("ocr", "OCR"),
("copy", "剪贴板"),
]
if get_platform() == "xp":
_rank.pop(1)
__ = []
for key, name in _rank:
__.append(getsmalllabel(name))
@ -681,15 +686,21 @@ def setTabOne_lazy(self, basel: QVBoxLayout):
]
gridlayoutwidget, do = makegrid(tab1grids, delay=True)
basel.addWidget(gridlayoutwidget)
titles = ["HOOK设置", "OCR设置", "剪贴板", "文本输出", "其他"]
funcs = [
lambda l: setTabOne_lazy_h(self, l),
lambda l: getocrgrid_table(self, l),
lambda l: makescrollgrid(getTabclip(self), l),
lambda l: makescrollgrid(outputgrid(self), l),
lambda l: makescrollgrid(filetranslate(self), l),
]
if get_platform() == "xp":
titles.pop(1)
funcs.pop(1)
tab, dotab = makesubtab_lazy(
["HOOK设置", "OCR设置", "剪贴板", "文本输出", "其他"],
[
lambda l: setTabOne_lazy_h(self, l),
lambda l: getocrgrid_table(self, l),
lambda l: makescrollgrid(getTabclip(self), l),
lambda l: makescrollgrid(outputgrid(self), l),
lambda l: makescrollgrid(filetranslate(self), l),
],
titles,
funcs,
delay=True,
)
basel.addWidget(tab)

View File

@ -109,10 +109,13 @@ class mecab(basehira):
# print(node.feature)
if "-" in origorig:
try:
hira_ = origorig.split("-")[1]
if isascii(hira): # 腰を引いて-->引く-他動詞
hira = hira_
origorig = origorig.split("-")[0]
maybe_english = origorig.split("-")[1]
if isascii(maybe_english):
# コンビニを --> コンビニ-convenience
hira = origorig = maybe_english
else:
# 腰を引いて --> 引く-他動詞
origorig = origorig.split("-")[0]
except:
pass

View File

@ -3,24 +3,7 @@ import os, re
def parsecode(code: str):
# PyQt
code = code.replace(
"QApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling)", ""
)
code = code.replace("QApplication.setHighDpiScaleFactorRoundingPolicy", "print")
code = code.replace("Qt.HighDpiScaleFactorRoundingPolicy.PassThrough", "")
code = code.replace("self.screen().geometry().height()", "99999")
code = code.replace(
'"./files/runtime/PyQt5/Qt5/plugins"',
'"./files/runtime/Lib/site-packages/PyQt5/plugins"',
)
code = code.replace(
"./files/runtime/PyQt5/Qt5/bin/Qt5Core.dll",
"./files/runtime/Lib/site-packages/PyQt5/Qt5Core.dll",
)
code = code.replace(
' windows.addenvpath("./files/runtime/")',
' windows.addenvpath("./files/runtime/")\n windows.addenvpath("./files/runtime/Lib/site-packages/PyQt5")',
)
code = code.replace("self.parent().devicePixelRatioF()", "1")
code = code.replace("self.devicePixelRatioF()", "1")
code = re.sub(