Skip to content

Commit

Permalink
Fixed issue #2 (process or window names with spaces not being process…
Browse files Browse the repository at this point in the history
…ed properly)
  • Loading branch information
nefarius committed Aug 19, 2019
1 parent 78b4907 commit bf3d128
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Injector/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ int main(int, char* argv[])
SehGuard Guard;

// Injector version number
const std::tstring VerNum(_T("20180821"));
const std::tstring VerNum(_T("20190819"));

// Version and copyright output
#ifdef _WIN64
std::tcout << _T("Injector x64 [Version ") << VerNum << _T("]") << std::endl;
#else
std::tcout << _T("Injector x86 [Version ") << VerNum << _T("]") << std::endl;
#endif
std::tcout << _T("Copyright (c) 2009 Cypher, 2012-2018 Nefarius. All rights reserved.") << std::endl << std::endl;
std::tcout << _T("Copyright (c) 2009 Cypher, 2012-2019 Nefarius. All rights reserved.") << std::endl << std::endl;

argh::parser cmdl;

Expand Down Expand Up @@ -104,15 +104,17 @@ int main(int, char* argv[])
std::string optArg;

// Find and inject via process name
if ((cmdl({ "-n", "--process-name" }) >> optArg))
if (cmdl({ "-n", "--process-name" }))
{
optArg = cmdl({ "-n", "--process-name" }).str();
// Attempt injection via process name
ProcID = Injector::Get()->GetProcessIdByName(utf8_to_wstr(toLower(optArg)));
}

// Find and inject via window name
if ((cmdl({ "-w", "--window-name" }) >> optArg))
if (cmdl({ "-w", "--window-name" }))
{
optArg = cmdl({ "-w", "--window-name" }).str();
// Attempt injection via window name
ProcID = Injector::Get()->GetProcessIdByWindow(utf8_to_wstr(optArg));
}
Expand Down

0 comments on commit bf3d128

Please sign in to comment.