malware-m2-2026/backup/Malware_bak.cpp

49 lines
1.2 KiB
C++
Raw Permalink Blame History

// Malware.cpp<70>: d<>finit le point d'entr<74>e pour l'application console.
//
#pragma clang diagnostic ignored "-Wwritable-strings"
#include "stdafx.h" // IWYU pragma: keep
#include <cstdlib>
#include <cstring>
#include <stdio.h>
char* this_is_useful_fr_dont_miss_it(){ // it's not, pure red herring
char* useful = (char*) malloc(sizeof(char)*100);
for (int i = 0; i < 99; i++){
useful[i] ^= useful[i+1] + 'c';
}
return useful;
}
int _tmain(int argc, wchar_t* argv[])
{
char* a = "bdgs";
char* b = "\x00\x01\x02\x03";
char* c = (char*) malloc(sizeof(char)*5);
c = this_is_useful_fr_dont_miss_it();
for(int i = 0; i < 4; i ++){
c[i] = a[i] ^ b[i];
}
c[4] = '\0';
if (argc > 1){
char* d = (char*)malloc(sizeof(char)*9);
char* e = (char*)malloc(sizeof(char)*9);
for(int i = 0; i < 8; i++){
e[i] = (char)argv[1][i]^'\x00';
}
e[8] = '\0';
sprintf(d, "%s%s%s", c, gen_boop(), "\0baap"); // ça fait le string beep boop
d[9] = '\0'; // pure bait
if (!strcmp(d, e)) { // argument copié = "beepboop"?
printf("Gagne!\n");
} else {
printf("%S\n",argv[1]);
}
} else {
printf("Et il est où l'argv???????");
}
while(1);
return 0;
}