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

CRT Issue #1028

Open
abramann opened this issue May 7, 2024 · 1 comment
Open

CRT Issue #1028

abramann opened this issue May 7, 2024 · 1 comment

Comments

@abramann
Copy link

abramann commented May 7, 2024

I'm reversing hw.so starting from this project, sometimes, the execution crashes at ntdll after specific game DLL call or delete / free memory call, sometimes not seems there is an incompatibility between the loaded CRTs, like chromhtml.dll, which is VC 10, and most game DLLs are VC 6.0 while I am compiling VC 14.
Sometimes LoadLibrary crashes when load chromhtml.dll but if loaded at DllMain will never crash.

Static linking MT/MTd did not resolve the issue.

Is the only way to fix this by rebuilding with the same toolset?

Is there a rule for CRTs compatibility because game originally loads different CRTs.

@deprale
Copy link

deprale commented Jun 7, 2024

Sometimes LoadLibrary crashes when load chromhtml.dll but if loaded at DllMain will never crash.

so just do it at dllmain? why make an issue lol.

anyway this sounds like you're just not cleaning up before calling freelibrary func, you need to load chrom as a separate thread, then when u are unloading it - you need to use WaitForSingleObject, close the handle, and ONLY THEN use freelibrary (I am assuming chromhtml exports a function you can call that will unload itself).

edit: but if u insist doing it the other way, you can always have a separate thread, and when you want to load chromhtml you just pause ALL execution in MainThread, and in the separate thread u can load chromhtml.

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

No branches or pull requests

2 participants