mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-27 15:54:03 +08:00
fix
This commit is contained in:
parent
d5fb0e4503
commit
271aa43cee
@ -231,6 +231,7 @@ UINT64 texthash(void*data,size_t len)
|
|||||||
}
|
}
|
||||||
bool checktranslatedok(void*data ,size_t len)
|
bool checktranslatedok(void*data ,size_t len)
|
||||||
{
|
{
|
||||||
|
ZeroMemory(embedsharedmem->text,sizeof(embedsharedmem->text));//clear trans before call
|
||||||
if(len>1000)return true;
|
if(len>1000)return true;
|
||||||
return(translatecache.find(texthash(data,len))!=translatecache.end());
|
return(translatecache.find(texthash(data,len))!=translatecache.end());
|
||||||
}
|
}
|
||||||
@ -247,7 +248,7 @@ bool TextHook::waitfornotify(TextOutput_T* buffer,void*data ,size_t*len,ThreadPa
|
|||||||
else{
|
else{
|
||||||
if(waitforevent(embedsharedmem->waittime,tp,origin)==false)return false;
|
if(waitforevent(embedsharedmem->waittime,tp,origin)==false)return false;
|
||||||
translate=embedsharedmem->text;
|
translate=embedsharedmem->text;
|
||||||
if((translate.size()==0)||(translate==origin))return false;
|
if((translate.size()==0))return false;
|
||||||
translatecache.insert(std::make_pair(hash,translate));
|
translatecache.insert(std::make_pair(hash,translate));
|
||||||
}
|
}
|
||||||
if(hp.newlineseperator)strReplace(translate,L"\n",hp.newlineseperator);
|
if(hp.newlineseperator)strReplace(translate,L"\n",hp.newlineseperator);
|
||||||
|
@ -1488,7 +1488,8 @@ bool InsertBGI4Hook()
|
|||||||
hp.address = addr;
|
hp.address = addr;
|
||||||
hp.offset=get_reg(regs::eax);
|
hp.offset=get_reg(regs::eax);
|
||||||
hp.split = get_reg(regs::esp);
|
hp.split = get_reg(regs::esp);
|
||||||
hp.type = CODEC_UTF16 | USING_STRING| USING_SPLIT ;
|
hp.type = CODEC_UTF16 | USING_STRING| USING_SPLIT |EMBED_ABLE|EMBED_BEFORE_SIMPLE|EMBED_AFTER_OVERWRITE;
|
||||||
|
hp.hook_font=F_TextOutW|F_GetTextExtentPoint32W;
|
||||||
hp.filter_fun = BGI7Filter;
|
hp.filter_fun = BGI7Filter;
|
||||||
ConsoleOutput("BGI4");
|
ConsoleOutput("BGI4");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user