This commit is contained in:
恍兮惚兮 2024-07-10 23:14:37 +08:00
parent 02119e9c7e
commit 64258ad5cc
4 changed files with 16 additions and 5 deletions

View File

@ -334,6 +334,7 @@ namespace{
//flutter of birds鳥達の羽ばたき
//https://vndb.org/v2379
//需要注意的是不能把文本跳到最快不然2~4行无法显示。
//这个有一大堆候选
bool elf3(){
bool succ=false;
BYTE sig[]={

View File

@ -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
};

View File

@ -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;

View File

@ -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);