This commit is contained in:
恍兮惚兮 2024-04-01 00:46:05 +08:00
parent f0bbae9df9
commit a2a287002d
2 changed files with 10 additions and 12 deletions

View File

@ -145,21 +145,18 @@ uintptr_t queryrelativeret(uintptr_t retaddr){
return relative;
}
void jitfunctiontext_fun(hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){
uintptr_t jitgetaddr(hook_stack* stack, HookParam* hp){
switch (hp->jittype)
{
#ifdef _WIN64
case JITTYPE::YUZU:
*data=YUZU::emu_arg(stack)[hp->argidx]+hp->padding;
break;
return YUZU::emu_arg(stack)[hp->argidx]+hp->padding;
#endif
case JITTYPE::PPSSPP:
*data=PPSSPP::emu_arg(stack)[hp->argidx]+hp->padding;
break;
return PPSSPP::emu_arg(stack)[hp->argidx]+hp->padding;
default:
*data=0;
return 0;
}
*len=HookStrLen(hp,(BYTE*)*data);
}
void TextHook::Send(uintptr_t lpDataBase)
{
@ -183,6 +180,11 @@ void TextHook::Send(uintptr_t lpDataBase)
plpdatain=(lpDataBase + hp.offset),
lpDataIn=*(uintptr_t*)plpdatain;
bool isstring=false;
if(hp.jittype!=JITTYPE::PC)
{
lpDataIn=jitgetaddr(stack,&hp);
plpdatain=(uintptr_t)&lpDataIn;
}
auto use_custom_embed_fun=(hp.type&EMBED_ABLE)&&!(hp.type&EMBED_BEFORE_SIMPLE);
if(use_custom_embed_fun)
@ -196,10 +198,6 @@ void TextHook::Send(uintptr_t lpDataBase)
isstring=true;
hp.text_fun(stack, &hp, &lpDataIn, &lpSplit, &lpCount);
}
else if(hp.jittype!=JITTYPE::PC){
isstring=true;
jitfunctiontext_fun(stack, &hp, &lpDataIn, &lpSplit, &lpCount);
}
else
{
if (hp.type & FIXING_SPLIT) lpSplit = FIXED_SPLIT_VALUE; // fuse all threads, and prevent floating

View File

@ -304,7 +304,7 @@ namespace
if (hp.type & NO_CONTEXT) HCode += L'N';
if (hp.codepage != 0 && !(hp.type & CODEC_UTF8) ) HCode += std::to_wstring(hp.codepage) + L'#';
if (hp.codepage != 0 && !(hp.type & CODEC_UTF8)&&!(hp.type & CODEC_UTF16)&&!(hp.type & CODEC_UTF32) ) HCode += std::to_wstring(hp.codepage) + L'#';
if (hp.padding) HCode += HexString(hp.padding) + L'+';