Skip to content

Commit

Permalink
Bug fix in process arch
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed May 29, 2021
1 parent 419f284 commit ace73fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions oloJector/Injector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ void Injector::setDll()

void Injector::loadProcess()
{
char processName[128];

std::cout << "Target PID ? : ";
std::cin >> m_pid;
m_process = OpenProcess(PROCESS_ALL_ACCESS, false, m_pid);
Expand All @@ -34,9 +32,9 @@ void Injector::inject()
ProcessInfo pinfo(m_pid);
pinfo.setis64();

if (!pinfo.getis64() ^ m_dll->getArch())
if (pinfo.getis64() ^ m_dll->getArch())
{
std::cout << "Architecture mismatch : Process : " << !pinfo.getis64() << " dll : " << m_dll->getArch();
std::cout << "Architecture mismatch : Process : " << pinfo.getis64() << " | dll : " << m_dll->getArch();
exit(1);
}

Expand Down
6 changes: 2 additions & 4 deletions oloJector/ProcessInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ void ProcessInfo::printInfo()
void ProcessInfo::printInfo(bool is64)
{
TCHAR arch[4];
if (m_is64) // Probably lucky that this this working
_tcscpy_s(arch, 4, TEXT("x86"));
else if (is64)
if (m_is64)
_tcscpy_s(arch, 4, TEXT("x64"));
else
_tcscpy_s(arch, 4, TEXT("x86"));
Expand Down Expand Up @@ -90,7 +88,7 @@ void ProcessInfo::setis64()

}
}
m_is64 = bIsWow64;
m_is64 = !bIsWow64;
}
CloseHandle(processHandle);
}

0 comments on commit ace73fe

Please sign in to comment.