mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-27 07:44:02 +08:00
exits
This commit is contained in:
parent
02119e9c7e
commit
64258ad5cc
@ -334,6 +334,7 @@ namespace{
|
||||
//flutter of birds~鳥達の羽ばたき~
|
||||
//https://vndb.org/v2379
|
||||
//需要注意的是,不能把文本跳到最快,不然2~4行无法显示。
|
||||
//这个有一大堆候选
|
||||
bool elf3(){
|
||||
bool succ=false;
|
||||
BYTE sig[]={
|
||||
|
@ -3,9 +3,14 @@
|
||||
class Elf:public ENGINE{
|
||||
public:
|
||||
Elf(){
|
||||
|
||||
check_by=CHECK_BY::FILE_ALL;
|
||||
check_by_target=check_by_list{L"data.arc",L"effect.arc",L"mes.arc"};
|
||||
check_by=CHECK_BY::CUSTOM;
|
||||
check_by_target=[](){
|
||||
//flutter of birds~鳥達の羽ばたき~
|
||||
//https://vndb.org/v2379
|
||||
//很奇怪,FindFirstFileW在win7上true,在win11上false,但PathFileExists在两者都是true
|
||||
auto paks={L"data.arc",L"effect.arc",L"mes.arc"};
|
||||
return std::all_of(paks.begin(),paks.end(),[](auto f){return Util::CheckFile_exits(f,true);}) ;
|
||||
};
|
||||
//Util::CheckFile(L"Silkys.exe") || // It might or might not have Silkys.exe
|
||||
// data, effect, layer, mes, music
|
||||
};
|
||||
|
@ -221,10 +221,14 @@ DWORD FindImportEntry(DWORD hModule, DWORD fun)
|
||||
#endif
|
||||
|
||||
bool CheckFile(LPCWSTR name)
|
||||
{
|
||||
return CheckFile_exits(name,false);
|
||||
}
|
||||
bool CheckFile_exits(LPCWSTR name,bool if_exits_also_ok)
|
||||
{
|
||||
WIN32_FIND_DATAW unused;
|
||||
HANDLE file = FindFirstFileW(name, &unused);
|
||||
if (file != INVALID_HANDLE_VALUE)
|
||||
if ((file != INVALID_HANDLE_VALUE)||(if_exits_also_ok &&PathFileExists(name)))
|
||||
{
|
||||
FindClose(file);
|
||||
return true;
|
||||
@ -234,7 +238,7 @@ bool CheckFile(LPCWSTR name)
|
||||
while (*(--end) != L'\\');
|
||||
wcscpy_s(end + 1, MAX_PATH, name);
|
||||
file = FindFirstFileW(path, &unused);
|
||||
if (file != INVALID_HANDLE_VALUE)
|
||||
if ((file != INVALID_HANDLE_VALUE)||(if_exits_also_ok &&PathFileExists(path)))
|
||||
{
|
||||
FindClose(file);
|
||||
return true;
|
||||
|
@ -33,6 +33,7 @@ DWORD FindCallAndEntryRel(DWORD fun, DWORD size, DWORD pt, DWORD sig);
|
||||
DWORD FindImportEntry(DWORD hModule, DWORD fun);
|
||||
#endif
|
||||
|
||||
bool CheckFile_exits(LPCWSTR name, bool if_exits_also_ok);
|
||||
bool CheckFile(LPCWSTR name);
|
||||
|
||||
bool SearchResourceString(LPCWSTR str);
|
||||
|
Loading…
Reference in New Issue
Block a user