Skip to content

Commit

Permalink
This should be the first operation
Browse files Browse the repository at this point in the history
  • Loading branch information
Segfaultd committed Sep 23, 2023
1 parent 8ca9c4a commit 8dfdad3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/framework/src/launcher/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,16 +599,16 @@ namespace Framework::Launcher {
return false;
}

std::replace(_gamePath.begin(), _gamePath.end(), '/', '\\');
gImagePath = _gamePath.c_str();
gDllName = _config.destinationDllName.c_str();

HANDLE hFile = CreateFileW(_gamePath.c_str(), GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile == INVALID_HANDLE_VALUE) {
MessageBox(nullptr, "Failed to find executable image", _config.name.c_str(), MB_ICONERROR);
return false;
}

std::replace(_gamePath.begin(), _gamePath.end(), '/', '\\');
gImagePath = _gamePath.c_str();
gDllName = _config.destinationDllName.c_str();

// determine file length
DWORD dwFileLength = SetFilePointer(hFile, 0, nullptr, FILE_END);
if (dwFileLength == INVALID_SET_FILE_POINTER) {
Expand Down

0 comments on commit 8dfdad3

Please sign in to comment.