mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-23 13:55:36 +08:00
flags
This commit is contained in:
parent
81feb86bd0
commit
311a38a474
@ -62,7 +62,7 @@ include(generate_product_version)
|
|||||||
|
|
||||||
set(VERSION_MAJOR 3)
|
set(VERSION_MAJOR 3)
|
||||||
set(VERSION_MINOR 16)
|
set(VERSION_MINOR 16)
|
||||||
set(VERSION_PATCH 0)
|
set(VERSION_PATCH 1)
|
||||||
set(VERSION_REVISION 0)
|
set(VERSION_REVISION 0)
|
||||||
|
|
||||||
if(BUILD_CORE)
|
if(BUILD_CORE)
|
||||||
|
@ -165,18 +165,11 @@ static std::wstring insertSpacesAfterUnencodableSTD(const std::wstring &text, Ho
|
|||||||
}
|
}
|
||||||
std::wstring adjustSpacesSTD(const std::wstring &text, HookParam hp)
|
std::wstring adjustSpacesSTD(const std::wstring &text, HookParam hp)
|
||||||
{
|
{
|
||||||
|
if (hp.type & EMBED_INSERT_SPACE_ALWAYS)
|
||||||
switch (embedsharedmem->spaceadjustpolicy)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return text;
|
|
||||||
case 1:
|
|
||||||
return alwaysInsertSpacesSTD(text);
|
return alwaysInsertSpacesSTD(text);
|
||||||
case 2:
|
else if (hp.type & EMBED_INSERT_SPACE_AFTER_UNENCODABLE)
|
||||||
return insertSpacesAfterUnencodableSTD(text, hp);
|
return insertSpacesAfterUnencodableSTD(text, hp);
|
||||||
default:
|
return text;
|
||||||
return text;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
bool isPauseKeyPressed()
|
bool isPauseKeyPressed()
|
||||||
{
|
{
|
||||||
|
@ -227,7 +227,7 @@ namespace
|
|||||||
0x8b, 0xcf, // 0042cf31 8bcf mov ecx,edi
|
0x8b, 0xcf, // 0042cf31 8bcf mov ecx,edi
|
||||||
0x50, // 0042cf33 50 push eax
|
0x50, // 0042cf33 50 push eax
|
||||||
0xe8 // XX4 // 0042cf34 e8 e725f6ff call .0038f520
|
0xe8 // XX4 // 0042cf34 e8 e725f6ff call .0038f520
|
||||||
// hook here
|
// hook here
|
||||||
};
|
};
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -1786,7 +1786,7 @@ namespace
|
|||||||
// return Private::oldHookFun = (Private::hook_fun_t)winhook::replace_fun(addr, (ULONG)Private::newHookFun);
|
// return Private::oldHookFun = (Private::hook_fun_t)winhook::replace_fun(addr, (ULONG)Private::newHookFun);
|
||||||
HookParam hp;
|
HookParam hp;
|
||||||
hp.address = addr;
|
hp.address = addr;
|
||||||
hp.type = EMBED_ABLE | CODEC_UTF16; // 0x41
|
hp.type = EMBED_ABLE | CODEC_UTF16 | EMBED_INSERT_SPACE_AFTER_UNENCODABLE; // 0x41
|
||||||
hp.hook_before = Private::text_fun;
|
hp.hook_before = Private::text_fun;
|
||||||
hp.hook_after = Private::hookafter;
|
hp.hook_after = Private::hookafter;
|
||||||
hp.hook_font = F_GetGlyphOutlineW;
|
hp.hook_font = F_GetGlyphOutlineW;
|
||||||
@ -1878,7 +1878,7 @@ namespace OtherHook
|
|||||||
return false;
|
return false;
|
||||||
HookParam hp;
|
HookParam hp;
|
||||||
hp.address = addr;
|
hp.address = addr;
|
||||||
hp.type = EMBED_ABLE | CODEC_UTF16; // 0x41
|
hp.type = EMBED_ABLE | CODEC_UTF16 | EMBED_INSERT_SPACE_AFTER_UNENCODABLE; // 0x41
|
||||||
hp.hook_before = Private::hookBefore;
|
hp.hook_before = Private::hookBefore;
|
||||||
hp.hook_after = Private::hookafter2;
|
hp.hook_after = Private::hookafter2;
|
||||||
hp.hook_font = F_GetGlyphOutlineW;
|
hp.hook_font = F_GetGlyphOutlineW;
|
||||||
|
@ -102,7 +102,7 @@ C_LUNA_API void Luna_FindHooks(DWORD pid, SearchParam sp, findhookcallback_t fin
|
|||||||
wcscpy_s(hookcode,HOOKCODE_LEN, hp.hookcode);
|
wcscpy_s(hookcode,HOOKCODE_LEN, hp.hookcode);
|
||||||
findhookcallback(hookcode,text.c_str()); });
|
findhookcallback(hookcode,text.c_str()); });
|
||||||
}
|
}
|
||||||
C_LUNA_API void Luna_EmbedSettings(DWORD pid, UINT32 waittime, UINT8 fontCharSet, bool fontCharSetEnabled, wchar_t *fontFamily, UINT32 spaceadjustpolicy, UINT32 keeprawtext, bool fastskipignore)
|
C_LUNA_API void Luna_EmbedSettings(DWORD pid, UINT32 waittime, UINT8 fontCharSet, bool fontCharSetEnabled, wchar_t *fontFamily, UINT32 keeprawtext, bool fastskipignore)
|
||||||
{
|
{
|
||||||
auto sm = Host::GetEmbedSharedMem(pid);
|
auto sm = Host::GetEmbedSharedMem(pid);
|
||||||
if (!sm)
|
if (!sm)
|
||||||
@ -111,7 +111,6 @@ C_LUNA_API void Luna_EmbedSettings(DWORD pid, UINT32 waittime, UINT8 fontCharSet
|
|||||||
sm->fontCharSet = fontCharSet;
|
sm->fontCharSet = fontCharSet;
|
||||||
sm->fontCharSetEnabled = fontCharSetEnabled;
|
sm->fontCharSetEnabled = fontCharSetEnabled;
|
||||||
wcscpy_s(sm->fontFamily, 100, fontFamily);
|
wcscpy_s(sm->fontFamily, 100, fontFamily);
|
||||||
sm->spaceadjustpolicy = spaceadjustpolicy;
|
|
||||||
sm->keeprawtext = keeprawtext;
|
sm->keeprawtext = keeprawtext;
|
||||||
sm->fastskipignore = fastskipignore;
|
sm->fastskipignore = fastskipignore;
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,8 @@ enum HookParamType : uint64_t
|
|||||||
NEXT_MASK(EMBED_AFTER_NEW),
|
NEXT_MASK(EMBED_AFTER_NEW),
|
||||||
NEXT_MASK(EMBED_AFTER_OVERWRITE),
|
NEXT_MASK(EMBED_AFTER_OVERWRITE),
|
||||||
NEXT_MASK(EMBED_CODEC_UTF16),
|
NEXT_MASK(EMBED_CODEC_UTF16),
|
||||||
|
NEXT_MASK(EMBED_INSERT_SPACE_ALWAYS),
|
||||||
|
NEXT_MASK(EMBED_INSERT_SPACE_AFTER_UNENCODABLE),
|
||||||
|
|
||||||
DECLARE_VALUE(NORMAL_INLINEHOOK, 0),
|
DECLARE_VALUE(NORMAL_INLINEHOOK, 0),
|
||||||
NEXT_MASK(BREAK_POINT),
|
NEXT_MASK(BREAK_POINT),
|
||||||
|
@ -19,7 +19,6 @@ struct EmbedSharedMem
|
|||||||
uint64_t ctx1[10];
|
uint64_t ctx1[10];
|
||||||
uint64_t ctx2[10];
|
uint64_t ctx2[10];
|
||||||
UINT32 waittime;
|
UINT32 waittime;
|
||||||
UINT32 spaceadjustpolicy;
|
|
||||||
UINT32 keeprawtext;
|
UINT32 keeprawtext;
|
||||||
uint64_t hash;
|
uint64_t hash;
|
||||||
wchar_t text[1000];
|
wchar_t text[1000];
|
||||||
|
Loading…
Reference in New Issue
Block a user