Allow launching the injector from a different directory
This commit is contained in:
parent
f965bb79a3
commit
435f1b0355
@ -30,6 +30,15 @@ int main(int argc, char **argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// cd into the injector directory
|
||||
char injectorPath[MAX_PATH];
|
||||
GetModuleFileNameA(GetModuleHandleA(NULL), injectorPath, sizeof(injectorPath));
|
||||
|
||||
char *lastSep = strrchr(injectorPath, '\\');
|
||||
*lastSep = '\0';
|
||||
|
||||
SetCurrentDirectoryA(injectorPath);
|
||||
|
||||
// Compute absolute paths
|
||||
char gameExePath[MAX_PATH];
|
||||
GetFullPathNameA(gamePath, sizeof(gameExePath), gameExePath, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user