Re: How to get imagebase after a DLL gets loaded



"anton bassov" <soviet_bloke@xxxxxxxxxxx> wrote in message
news:1165040770.676528.296720@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
If you know DLL's name, it is better just to call GetModuleHandle() -
in terms of overhead,

Hardcoding the DLL's name is a far too brittle option for me.

this is much less expensive call, ...

Premature optimization is the root of much evil.

As I said, I do that where I put up a dialog in a function exported from a
DLL. I an afford the call into the kernel.

In fact, if you don't mind a bit of "hacking",

I do mind.

you can obtain all info about user-mode modules from the
PEB yourself - this is how Toolhelp32 obtains info about modules

You never cease to disappoint. First you criticize my use of a documented
function in a totally legitimate way raising some specious argument about
performance. And then you propose an alternative that involves your favored
appriach to software development - the slimy hack.

Regards,
Will


.



Relevant Pages

  • Optimized quoting (was Re: Speed?)
    ... If Knuth is God, ... "Premature optimization is the root of all evil in programming." ...
    (comp.lang.python)
  • Re: assembly optimization.?
    ... all evil " Knuth. ... Actually, Sir Tony Hoare said it, Knuth simply repeated it often enough ... premature optimization is the root of all evil." ...
    (alt.lang.asm)
  • Re: Is a "real" C-Python possible?
    ... Donald Knuth, one of the fathers of modern computer science, is famous ... "Premature optimization is the root of all evil in programming." ...
    (comp.lang.python)
  • Re: Fork or threads
    ... Premature optimization is the root of all evil. ... Create code first that is simple to write and natural to read. ...
    (comp.unix.programmer)
  • Re: fake PC supplies
    ... >> The quote makes more sense when it's complete. ... For the love of money is the root of all evil ...
    (sci.electronics.design)