Tool to find error codes for failed LoadLibrary calls Created 5 years ago2019-01-09 12:13:17 UTC by Solokiller Solokiller

Created 5 years ago2019-01-09 12:13:17 UTC by Solokiller Solokiller

Posted 5 years ago2019-01-09 12:13:17 UTC Post #341602
I made a small tool to find the error code returned by LoadLibrary calls. This is needed because the engine doesn't report the error code for failed client.dll library loading.

Repository here: https://github.com/SamVanheer/NativeDllTester
Download: https://github.com/SamVanheer/NativeDllTester/releases/tag/V1.0

See the README for usage.

The issue that made this tool necessary: https://github.com/ValveSoftware/halflife/issues/2086

I also included additional information for finding missing dependencies using other tools, since the error code won't tell you which dependencies are missing.
I used Process Monitor to find it by looking for library load attempts after the client dll is loaded, this is what the relevant information looks like:
User posted image
The missing library is a debug version of a VS2017 redistributable library that contains the C runtime. The redistributable only contains the release version, and the client.dll was a debug build. Recompiling it as a release build solved the problem. If you have VS2017 with C++ support installed it will have installed this debug version so you would be able to run it regardless.

This should make debugging could not load library <name> errors much easier.
Posted 5 years ago2019-01-10 05:00:23 UTC Post #341610
It's a shame that dependencies are so hard.

I guess statically linking to the Visual C++ runtime is okay solution for most use cases? I assume that's what this error is most of the time.
Posted 5 years ago2019-01-10 11:53:05 UTC Post #341613
It might, i'm not sure.
Posted 5 years ago2019-01-28 04:42:30 UTC Post #341870
Just checked and it looks like static linking the Visual C++ runtime already happens by default for client.dll (or at least it does in my mod that I updated from the Visual C++ 6 project files).
Posted 5 years ago2019-01-28 23:57:05 UTC Post #341878
Is it possible to upload the compiled binary for testing?
Posted 5 years ago2019-01-29 11:58:30 UTC Post #341881
No, it's just a program you run locally.
Posted 5 years ago2019-02-01 23:23:47 UTC Post #341916
I dug through my client.dll and I suspect that steam_api.dll may be the culprit. It's there but possibly DllMain returns false for pirated copies which causes LoadLibrary to fail.
Posted 5 years ago2019-02-02 14:41:01 UTC Post #341923
2 Solokiller
Your download link is not a program but only source code. I asked you to upload the compiled program.
Posted 5 years ago2019-02-02 15:03:09 UTC Post #341924
https://github.com/SamVanheer/NativeDllTester/releases/tag/V1.0

Apparently Github didn't like the previous exe upload, so i reuploaded it.
Posted 5 years ago2019-02-04 14:16:41 UTC Post #341956
Thanks, but it doesn't work in WinXP :(
Posted 5 years ago2019-02-04 15:20:48 UTC Post #341958
You really shouldn't be using Windows XP anyway. It's an insecure, outdated, unsupported system that makes your computer an easy target for people who run botnets that threaten everyone.
Oskar Potatis Oskar Potatis🦔
Posted 5 years ago2019-02-04 18:51:14 UTC Post #341959
i dont see how win xp is any less secure than any other os. 99% of computers use pirated oses which can have any kind of malware, i would guess newer stuff is more targeted than old stuff
Posted 5 years ago2019-02-04 19:13:13 UTC Post #341960
I am still running XP and never have had any virus warnings... You must only have to keep you antivirus updated and never visit "extrange" or suspicious web sites. The same Win XP SP3 since 2009 without being reinstalled!! XD
Posted 5 years ago2019-02-05 01:18:00 UTC Post #341966
99% of computers use pirated oses
Certianly not true. The vast, vast majority of computers are factory-made and come pre-installed with a legal copy of Windows. If you don't want to buy, sure, I understand. Doesn't mean it's better to use old outdated software than modern pirated software that receives security updates and has a more secure architecture. Rather something that may possibly be compromised from the start than something that's guaranteed to be open to infection.
i dont see how win xp is any less secure than any other os
Microsoft has stopped releasing security updates. So the difference is, when an exploit is discovered for Windows 10, an update is released and the system is made secure within days. When an exploit for Windows XP is discovered, nobody gives a fuck, because nobody is supposed to be using a 17-years-old version of Windows anyway.
I am still running XP and never have had any virus warnings...
Having viruses and getting virus warnings are entirely different things. Viruses can go undetected and some viruses alter anti-virus software.
You must only have to keep you antivirus updated and never visit "extrange" or suspicious web sites.
Or browse the web (perhaps to pirate software or watch that weird porn you probably love). Or play games online. Or plug in a USB stick. Microsoft isn't releasing patches against Spectre, Meltdown or any of the other attacks that don't require you to do anything weird. Windows XP is abandoned.

If you don't want to use Windows 10, get a Linux OS or OS X or FreeBSD. You may already be part of a botnet without knowing, and contribute to attacks against innocent websites, companies, organizations, government agencies and even small countries. Update your software, folks.
Oskar Potatis Oskar Potatis🦔
Posted 5 years ago2019-02-05 09:40:28 UTC Post #341969
I am still running XP and never have had any virus warnings... You must only have to keep you antivirus updated and never visit "extrange" or suspicious web sites. The same Win XP SP3 since 2009 without being reinstalled!! XD
Anti virus software can't protect against exploits in the OS itself. You're essentially claiming that closing the door and leaving it unlocked is enough to stop burglars. You can be compromised and not know it.
Posted 5 years ago2019-02-05 14:47:18 UTC Post #341970
I'm still pretty much running Windows XP SP3 on two PCs, albeit I turn them on rarely. We'll see what will happen in 5-10 years. :)
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 years ago2019-02-05 16:37:29 UTC Post #341971
Do you guys know, that 2019 is the last year of Win7 support? Does this make Win7 bad OS too? It's just a trick too force you buy new PC & new OS, and in this Microsoft much more worse, than potential risk of viruses. MS doesn't care about old OS not because they're incorrigibly bad, but because MS need your money. New OS & security updates mean for them a way to have a monopolistic access for the methods of collecting you personal information and such. Why they would give those rights to hackers, lol. What about me, I don't understand why new OS must eat a lot of your HDD space and other resourses to be good. That's why I like XP, though 10 has some advantages too.
Posted 5 years ago2019-02-05 16:49:15 UTC Post #341972
https://www.zdnet.com/article/microsoft-to-offer-paid-windows-7-extended-security-updates/

MS will support 7 up to 2023 to patch security issues. By that point you should upgrade to a newer OS so you don't end up with problems.

You can't expect them to support a nearly 2 decade old OS forever. You can't expect application developers to do the same either. With support for XP going away in an upcoming version of Visual Studio we'll have to choose whether we want to continue targeting XP or having access to newer C++ language features.
In C#'s case the newest versions are already unsupported on older systems: https://docs.microsoft.com/en-us/dotnet/framework/get-started/system-requirements

If you honestly think that XP is secure then i hope for your sake that you're right.
Posted 5 years ago2019-02-06 06:20:56 UTC Post #341980
I don't think i am 200% secure, I am only saying that I don't take risks, and keep my system in good shape thank to a proper maintenance.
You must be logged in to post a response.