 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
HSergi Newbie cheater
Reputation: 0
Joined: 17 Dec 2017 Posts: 22
|
Posted: Fri Apr 08, 2022 4:17 pm Post subject: Visual Studio LNK1104 after attaching Cheat Engine Debugger |
|
|
Have to close Cheat Engine in order to build the solution after I attach Cheat Engine's debugger to the target process. Getting this error in Visual Studio:
| Quote: | Error LNK1104 cannot open file 'D:\Projects\Desktop\Trainers\**\Debug\overlay.dll' overlay D:\Projects\Desktop\Trainers\**\cmake-build-vs\LINK 1
|
Steps to reproduce:
1. Compile the .dll.
2. Inject the .dll into the target process.
3. Open target process in Cheat Engine.
4. Put a read, write or execute breakpoint anywhere.
5. Uninject .dll from the target process.
5. Edit code in Visual Studio in order to trigger the actual compilation process of the .dll file and .pdb file.
6. Try to build the solution in Visual Studio and get the LNK1104.
After step 5 Cheat Engine will still hold the .pdb file and the .dll file, and won't allow to write to them. And I'd say that it shouldn't, even if the debugger is still attached.
Even opening another process in Cheat Engine doesn't fix this problem, assuming that it should unattach the debugger from the current process. Only closing the Cheat Engine fixes this problem.
This only happens in Cheat Engine. The solution happily builds when I attach IDA's default Local Windows Debugger and do exactly the same steps as described above with IDA.
Looks like Cheat Engine locks the injected .dll file and the respective .pdb file.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25858 Location: The netherlands
|
Posted: Fri Apr 08, 2022 8:05 pm Post subject: |
|
|
CE 7.4 ? Because that will release the pdb on switching process or when the process terminates (after a minute or so)
and check your AV, it may be too interested in inspecting what CE touches
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
HSergi Newbie cheater
Reputation: 0
Joined: 17 Dec 2017 Posts: 22
|
Posted: Fri Apr 29, 2022 5:49 am Post subject: |
|
|
Sorry for the late reply.
| Dark Byte wrote: | | CE 7.4 ? |
Yes.
And, apparently, I don't even have to attach a debugger. Here are new steps to reproduce:
• Compile .dll.
• Inject into the process. I use LoadLibraryExW function.
• Open CE 7.4
• Open process in Cheat Engine.
• Uninject .dll. I uninject from inside of the library code using a FreeLibraryAndExitThread function.
• Change some code to trigger full compilation process.
• Try to compile the .dll in Visual Studio.
• Get the error:
If I attach CE to another process, I can compile the .dll successfully, so it's 100% CE that's blocking the .pdb. And, again, doesn't happen with IDA.
| Dark Byte wrote: | | and check your AV, it may be too interested in inspecting what CE touches |
I don't have any antiviruses, I have all of them removed, including the Windows Defender. Even the UAC is disabled.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25858 Location: The netherlands
|
Posted: Fri Apr 29, 2022 7:49 am Post subject: |
|
|
so when you attach CE to another process it'll work. That is by design. The symbol handler keeps the pdb until either the process terminates or when CE is attached to newprocess.
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
HSergi Newbie cheater
Reputation: 0
Joined: 17 Dec 2017 Posts: 22
|
Posted: Sat Apr 30, 2022 4:52 am Post subject: |
|
|
| Dark Byte wrote: | | so when you attach CE to another process it'll work. That is by design. The symbol handler keeps the pdb until either the process terminates or when CE is attached to newprocess. |
And it's really intrusive into the reversing and development workflow. I enable speedhack, enable some scripts, go frame by frame in the game, observe what's happening in the memory, make assumptions, code based on my assumptions, compile the dll, inject the dll, and continue however is needed.
The problem is that when I compile the dll, Cheat Engine disturbs the process by locking the file and making me unable to compile the dll unless I open another process in Cheat Engine. Now I need to disable any scripts I have had enabled in CE, switch to another process, so CE releases the handle to the .pdb file, switch back to my process of interest, enable speedhack back, enable scripts. That's like a whole minute of work just so I can compile my .dll. And a minute might not sound like much but when I do it 10 times in an hour and I work for 6 hours, it stacks to a pretty big number.
I think it would make perfect sense to do the way IDA does it: when the .dll is loaded, symbols are loaded. When the .dll is released, symbols are deleted(from the application, .pdb is never touched). And locking .pdb file at any point in time seems unnecessary at all: you just read it when .dll is loaded and that's it, why lock it?
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|