JustasMasiulis / lazy_importer

library for importing functions from dlls in a hidden, reverse engineer unfriendly way
Apache License 2.0
1.65k stars 222 forks source link

Improvement at compile time #2

Closed Mecanik closed 5 years ago

Mecanik commented 6 years ago

A nice improvement idea, upon compile time the library could do some extra work and check if function exists in specific dll, if not stop compile. This would prevent crash upon runtime if function does not exist.

Because this would cause some extra time/work when compiling, we could have a list of "common" functions exported in "common" dll's like kernel32.dll, ntdll.dll, etc.

What do you think ?

JustasMasiulis commented 6 years ago

you'd have to hardcode all the functions you plan to use for this to work. The checks at compile time are extremely limited.

If it interests you it is of course possible to not crash when looking for functions which do not exist, but I have removed that a long time ago because in 99% of the cases that would be a bug / not checked by dev either way and still cause crash.

Mecanik commented 6 years ago

Yes indeed, I see your point. However... an option for this would be nice to have, just in case. I seen edited windows editions that were missing many legit functions...

JustasMasiulis commented 5 years ago

Feature to not crash on function lookup failure was added some time ago in 2.0, compile time improvements are not really feasible. Gonna close the issue now.