مرحبا
ما وظيفة هذا الكود؟
#include <stdio.h>
#include <windows.h>
__declspec(dllexport) void Demo()
{
#define PASSWORD_SIZE 100
#define PASSWORD "myGOODpassword\n"
int count=0;
char buff [PASSWORD_SIZE]="";
for(;;)
{
printf("Enter password:");
fgets(&buff[0], PASSWORD_SIZE-1, stdin);
if (strcmp(&buff[0], PASSWORD))
printf("Wrong password\n");
else break;
if (++count>2) return -1;
}
printf("Password OK\n");
}
main()
{
HMODULE hmod;
void (*zzz) ();
if ((hmod=LoadLibrary("crack0~1.exe"))
&& (zzz=(void (*) ())GetProcAddress (h, "Demo")))
zzz();
}وحسبما قرات في الكتاب الذي وجدت هذا الكود فيه، فقد كتب التالي
What a way to call a function! This technique exports it directly from the executable file and loads the same file as a DLL. (Yes, the same file can be both the executable application and the DLL.)
فهل يمكنكم ان تخبروني بمعني #define ومعنى هذا السطر
fgets(&buff[0], PASSWORD_SIZE-1, stdin);
ومالمقصود &buff[0], هل هي array ؟؟
وشكرا