Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injection via Injector fails while injecting via System Informer succeeds #28

Closed
4 tasks done
ProjectHSI opened this issue Jan 9, 2024 · 10 comments
Closed
4 tasks done
Labels

Comments

@ProjectHSI
Copy link
Contributor

ProjectHSI commented Jan 9, 2024

  • I have searched open and closed issues for duplicates
  • I am submitting a bug report for existing functionality that does not work as intended
  • I have read the project documentation and not found a solution to my problem there
  • This isn't a feature request or a discussion topic

Bug description

Recently while using a tool that depends on this project, I noticed that the DLL I was trying to use wasn't being injected. Using Injector directly results in the LoadLibraryW error that has been mentioned many-a times before, or the "Could not create thread in remote process." error if using the x86 version of Injector. However, using System Informer to inject the DLL worked.

Steps to reproduce

While I'm unsure of what exactly caused this problem I will try to provide as much detail as I can.

  • Acquire Alien: Isolation (If you haven't got it already)
  • Run Alien: Isolation
  • Download this DLL.
  • Attempt to inject the aforementioned DLL into AI.exe (note: Not ai.exe, this is case-sensitive) with the injector.
  • A runtime error is thrown.

Actual result: A runtime error is thrown with "Call to LoadLibraryW in remote process failed.". If running the x86 version of the injector, "Could not create thread in remote process." is thrown instead, probably as I'm running x64 Windows (though A:I is a 32-bit game).
Expected result: Cinematic Tools is loaded into Alien: Isolation. Result of that is a console window opening attached to the game and an ImGui window opening that looks like the window below.

Screenshots

Injector:
Screenshot 2024-01-09 152904

Expected Result:
Console:
Screenshot 2024-01-09 153733

ImGUI Window:
Screenshot 2024-01-09 153844

Machine info

CPU-Architecture: x64
Windows version: Windows 10 22H2, 19045.3803, Windows Feature Experience Pack 1000.19053.10000
Software/driver version(s): Injector: 1.3.0

Any other helpful information

System Informer's injection process starts here.

PHLib (part of System Informer that does injecting as well as other things not relevant here) is build-able by itself.
This may not align with the project and that's fine but PHLib could be imported (with modifications) and used during the injection.

@ProjectHSI
Copy link
Contributor Author

@nefarius (sorry if you already read this and have acknowledged the issue, there wasn't any communication from you on this issue or the issue this was mentioned in.

@nefarius
Copy link
Owner

I read everything, rest assured, and I have nothing to comment on. I neither know the cause nor how to fix, neither have the time anyway. So unless someone else chimes in, this will simply sit here and collect dust.

@nefarius nefarius added the bug label Jan 21, 2024
@bot-1450
Copy link
Contributor

Are you sure process name should go case-sensitive? We always ignore the case. Have you tried with process id?

ProcID = Injector::Get()->GetProcessIdByName(utf8_to_wstr(toLower(optArg)));

CurrentProcess = toLower(CurrentProcess);

@ProjectHSI
Copy link
Contributor Author

I'll try that, but it should in that case just not inject into the right process.

@ProjectHSI
Copy link
Contributor Author

Appears to fail with the same message.

@bot-1450
Copy link
Contributor

Cannot reproduce. Things go fine here.

Injector_x86_amd64_arm64\Win32>Injector.exe -n AI.exe -i CT_AlienIsolation.dll
Injector x86 [Version 20230813]
Copyright (c) 2009 Cypher, 2012-2023 Nefarius. All rights reserved.

Successfully injected module!

Commonly, The target process and referenced module should share the same bitness. Since both the process and module are x86, you should use Win32 version of Injector.

Please, double check permissions or other things. You may also step into the source and print GetLastError in order to figure out why.

@ProjectHSI
Copy link
Contributor Author

Cannot reproduce. Things go fine here.

Injector_x86_amd64_arm64\Win32>Injector.exe -n AI.exe -i CT_AlienIsolation.dll
Injector x86 [Version 20230813]
Copyright (c) 2009 Cypher, 2012-2023 Nefarius. All rights reserved.

Successfully injected module!

Commonly, The target process and referenced module should share the same bitness. Since both the process and module are x86, you should use Win32 version of Injector.

Please, double check permissions or other things. You may also step into the source and print GetLastError in order to figure out why.

I was using the x64 injector. Injecting with the Win32 version works fine (although ejecting the module doesn't seem to do anything. This could be a bug with the module though and not Injector.)

This does close this issue as user error and not a bug with Injector. The issue mentioned under OpenCAGE's issue tracker will be adjusted accordingly.

I might open a PR (or an issue) to have case-sensitivity as a toggle though, as I think it would help eliminate users not figuring out what to do.

Once again, this issue can be closed as user error.

@ProjectHSI ProjectHSI closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2024
@ProjectHSI
Copy link
Contributor Author

ProjectHSI commented Feb 18, 2024

The underlying confusion that lead to this can be fixed by merging #29.

@nefarius nefarius added invalid and removed bug labels Feb 18, 2024
@ProjectHSI
Copy link
Contributor Author

ProjectHSI commented Feb 19, 2024

Apparently I messed up when looking at how CinematicTools was injected when using OpenCAGE; the issue that I linked to this apparently wasn't related to this repo as OpenCAGE doesn't use Injector.

At least I cleared some confusion for people using this project, right? 🤷‍♂️

(Is there a phrase for this kind of mistake?)

@nefarius
Copy link
Owner

At least you confused me 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants