From 275c661b7d20b1ea330e1c3d4d29cc3b2e2db5d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Mon, 1 Apr 2024 19:59:06 +0800 Subject: [PATCH] fix --- LunaHook/engine64/yuzusuyu.cpp | 116 ++++++++++------------- LunaHook/engines/ppsspp/ppsspp.cpp | 4 +- LunaHook/engines/ppsspp/psputils.hpp | 3 +- LunaHook/engines/ppsspp/specialgames.hpp | 44 +++++---- include/stringutils.cpp | 13 +++ include/stringutils.h | 2 + 6 files changed, 92 insertions(+), 90 deletions(-) diff --git a/LunaHook/engine64/yuzusuyu.cpp b/LunaHook/engine64/yuzusuyu.cpp index 7c8a04b..99d20e2 100644 --- a/LunaHook/engine64/yuzusuyu.cpp +++ b/LunaHook/engine64/yuzusuyu.cpp @@ -70,29 +70,15 @@ uintptr_t* argidx(hook_stack* stack,int idx){ } struct emfuncinfo{ - const char* hookname; uint64_t type; int argidx;int padding; void* hookfunc; void* filterfun; - const wchar_t* _id; - const wchar_t* _version; + const char* _id; + const char* _version; }; std::unordered_mapemfunctionhooks; -std::string wcasta(const std::wstring x){ - std::string xx; - for(auto c:x) - xx+=c; - return xx; -} - -std::wstring acastw(const std::string x){ - std::wstring xx; - for(auto c:x) - xx+=c; - return xx; -} struct GameInfo { std::string name{""}; uint64_t id{0}; @@ -103,11 +89,11 @@ bool checkiscurrentgame(const emfuncinfo& em){ for(auto&& info:wininfos){ if((game_info.version.size())&&(info.title.find(acastw(game_info.version))!=info.title.npos)&&(game_info.id!=0)){ //判断是有效的info - auto checkversion=(std::wstring(em._version)==acastw(game_info.version)); + auto checkversion=(std::string(em._version)==(game_info.version)); auto checkid=(std::stoll(em._id,0,16)==game_info.id); if(checkid&&checkversion)return true; } - else if(info.title.find(em._version)!=info.title.npos)return true; + else if(info.title.find(acastw(em._version))!=info.title.npos)return true; } return false; } @@ -188,7 +174,7 @@ bool yuzusuyu::attach_function() hpinternal.argidx=op.argidx; hpinternal.padding=op.padding; hpinternal.jittype=JITTYPE::YUZU; - NewHook(hpinternal,op.hookname); + NewHook(hpinternal,op._id); }(); delayinsertNewHook(em_address); }; @@ -486,74 +472,74 @@ bool F0100936018EB4000(void* data, size_t* len, HookParam* hp){ namespace{ auto _=[](){ emfunctionhooks={ - {0x8003eeac - 0x80004000,{"Memories Off",CODEC_UTF16,0,0,_0100978013276000,0,L"0100978013276000",L"1.0.0"}}, - {0x8003eebc - 0x80004000,{"Memories Off",CODEC_UTF16,0,0,_0100978013276000,0,L"0100978013276000",L"1.0.1"}}, + {0x8003eeac - 0x80004000,{CODEC_UTF16,0,0,_0100978013276000,0,"0100978013276000","1.0.0"}}, + {0x8003eebc - 0x80004000,{CODEC_UTF16,0,0,_0100978013276000,0,"0100978013276000","1.0.1"}}, // Shiro to Kuro no Alice - {0x80013f20 - 0x80004000,{"Shiro to Kuro no Alice",CODEC_UTF8,0,0,0,NewLineCharFilterW,L"0100A460141B8000",L"1.0.0"}}, - {0x80013f94 - 0x80004000,{"Shiro to Kuro no Alice",CODEC_UTF8,0,0,0,NewLineCharFilterW,L"0100A460141B8000",L"1.0.0"}}, - {0x8001419c - 0x80004000,{"Shiro to Kuro no Alice",CODEC_UTF8,0,0,0,NewLineCharFilterW,L"0100A460141B8000",L"1.0.0"}}, + {0x80013f20 - 0x80004000,{CODEC_UTF8,0,0,0,NewLineCharFilterW,"0100A460141B8000","1.0.0"}}, + {0x80013f94 - 0x80004000,{CODEC_UTF8,0,0,0,NewLineCharFilterW,"0100A460141B8000","1.0.0"}}, + {0x8001419c - 0x80004000,{CODEC_UTF8,0,0,0,NewLineCharFilterW,"0100A460141B8000","1.0.0"}}, // Shiro to Kuro no Alice -Twilight line- - {0x80014260 - 0x80004000,{"Shiro to Kuro no Alice -Twilight line-",CODEC_UTF8,0,0,0,NewLineCharFilterW,L"0100A460141B8000",L"1.0.0"}}, - {0x800142d4 - 0x80004000,{"Shiro to Kuro no Alice -Twilight line-",CODEC_UTF8,0,0,0,NewLineCharFilterW,L"0100A460141B8000",L"1.0.0"}}, - {0x800144dc - 0x80004000,{"Shiro to Kuro no Alice -Twilight line-",CODEC_UTF8,0,0,0,NewLineCharFilterW,L"0100A460141B8000",L"1.0.0"}}, + {0x80014260 - 0x80004000,{CODEC_UTF8,0,0,0,NewLineCharFilterW,"0100A460141B8000","1.0.0"}}, + {0x800142d4 - 0x80004000,{CODEC_UTF8,0,0,0,NewLineCharFilterW,"0100A460141B8000","1.0.0"}}, + {0x800144dc - 0x80004000,{CODEC_UTF8,0,0,0,NewLineCharFilterW,"0100A460141B8000","1.0.0"}}, - {0x80072d00 - 0x80004000,{"CLANNAD",CODEC_UTF16|FULL_STRING,1,0,0, F0100A3A00CC7E000,L"0100A3A00CC7E000",L"1.0.0"}}, - {0x80072d30 - 0x80004000,{"CLANNAD",CODEC_UTF16|FULL_STRING,1,0,0,F0100A3A00CC7E000,L"0100A3A00CC7E000",L"1.0.7"}}, + {0x80072d00 - 0x80004000,{CODEC_UTF16|FULL_STRING,1,0,0, F0100A3A00CC7E000,"0100A3A00CC7E000","1.0.0"}}, + {0x80072d30 - 0x80004000,{CODEC_UTF16|FULL_STRING,1,0,0,F0100A3A00CC7E000,"0100A3A00CC7E000","1.0.7"}}, - {0x800e3424 - 0x80004000,{"VARIABLE BARRICADE NS",CODEC_UTF8,0,0,0,F010045C0109F2000,L"010045C0109F2000",L"1.0.1"}},//"System Messages + Choices"), //Also includes the names of characters, - {0x800fb080 - 0x80004000,{"VARIABLE BARRICADE NS",CODEC_UTF8,3,0,0,F010045C0109F2000,L"010045C0109F2000",L"1.0.1"}},//Main Text + {0x800e3424 - 0x80004000,{CODEC_UTF8,0,0,0,F010045C0109F2000,"010045C0109F2000","1.0.1"}},//"System Messages + Choices"), //Also includes the names of characters, + {0x800fb080 - 0x80004000,{CODEC_UTF8,3,0,0,F010045C0109F2000,"010045C0109F2000","1.0.1"}},//Main Text - {0x805bba5c - 0x80004000,{"AMNESIA for Nintendo Switch",CODEC_UTF16,0,0,T0100A1E00BFEA000<2>,F0100A1E00BFEA000,L"0100A1E00BFEA000",L"1.0.1"}},//dialogue - {0x805e9930 - 0x80004000,{"AMNESIA for Nintendo Switch",CODEC_UTF16,0,0,T0100A1E00BFEA000<2>,F0100A1E00BFEA000,L"0100A1E00BFEA000",L"1.0.1"}},//choice - {0x805e7fd8 - 0x80004000,{"AMNESIA for Nintendo Switch",CODEC_UTF16,0,0,T0100A1E00BFEA000<2>,F0100A1E00BFEA000,L"0100A1E00BFEA000",L"1.0.1"}},//name + {0x805bba5c - 0x80004000,{CODEC_UTF16,0,0,T0100A1E00BFEA000<2>,F0100A1E00BFEA000,"0100A1E00BFEA000","1.0.1"}},//dialogue + {0x805e9930 - 0x80004000,{CODEC_UTF16,0,0,T0100A1E00BFEA000<2>,F0100A1E00BFEA000,"0100A1E00BFEA000","1.0.1"}},//choice + {0x805e7fd8 - 0x80004000,{CODEC_UTF16,0,0,T0100A1E00BFEA000<2>,F0100A1E00BFEA000,"0100A1E00BFEA000","1.0.1"}},//name - {0x80095010 - 0x80004000,{"Chou no Doku Hana no Kusari Taishou Tsuya Koi Ibun",CODEC_UTF16,1,0,0,F0100A1200CA3C000,L"0100A1200CA3C000",L"2.0.1"}},//Main Text + Names + {0x80095010 - 0x80004000,{CODEC_UTF16,1,0,0,F0100A1200CA3C000,"0100A1200CA3C000","2.0.1"}},//Main Text + Names - {0x80a05170 - 0x80004000,{"Live a Live",CODEC_UTF16,0,0,0,F0100C29017106000,L"0100C29017106000",L"1.0.0"}}, + {0x80a05170 - 0x80004000,{CODEC_UTF16,0,0,0,F0100C29017106000,"0100C29017106000","1.0.0"}}, - {0x8049d968 - 0x80004000,{"Sakura no Kumo * Scarlet no Koi",CODEC_UTF8,0,1,0,F01006590155AC000,L"01006590155AC000",L"1.0.0"}},//name - {0x8049d980 - 0x80004000,{"Sakura no Kumo * Scarlet no Koi",CODEC_UTF8,0,0,0,F01006590155AC000,L"01006590155AC000",L"1.0.0"}},//dialogue + {0x8049d968 - 0x80004000,{CODEC_UTF8,0,1,0,F01006590155AC000,"01006590155AC000","1.0.0"}},//name + {0x8049d980 - 0x80004000,{CODEC_UTF8,0,0,0,F01006590155AC000,"01006590155AC000","1.0.0"}},//dialogue - {0x80557408 - 0x80004000,{"Majestic Majolical",CODEC_UTF8,0,0,0,F01000200194AE000,L"01000200194AE000",L"1.0.0"}},//name - {0x8059ee94 - 0x80004000,{"Majestic Majolical",CODEC_UTF8,3,0,0,F01000200194AE000,L"01000200194AE000",L"1.0.0"}},//player name - {0x80557420 - 0x80004000,{"Majestic Majolical",CODEC_UTF8,0,0,0,F01000200194AE000,L"01000200194AE000",L"1.0.0"}},//dialogue + {0x80557408 - 0x80004000,{CODEC_UTF8,0,0,0,F01000200194AE000,"01000200194AE000","1.0.0"}},//name + {0x8059ee94 - 0x80004000,{CODEC_UTF8,3,0,0,F01000200194AE000,"01000200194AE000","1.0.0"}},//player name + {0x80557420 - 0x80004000,{CODEC_UTF8,0,0,0,F01000200194AE000,"01000200194AE000","1.0.0"}},//dialogue - {0x8017ad54 - 0x80004000,{"Matsurika no Kei",CODEC_UTF32,1,0,0,F0100EA001A626000,L"0100EA001A626000",L"1.0.0"}},// text - {0x80174d4c - 0x80004000,{"Matsurika no Kei",CODEC_UTF32,1,0,0,F0100EA001A626000,L"0100EA001A626000",L"1.0.0"}},// name + {0x8017ad54 - 0x80004000,{CODEC_UTF32,1,0,0,F0100EA001A626000,"0100EA001A626000","1.0.0"}},// text + {0x80174d4c - 0x80004000,{CODEC_UTF32,1,0,0,F0100EA001A626000,"0100EA001A626000","1.0.0"}},// name - {0x80057910 - 0x80004000,{"Cupid Parasite",CODEC_UTF32,2,0,0,F0100F7E00DFC8000,L"0100F7E00DFC8000",L"1.0.1"}},// name + text - {0x80169df0 - 0x80004000,{"Cupid Parasite",CODEC_UTF32,0,0,0,F0100F7E00DFC8000,L"0100F7E00DFC8000",L"1.0.1"}},// choice + {0x80057910 - 0x80004000,{CODEC_UTF32,2,0,0,F0100F7E00DFC8000,"0100F7E00DFC8000","1.0.1"}},// name + text + {0x80169df0 - 0x80004000,{CODEC_UTF32,0,0,0,F0100F7E00DFC8000,"0100F7E00DFC8000","1.0.1"}},// choice - {0x80075190 - 0x80004000,{"Radiant Tale",CODEC_UTF8,1,0,0,F0100925014864000,L"0100925014864000",L"1.0.0"}},// prompt - {0x8002fb18 - 0x80004000,{"Radiant Tale",CODEC_UTF8,0,0,0,F0100925014864000,L"0100925014864000",L"1.0.0"}},// name - {0x8002fd7c - 0x80004000,{"Radiant Tale",CODEC_UTF8,0,0,0,F0100925014864000,L"0100925014864000",L"1.0.0"}},// text + {0x80075190 - 0x80004000,{CODEC_UTF8,1,0,0,F0100925014864000,"0100925014864000","1.0.0"}},// prompt + {0x8002fb18 - 0x80004000,{CODEC_UTF8,0,0,0,F0100925014864000,"0100925014864000","1.0.0"}},// name + {0x8002fd7c - 0x80004000,{CODEC_UTF8,0,0,0,F0100925014864000,"0100925014864000","1.0.0"}},// text - {0x80462DD4 - 0x80004000,{"MUSICUS",CODEC_UTF8,0,1,0,F01006590155AC000,L"01000130150FA000",L"1.0.0"}},// name - {0x80462DEC - 0x80004000,{"MUSICUS",CODEC_UTF8,0,0,0,F01006590155AC000,L"01000130150FA000",L"1.0.0"}},// dialogue 1 - {0x80480d4c - 0x80004000,{"MUSICUS",CODEC_UTF8,0,0,0,F01006590155AC000,L"01000130150FA000",L"1.0.0"}},// dialogue 2 - {0x804798e0 - 0x80004000,{"MUSICUS",CODEC_UTF8,0,0,0,F01006590155AC000,L"01000130150FA000",L"1.0.0"}},// choice + {0x80462DD4 - 0x80004000,{CODEC_UTF8,0,1,0,F01006590155AC000,"01000130150FA000","1.0.0"}},// name + {0x80462DEC - 0x80004000,{CODEC_UTF8,0,0,0,F01006590155AC000,"01000130150FA000","1.0.0"}},// dialogue 1 + {0x80480d4c - 0x80004000,{CODEC_UTF8,0,0,0,F01006590155AC000,"01000130150FA000","1.0.0"}},// dialogue 2 + {0x804798e0 - 0x80004000,{CODEC_UTF8,0,0,0,F01006590155AC000,"01000130150FA000","1.0.0"}},// choice - {0x80046700 - 0x80004000,{"CHAOS;HEAD NOAH",CODEC_UTF16,0,0,_0100978013276000,0,L"0100957016B90000",L"1.0.0"}}, - {0x8003A2c0 - 0x80004000,{"CHAOS;HEAD NOAH",CODEC_UTF16,0,0,_0100978013276000,0,L"0100957016B90000",L"1.0.0"}},// choice - {0x8003EAB0 - 0x80004000,{"CHAOS;HEAD NOAH",CODEC_UTF16,0,0,_0100978013276000,0,L"0100957016B90000",L"1.0.0"}},// TIPS list (menu) - {0x8004C648 - 0x80004000,{"CHAOS;HEAD NOAH",CODEC_UTF16,0,0,_0100978013276000,0,L"0100957016B90000",L"1.0.0"}},// system message - {0x80050374 - 0x80004000,{"CHAOS;HEAD NOAH",CODEC_UTF16,0,0,_0100978013276000,0,L"0100957016B90000",L"1.0.0"}},// TIPS (red) + {0x80046700 - 0x80004000,{CODEC_UTF16,0,0,_0100978013276000,0,"0100957016B90000","1.0.0"}}, + {0x8003A2c0 - 0x80004000,{CODEC_UTF16,0,0,_0100978013276000,0,"0100957016B90000","1.0.0"}},// choice + {0x8003EAB0 - 0x80004000,{CODEC_UTF16,0,0,_0100978013276000,0,"0100957016B90000","1.0.0"}},// TIPS list (menu) + {0x8004C648 - 0x80004000,{CODEC_UTF16,0,0,_0100978013276000,0,"0100957016B90000","1.0.0"}},// system message + {0x80050374 - 0x80004000,{CODEC_UTF16,0,0,_0100978013276000,0,"0100957016B90000","1.0.0"}},// TIPS (red) - {0x80ac4d88 - 0x80004000,{"Story of Seasons a Wonderful Life",CODEC_UTF32,0,0,F0100936018EB4000,L"0100936018EB4000",L"1.0.3"}},// Main text - {0x808f7e84 - 0x80004000,{"Story of Seasons a Wonderful Life",CODEC_UTF32,0,0,F0100936018EB4000,L"0100936018EB4000",L"1.0.3"}},// Item name - {0x80bdf804 - 0x80004000,{"Story of Seasons a Wonderful Life",CODEC_UTF32,0,0,F0100936018EB4000,L"0100936018EB4000",L"1.0.3"}},// Item description + {0x80ac4d88 - 0x80004000,{CODEC_UTF32,0,0,F0100936018EB4000,"0100936018EB4000","1.0.3"}},// Main text + {0x808f7e84 - 0x80004000,{CODEC_UTF32,0,0,F0100936018EB4000,"0100936018EB4000","1.0.3"}},// Item name + {0x80bdf804 - 0x80004000,{CODEC_UTF32,0,0,F0100936018EB4000,"0100936018EB4000","1.0.3"}},// Item description - {0x81e75940 - 0x80004000,{"Hamefura Pirates",CODEC_UTF16,0,0,T0100982015606000,F0100982015606000,L"0100982015606000",L"1.0.0"}},// Hamekai.TalkPresenter$$AddMessageBacklog - {0x81c9ae60 - 0x80004000,{"Hamefura Pirates",CODEC_UTF16,0,0,T0100982015606000,F0100982015606000,L"0100982015606000",L"1.0.0"}},// Hamekai.ChoicesText$$SetText - {0x81eb7dc0 - 0x80004000,{"Hamefura Pirates",CODEC_UTF16,0,0,T0100982015606000,F0100982015606000,L"0100982015606000",L"1.0.0"}},// Hamekai.ShortStoryTextView$$AddText + {0x81e75940 - 0x80004000,{CODEC_UTF16,0,0,T0100982015606000,F0100982015606000,"0100982015606000","1.0.0"}},// Hamekai.TalkPresenter$$AddMessageBacklog + {0x81c9ae60 - 0x80004000,{CODEC_UTF16,0,0,T0100982015606000,F0100982015606000,"0100982015606000","1.0.0"}},// Hamekai.ChoicesText$$SetText + {0x81eb7dc0 - 0x80004000,{CODEC_UTF16,0,0,T0100982015606000,F0100982015606000,"0100982015606000","1.0.0"}},// Hamekai.ShortStoryTextView$$AddText - {0x80225C3C - 0x80004000,{"Death end re;Quest 2",CODEC_UTF8,8,0,0,F010001D015260000,L"010001D015260000",L"1.0.0"}}, - {0x80241088 - 0x80004000,{"Death end re;Quest",CODEC_UTF8,8,0,0,F0100AEC013DDA000,L"0100AEC013DDA000",L"1.0.0"}},//english ver + {0x80225C3C - 0x80004000,{CODEC_UTF8,8,0,0,F010001D015260000,"010001D015260000","1.0.0"}}, + {0x80241088 - 0x80004000,{CODEC_UTF8,8,0,0,F0100AEC013DDA000,"0100AEC013DDA000","1.0.0"}},//english ver }; return 1; diff --git a/LunaHook/engines/ppsspp/ppsspp.cpp b/LunaHook/engines/ppsspp/ppsspp.cpp index e97600d..9c1d732 100644 --- a/LunaHook/engines/ppsspp/ppsspp.cpp +++ b/LunaHook/engines/ppsspp/ppsspp.cpp @@ -271,7 +271,7 @@ namespace ppsspp{ bool checkiscurrentgame(const emfuncinfo& em){ auto wininfos=get_proc_windows(); for(auto&& info:wininfos){ - if(info.title.find(em._id)!=info.title.npos)return true; + if(info.title.find(acastw(em._id))!=info.title.npos)return true; } return false; } @@ -331,7 +331,7 @@ bool hookPPSSPPDoJit(){ hpinternal.argidx=op.argidx; hpinternal.padding=op.padding; hpinternal.jittype=JITTYPE::PPSSPP; - NewHook(hpinternal,op.hookname); + NewHook(hpinternal,op._id); }(); delayinsertNewHook(em_address); }; diff --git a/LunaHook/engines/ppsspp/psputils.hpp b/LunaHook/engines/ppsspp/psputils.hpp index f694c9e..e0abf33 100644 --- a/LunaHook/engines/ppsspp/psputils.hpp +++ b/LunaHook/engines/ppsspp/psputils.hpp @@ -4,12 +4,11 @@ namespace ppsspp { struct emfuncinfo{ - const char* hookname; uint64_t type; int argidx;int padding; void* hookfunc; void* filterfun; - const wchar_t* _id; + const char* _id; }; } diff --git a/LunaHook/engines/ppsspp/specialgames.hpp b/LunaHook/engines/ppsspp/specialgames.hpp index a66a2b8..bca7632 100644 --- a/LunaHook/engines/ppsspp/specialgames.hpp +++ b/LunaHook/engines/ppsspp/specialgames.hpp @@ -254,29 +254,31 @@ void QNPJH50909(hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* sp } namespace ppsspp{ std::unordered_mapemfunctionhooks= { - {0x883bf34,{"Shinigami to Shoujo",0,1,0,0,ULJS00403_filter,L"ULJS00403"}}, - {0x0886775c,{"Amagami",0,0,0,ULJS00339,0,L"ULJS00339"}},// String.length() - {0x8814adc,{"Sekai de Ichiban Dame na Koi",0,0,0,0,NPJH50909_filter,L"ULJM05878"}},// name + dialouge - {0x8850b2c,{"Sekai de Ichiban Dame na Koi",0,0,0,0,NPJH50909_filter,L"ULJM05878"}},// onscreen toast - {0x0891D72C,{"Dunamis15",CODEC_UTF8,0,0,0,ULJM06119_filter,L"ULJM06119"}}, - {0x88506d0,{"Princess Evangile Portable",CODEC_UTF16,2,0,0,ULJM06036_filter,L"ULJM06036"}},// [0x88506d0(2)...0x088507C0(?)] // name text text (line doubled) - {0x89b59dc,{"Kin'iro no Corda 2f",0,0,0,ULJM05428,0,L"ULJM05428"}}, - {0x886162c,{"Kin'iro no Corda",0,0,0,ULJM05054,0,L"ULJM05054"}},// dialogue: 0x886162c (x1), 0x889d5fc-0x889d520(a2) fullLine - {0x8899e90,{"Kin'iro no Corda",0,0,0,ULJM05054,0,L"ULJM05054"}},// name 0x88da57c, 0x8899ca4 (x0, oneTime), 0x8899e90 - {0x8952cfc,{"Sol Trigger",CODEC_UTF8,0,0,0,NPJH50619F,L"NPJH50619"}},//dialog - {0x884aad4,{"Sol Trigger",CODEC_UTF8,0,0,0,NPJH50619F,L"NPJH50619"}},//description - {0x882e1b0,{"Sol Trigger",CODEC_UTF8,0,0,0,NPJH50619F,L"NPJH50619"}},//system - {0x88bb108,{"Sol Trigger",CODEC_UTF8,2,0,0,NPJH50619F,L"NPJH50619"}},//battle tutorial - {0x89526a0,{"Sol Trigger",CODEC_UTF8,0,0,0,NPJH50619F,L"NPJH50619"}},//battle info - {0x88bcef8,{"Sol Trigger",CODEC_UTF8,1,0,0,NPJH50619F,L"NPJH50619"}},//battle talk - {0x8958490,{"Fate/EXTRA CCC",0,0,0,0,NPJH50505F,L"NPJH50505"}}, - {0x088630f8,{"Kamigami no Asobi InFinite",0,0,0,QNPJH50909,0,L"NPJH50909"}}, // text, choice (debounce trailing 400ms), TODO: better hook - {0x0887813c,{"Kamigami no Asobi InFinite",0,3,4,0,0,L"NPJH50909"}}, // Question YN + {0x883bf34,{0,1,0,0,ULJS00403_filter,"ULJS00403"}}, + {0x0886775c,{0,0,0,ULJS00339,0,"ULJS00339"}},// String.length() + {0x8814adc,{0,0,0,0,NPJH50909_filter,"ULJM05878"}},// name + dialouge + {0x8850b2c,{0,0,0,0,NPJH50909_filter,"ULJM05878"}},// onscreen toast + {0x0891D72C,{CODEC_UTF8,0,0,0,ULJM06119_filter,"ULJM06119"}}, + {0x88506d0,{CODEC_UTF16,2,0,0,ULJM06036_filter,"ULJM06036"}},// [0x88506d0(2)...0x088507C0(?)] // name text text (line doubled) + {0x89b59dc,{0,0,0,ULJM05428,0,"ULJM05428"}}, + {0x886162c,{0,0,0,ULJM05054,0,"ULJM05054"}},// dialogue: 0x886162c (x1), 0x889d5fc-0x889d520(a2) fullLine + {0x8899e90,{0,0,0,ULJM05054,0,"ULJM05054"}},// name 0x88da57c, 0x8899ca4 (x0, oneTime), 0x8899e90 + {0x8952cfc,{CODEC_UTF8,0,0,0,NPJH50619F,"NPJH50619"}},//dialog + {0x884aad4,{CODEC_UTF8,0,0,0,NPJH50619F,"NPJH50619"}},//description + {0x882e1b0,{CODEC_UTF8,0,0,0,NPJH50619F,"NPJH50619"}},//system + {0x88bb108,{CODEC_UTF8,2,0,0,NPJH50619F,"NPJH50619"}},//battle tutorial + {0x89526a0,{CODEC_UTF8,0,0,0,NPJH50619F,"NPJH50619"}},//battle info + {0x88bcef8,{CODEC_UTF8,1,0,0,NPJH50619F,"NPJH50619"}},//battle talk + {0x8958490,{0,0,0,0,NPJH50505F,"NPJH50505"}}, + {0x088630f8,{0,0,0,QNPJH50909,0,"NPJH50909"}}, // text, choice (debounce trailing 400ms), TODO: better hook + {0x0887813c,{0,3,4,0,0,"NPJH50909"}}, // Question YN - {0x88eeba4,{"Gekka Ryouran Romance",0,0,0,0,ULJM05943F,L"ULJM05943"}},// a0 - monologue text - {0x8875e0c,{"Gekka Ryouran Romance",0,1,6,0,ULJM05943F,L"ULJM05943"}},// a1 - dialogue text + {0x88eeba4,{0,0,0,0,ULJM05943F,"ULJM05943"}},// a0 - monologue text + {0x8875e0c,{0,1,6,0,ULJM05943F,"ULJM05943"}},// a1 - dialogue text - {0x886F014,{"My Merry May with be",0,3,0,0,FULJM05603,L"ULJM05603"}}, + {0x886F014,{0,3,0,0,FULJM05603,"ULJM05603"}}, + + {0x88517C8,{0,1,0,0,FULJM05603,"ULJM06114"}}, }; } \ No newline at end of file diff --git a/include/stringutils.cpp b/include/stringutils.cpp index 1fdb1f9..c656548 100644 --- a/include/stringutils.cpp +++ b/include/stringutils.cpp @@ -190,6 +190,19 @@ size_t u32strlen(uint32_t* data){ return s; } +std::string wcasta(const std::wstring x){ + std::string xx; + for(auto c:x) + xx+=c; + return xx; +} + +std::wstring acastw(const std::string x){ + std::wstring xx; + for(auto c:x) + xx+=c; + return xx; +} #include"const.h" #include"types.h" std::optional commonparsestring(void* data,size_t length,void* php,DWORD df){ diff --git a/include/stringutils.h b/include/stringutils.h index 51560a6..83eded5 100644 --- a/include/stringutils.h +++ b/include/stringutils.h @@ -29,6 +29,8 @@ std::string WideStringToString(const std::wstring& text,UINT cp=CP_UTF8); std::wstring StringToWideString(const std::string& text); std::optional StringToWideString(const std::string& text, UINT encoding); +std::string wcasta(const std::wstring x); +std::wstring acastw(const std::string x); size_t u32strlen(uint32_t* data); inline bool disable_mbwc=false; inline bool disable_wcmb=false;