News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Verifying exported functions

Started by Vortex, June 02, 2024, 06:04:38 AM

Previous topic - Next topic

Vortex

This small code verifies if a function is exported by a specific DLL :

#include <stdio.h>
#include <windows.h>

int main(int argc, char *argv[])
{

char *report[] = {"%s is exporting %s","%s does not export the function %s"};

HMODULE hDll;
FARPROC func;
int rv;

if (argc!=3){
printf("Usage : VerifyExport32 DLLname FuncName\n");
return 2;
}

hDll=LoadLibrary(argv[1]);

if (!hDll) {
printf("%s could not be loaded.",argv[1]);
return 3;
}

func=GetProcAddress(hDll,argv[2]);

rv=!func;

printf(report[rv],argv[1],argv[2]);

FreeLibrary(hDll);

return rv;
}