This would help to block all bugs.
Just use Lord for embed it to exe.
(Visual Studio +10)
!!! Dont forget to include dirent.h !!!
PHP Code:
int getdir (string dir, vector<string> &files)
{
DIR *dp;
struct dirent *dirp;
if((dp = opendir(dir.c_str())) == NULL) {
MessageBoxA(0, "Error" , "Error", MB_OK|MB_ICONERROR);
return errno;
}
while ((dirp = readdir(dp)) != NULL) {
files.push_back(string(dirp->d_name));
}
closedir(dp);
return 0;
}
void Test()
{
string dir = string(".");
vector<string> files = vector<string>();
getdir(dir,files);
for (unsigned int i = 0;i < files.size();i++) {
string a = files[i];
size_t found,found2,found3,found4;
// different member versions of find in the same order as above:
found=a.find("mix");
found2=a.find("m3d");
found3=a.find("flt");
found4=a.find("asi");
if (found!=string::npos)
ExitProcess(0);
else if(found2!=string::npos)
ExitProcess(0);
else if (found3!=string::npos)
ExitProcess(0);
else if(found4!=string::npos)
ExitProcess(0);
}
}
PHP Code:
void ControlSize(){
FILE *p_file = NULL;
p_file = fopen("MSS32.DLL","rb");
fseek(p_file,0,SEEK_END);
int size = ftell(p_file);
if(size != 129024)
ExitProcess(0);
fclose(p_file);
}
PHP Code:
extern "C" __declspec( dllexport ) bool __cdecl Start( ){ControlSize(); Test(); return true;}
PHP Code:
::DisableThreadLibraryCalls( hInstance );
::CreateThread( 0, 0, reinterpret_cast<LPTHREAD_START_ROUTINE>( Start), 0, 0, 0 );






