Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
asd9176506911298 committed Jun 16, 2022
1 parent 0cbc6a2 commit 2aa8972
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,15 @@ BOOL __stdcall hCreateProcessA(LPCSTR lpApplicationName,
LPSTARTUPINFOA lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation)
{
//Get Game Path
std::string path = std::string(lpCommandLine);

//command line add -windowed
path.append("-window");

char* WindowedCommandLine = &path[0];


//return -window commandline
return oCreateProcessA(lpApplicationName,
WindowedCommandLine,
lpProcessAttributes,
Expand All @@ -162,14 +165,20 @@ DWORD WINAPI HackThread(HMODULE hModule)
FILE* f;
freopen_s(&f, "CONOUT$", "w", stdout);
#endif
//Get Config if true set Windowed
//Get Config if true set Windowed mode
std::string isWindowed;
std::ifstream WindowedConfigFile("WindowedConfig.txt");
getline(WindowedConfigFile, isWindowed);
//to Lowercase
std::transform(isWindowed.begin(), isWindowed.end(), isWindowed.begin(), ::tolower);

#ifdef _DEBUG
std::cout << isWindowed << std::endl;
#endif

if(isWindowed.compare("true") == 0)
{
//Hook
oCreateProcessA = (tCreateProcessA)GetProcAddress(GetModuleHandle("KernelBase.dll"), "CreateProcessA");
oCreateProcessA = (tCreateProcessA)mem::TrampHook32((BYTE*)oCreateProcessA, (BYTE*)hCreateProcessA, 5);
}
Expand Down

0 comments on commit 2aa8972

Please sign in to comment.