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

View File

@ -3,9 +3,14 @@
class Elf:public ENGINE{ class Elf:public ENGINE{
public: public:
Elf(){ Elf(){
check_by=CHECK_BY::CUSTOM;
check_by=CHECK_BY::FILE_ALL; check_by_target=[](){
check_by_target=check_by_list{L"data.arc",L"effect.arc",L"mes.arc"}; //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 //Util::CheckFile(L"Silkys.exe") || // It might or might not have Silkys.exe
// data, effect, layer, mes, music // data, effect, layer, mes, music
}; };

View File

@ -221,10 +221,14 @@ DWORD FindImportEntry(DWORD hModule, DWORD fun)
#endif #endif
bool CheckFile(LPCWSTR name) bool CheckFile(LPCWSTR name)
{
return CheckFile_exits(name,false);
}
bool CheckFile_exits(LPCWSTR name,bool if_exits_also_ok)
{ {
WIN32_FIND_DATAW unused; WIN32_FIND_DATAW unused;
HANDLE file = FindFirstFileW(name, &unused); HANDLE file = FindFirstFileW(name, &unused);
if (file != INVALID_HANDLE_VALUE) if ((file != INVALID_HANDLE_VALUE)||(if_exits_also_ok &&PathFileExists(name)))
{ {
FindClose(file); FindClose(file);
return true; return true;
@ -234,7 +238,7 @@ bool CheckFile(LPCWSTR name)
while (*(--end) != L'\\'); while (*(--end) != L'\\');
wcscpy_s(end + 1, MAX_PATH, name); wcscpy_s(end + 1, MAX_PATH, name);
file = FindFirstFileW(path, &unused); file = FindFirstFileW(path, &unused);
if (file != INVALID_HANDLE_VALUE) if ((file != INVALID_HANDLE_VALUE)||(if_exits_also_ok &&PathFileExists(path)))
{ {
FindClose(file); FindClose(file);
return true; return true;

View File

@ -33,6 +33,7 @@ DWORD FindCallAndEntryRel(DWORD fun, DWORD size, DWORD pt, DWORD sig);
DWORD FindImportEntry(DWORD hModule, DWORD fun); DWORD FindImportEntry(DWORD hModule, DWORD fun);
#endif #endif
bool CheckFile_exits(LPCWSTR name, bool if_exits_also_ok);
bool CheckFile(LPCWSTR name); bool CheckFile(LPCWSTR name);
bool SearchResourceString(LPCWSTR str); bool SearchResourceString(LPCWSTR str);