Improved Launcher startup

This commit is contained in:
Anonymous275
2020-11-05 22:44:43 +02:00
parent ad91c65b55
commit 82870a23ac
31 changed files with 37 additions and 7844 deletions

View File

@@ -41,7 +41,7 @@ void SteamExit(int code){
exit(4);
}
std::string GetGameDir(){
if(TraceBack != 3)Exit(0);
if(TraceBack != 4)Exit(0);
return GameDir.substr(0,GameDir.find_last_of('\\'));
}
LONG OpenKey(HKEY root,const char* path,PHKEY hKey){

View File

@@ -10,6 +10,7 @@
#include <fstream>
#include <Psapi.h>
void DAS(){
#ifndef DEBUG
int i = 0;
std::ifstream f(GetEN(), std::ios::binary);
f.seekg(0, std::ios_base::end);
@@ -20,18 +21,7 @@ void DAS(){
}
if(i)DAboard();
f.close();
}
void DASM(){ //A mirror to have 2 independent checks
int i = 0;
std::ifstream f(GetEN(), std::ios::binary);
f.seekg(0, std::ios_base::end);
std::streampos fileSize = f.tellg();
if(IsDebuggerPresent() || fileSize > 0x3D0900){
i++;
DAboard();
}
if(i)DAboard();
f.close();
#endif
}
DWORD getParentPID(DWORD pid){
HANDLE h = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
@@ -87,6 +77,6 @@ void UnderSimulation(char* argv[]){
//exit(1); //TODO look into that later
}
void SecurityCheck(char* argv[]){
UnderSimulation(argv);
//UnderSimulation(argv);
DAS();
}