Questions tagged [getprocaddress]

GetProcAddress is a function in the Windows API for getting addresses of functions in dynamically loaded libraries

106 questions
0
votes
1 answer

How to find a user32.dll function address from an x64 process within an x86 process?

How to find a user32.dll function address from an x64 process within an x86 process? Edit: i mean my program runs x64, and i searching an x86 address.
DxCK
  • 4,402
  • 7
  • 50
  • 89
0
votes
0 answers

How do I call a external c function and import it using af function with a c-style calling convention?

I'm importing a function in a console application from an external .dll the function copies a struct out of shared memory (if you want to test it then any global memory should work) Here is the function in the dll struct DataMemBuff { double…
Voltage Spike
  • 162
  • 4
  • 15
0
votes
2 answers

GetProcAddress fails on Win 7 even though the DLL actually exports the function (works on Win 10)

I have a 32-bit application and I have a problem with it on Windows 7 x64. I'm loading a DLL. LoadLibraryW succeeds and the subsequent call to GetProcAddress fails with the error code 127 ("procedure not found" or something like that). The funny…
Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335
0
votes
3 answers

How can I "start" a DLL like an executable at runtime?

I want to write a very, very small program that parses the launch arguments and chooses one of several DLLs to "boot into." I've already written an application that I'd like to "run" as a DLL by writing it as an application, then changing the Visual…
Roderick
  • 2,383
  • 3
  • 20
  • 33
0
votes
1 answer

Java JNA: GetProcAddress returns null

The following code fails to find LoadLibraryW private static FOREIGN_THREAD_START_ROUTINE getLoadLibraryWAddress() throws Win32Exception { HMODULE module = Kernel32.INSTANCE.GetModuleHandle("KERNEL32"); if(module == null) { …
Ethon
  • 93
  • 2
  • 12
0
votes
0 answers

GetProcAddress returns null value

I have this method exported from within a c++ project #define EXTERN extern "C" #define DLL_EXPORT __declspec(dllexport) EXTERN DLL_EXPORT unsigned int BattleManager::ProcessBattleInEntityProcess() { .... } Using dumpbin i get the following…
0
votes
1 answer

C++ GetProcAddress not working

I have following code: typedef int (WINAPI* fnEngineStart)(); int __stdcall EngineStart() { BOOL FreeResult = 0, RunTimeLinkSuccess = 0; //variables for later use HMODULE LibraryHandle = 0; //Here the handle to API module/dll will be…
VirtualCoder
  • 25
  • 1
  • 7
0
votes
0 answers

GetProcAdress returns 0

when I call this CallExport function, GetProcAdress(module, "Main") returns 0 and I don't know why. The LoadLibraryEx just before works and returns a valid IntPtr. public class ProcessInteraction { public static bool CallExport(Process process,…
guillaume guerin
  • 357
  • 2
  • 6
  • 17
0
votes
2 answers

GetProcAddress function usage throughout classes

I am using a DLL provided by a fellow programmer that offers certain functions I want to use in my application. The below code works as long as I use the imported functions in the same .cpp file - but not throughout all separate…
Roel
  • 754
  • 3
  • 13
  • 30
0
votes
1 answer

Didn't work on Windows 7, but it works on Windows 8 dll

I have two DLL files, A and B. A needs B for setWindowsHookEx(). I use: LoadLibrary(L"C:\\Sources\\TestDLL.dll") and GetProcAddress(hDll, "GetMsgProc") When I try to run my program on Windows 7, GetProcAddress(hDll, "GetMsgProc") returns an…
gun95
  • 24
  • 5
0
votes
0 answers

How to load and use classes from third-party library dll at runtime

I have some dll (namely, a dll from Qt framework) and I want to load and use it at runtime. I know how to load it - with LoadLibrary I got a handle to this dll. But what next? Let's say, I want to use a class QString that is inside this library -…
nikitablack
  • 4,359
  • 2
  • 35
  • 68
0
votes
2 answers

Creating a DLL in C++ to import C++ DLL in VS 2005

I'm trying to link C++ DLL into a new C++ DLL which i will create, I've followed the below tutorial step by step and many others but something wrong the "GetProcAddress" function returns NULL…
Amr Azzam
  • 3
  • 2
0
votes
1 answer

Invalid conversion from HANDLE to HINSTANCE (Getting a kernel function's address)

I'm trying to find the address of the SetProcessDEPPolicy function of the Windows API in kernel32 (see my problem here and the first answer I got). I've never written a Windows C++ program before so I'm a bit lost but I have this so far: #include…
Juicy
  • 11,840
  • 35
  • 123
  • 212
0
votes
2 answers

C++ GetProcAddress() can't find the method of a static class

I need to dynamically load a dll in C++. I have followed this tutorial http://msdn.microsoft.com/en-us/library/ms235636.aspx to create the dll and everything worked fine. Then I followed this one http://msdn.microsoft.com/en-us/library/64tkc9y5.aspx…
0
votes
1 answer

GetProcAddress fails even when name is correctly mangled

I have the following code in a .dll: namespace MyNamespace { extern "C" __declspec(dllexport) int __stdcall GetOptionID(unsigned long num) { return 0; } } This is compiled on Visual C++ 2010, so I also have a .def file…
Chowlett
  • 45,935
  • 20
  • 116
  • 150