B
Bruno Guerpillon
Hi
In the code Below, im trying to use a dll to encrypt a password.
The function in the dll is supposed to be sent a Char and to give out a
Char.
I'm really beginner, and i dont manage to make this Work.
Any clue ?
Regards
Bruno
#include <windows.h>
#include <string.h>
#include <stdio.h>
// typedef int __stdcall (*FCTX)(char *aChaine);
typedef char (*FCTX)(char*);
// const char* __stdcall (*FCTX)(char *aChaine);
#define FUNCTION_NAME "Cypher"
#define MODULE_NAME "cypher.dll"
int main (int argc, char *argv[]) {
// static char ModPath[255]="C:\\WINDOWS\\SYSTEM32\\";
FCTX Fn_Ptr;
HMODULE ModId;
char passwd;
// strcat(ModPath, MODULE_NAME);
// ModId = LoadLibrary(ModPath);
ModId = LoadLibrary(MODULE_NAME);
Fn_Ptr = (FCTX)GetProcAddress(ModId, FUNCTION_NAME);
passwd = Fn_Ptr("motdff");
FreeLibrary(ModId);
printf ("Après appel de la fonction dans le module, le status = %s\n",
passwd);
printf ("Appuyez sur une touche :");
getchar();
return 0;
}
In the code Below, im trying to use a dll to encrypt a password.
The function in the dll is supposed to be sent a Char and to give out a
Char.
I'm really beginner, and i dont manage to make this Work.
Any clue ?
Regards
Bruno
#include <windows.h>
#include <string.h>
#include <stdio.h>
// typedef int __stdcall (*FCTX)(char *aChaine);
typedef char (*FCTX)(char*);
// const char* __stdcall (*FCTX)(char *aChaine);
#define FUNCTION_NAME "Cypher"
#define MODULE_NAME "cypher.dll"
int main (int argc, char *argv[]) {
// static char ModPath[255]="C:\\WINDOWS\\SYSTEM32\\";
FCTX Fn_Ptr;
HMODULE ModId;
char passwd;
// strcat(ModPath, MODULE_NAME);
// ModId = LoadLibrary(ModPath);
ModId = LoadLibrary(MODULE_NAME);
Fn_Ptr = (FCTX)GetProcAddress(ModId, FUNCTION_NAME);
passwd = Fn_Ptr("motdff");
FreeLibrary(ModId);
printf ("Après appel de la fonction dans le module, le status = %s\n",
passwd);
printf ("Appuyez sur une touche :");
getchar();
return 0;
}