I created my own DLL which does exporting. Now I wanna do imports, I want to load the same function from another import function DLL (ex. user32.dll). I tried to do LoadLibrary, it does load the DLL but nothing is being imported in my DLL.
Basically I want to see my DLL IAT has user32.dll with all the functions in the IAT.
First, I am assuming that IAT stands for Import Address Table? If not then skip the rest of this post.
You're going about this wrong. What you would do in this case is write your executable to mediate communication between the two DLL's. You do this with Function Pointers and Call Backs, not by mergeing two tables and hoping for they work. Now, if what you're trying to do is make sure that a call to a function normally in user32.dll actually gets processed by your Lib, then that's a different story.
User32.lib does indeed come with the Windows SDK, I'm looking at it right now in fact. But if you are using another compiler then you'll want to use the lib that came with that one instead. For example, I use MingW so I would use the file "libuser32.a" in order to access the functions in that DLL.
If I look under PEview, it does not show any IAT(import address table) in my dll. How do I load my IAT into my dll from the functions of user32.dll? Without writing an exe, this has to be done in the dll.
I did go under properties -> linker->input->additional dependencies , add the user32.lib but I see nothing any IAT in my dll.
I don't understand the SOURCE of the problem.
When you will need to call AnyPopup from your Exe (the one that you want to call AnyPopup from your DLL right at the moment), you will need to declare it first right? For that, you will have to include the system header file in which it is declared, and then you will just need to link user32.lib in the Exe and that's it.
Are you for some reason forbidden to include user32.lib directly in the Exe, but in the need to use one of it's functions?
Also, when you include that header for the declaration of AnyPopup in your DLL, the symbol of AnyPopup is declared as imported in your DLL. FOr it to be visible in the export table of your DLL, it would have to be declared as exported.
Yes, I am forbidden to do anything in the exe. This all has to be done in my DLL. AnyPopup is just a short example, but I do have to use all the functions in user32.dll.
All the imports and exports has to be done in my DLL.
Yes, it hooking user32.dll(exports) to my DLL(imports), but I am not modifying any functions. I am just trying to get all the export functions in user32.dll into my import address table (IAT) in my DLL.