Archived

This topic is now archived and is closed to further replies.

after LoadLibrary GetLastError returns 0x0b

This topic is 4985 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I copy the kernel32.dll to hx.dll,and then HINSTANCE hInst = LoadLibrary("hx.dll"); DWORD dwError = GetLastError(); in win98,hInst is 0,and dwError is 0x0b; but in win2000,hInst is a valid Handle,and dwError is 0; how can I get the result in win2000 under win98? (you may ask me why not load kernel32.dll itself.because I''m forced to do this--the kernel32.dll may have been hacked in memory)

Share this post


Link to post
Share on other sites
The Error Lookup utility reports:
"An attempt was made to load a program with an incorrect format."

I''m not sure you can just blithely dynamic load kernel32.dll. Why are you worried if it was hacked? Surely if someone has a hacked kernel32.dll then they could go so far as to hack the executable or hx.dll. All I''m saying is that if this is a protection mechanism then it doesn''t seem worthwhile to me.

Share this post


Link to post
Share on other sites
quote:
Original post by VolkerG
Do you use the same kernel.dll under both OSes?

I copy kernel32.dll from system directory in every executing.

Share this post


Link to post
Share on other sites
quote:
Original post by antareus
The Error Lookup utility reports:
"An attempt was made to load a program with an incorrect format."

I''m not sure you can just blithely dynamic load kernel32.dll. Why are you worried if it was hacked? Surely if someone has a hacked kernel32.dll then they could go so far as to hack the executable or hx.dll. All I''m saying is that if this is a protection mechanism then it doesn''t seem worthwhile to me.


I''m now working with a game project,and there is a time axis in it,and the time axis call QueryPerformanceFrequency & QueryPerformanceCounter to get time.and there is a software which can hook the 2 api and return bigger or smaller value,I''d like to anti this...thanks,any idea is appreciated.

Share this post


Link to post
Share on other sites
every now and then compare the values with some other timers. if they are too big, disonnect or shut down or whatever. don''t copy kernel32.dll, if the hacker wants it he will just hack that. not to mention, its going to be different for each OS.

Share this post


Link to post
Share on other sites