diff --git a/LunaHook/embed_util.cc b/LunaHook/embed_util.cc index f6b1857..898a250 100644 --- a/LunaHook/embed_util.cc +++ b/LunaHook/embed_util.cc @@ -231,6 +231,7 @@ UINT64 texthash(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; 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{ if(waitforevent(embedsharedmem->waittime,tp,origin)==false)return false; translate=embedsharedmem->text; - if((translate.size()==0)||(translate==origin))return false; + if((translate.size()==0))return false; translatecache.insert(std::make_pair(hash,translate)); } if(hp.newlineseperator)strReplace(translate,L"\n",hp.newlineseperator); diff --git a/LunaHook/engine32/BGI.cpp b/LunaHook/engine32/BGI.cpp index f7a22be..e3c61e0 100644 --- a/LunaHook/engine32/BGI.cpp +++ b/LunaHook/engine32/BGI.cpp @@ -1488,7 +1488,8 @@ bool InsertBGI4Hook() hp.address = addr; hp.offset=get_reg(regs::eax); 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; ConsoleOutput("BGI4");