// CHALLENGE PAR Ryscrow - http://w...content-available-to-author-only...e.org/fr/Challenges/Cryptanalyse/Decomposition-pixelisee
// --------------------------------------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
void Afficher(char car, unsigned int nb)
{
unsigned int c = 0;
char pixel;
if (car == '0') { pixel = '\x20'; } // Voir une table ASCII - correspond à un espace (pixel noir)
else { pixel = '\xdb'; } // correspond à un rectangle plein (pixel blanc)
while (c != nb)
{
c++;
}
}
//------------------------------------------------
int Analyser()
{
FILE
*hFichier
= fopen("decomp_pixel.txt", "r");char car = 0, nb1 = 0, nb2 = 0, curseur;
if (hFichier == NULL)
{
printf("\t>Impossible de trouver le fichier\n\n"); return 0;
}
while (fread(&car
, 1, sizeof(char), hFichier
) != 0) {
if (car
== '\n') { fread(&curseur
, 1, 1, hFichier
); printf("\n"); continue; } // Fin de ligne if (car == '+') { continue; }
fread(&curseur
, 1, 1, hFichier
); // On déplace le curseur de 1 caractère fread(&nb1
, 1, sizeof(char), hFichier
); // On lit les deux caractères suivant le 'x' fread(&nb2
, 1, sizeof(char), hFichier
); // Le second peut être un chiffre, un '+' ou un saut de ligne if (nb2 == '+') { Afficher(car, nb1 - 48); } // On soustrait 48 pour obtenir le chiffre et non le caractère ASCII
else if (nb2
== '\n') { printf("\n"); fread(&curseur
, 1, 1, hFichier
); } else { Afficher(car, (nb1-48)*10 + (nb2-48)); } // S'il s'agit d'un chiffre
}
}
//------------------------------------------------
int main(int argc, char *argv[])
{
Analyser();
return 0;
}
CgovLyAgICAgIENIQUxMRU5HRSBQQVIgUnlzY3JvdyAtIGh0dHA6Ly93Li4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5lLm9yZy9mci9DaGFsbGVuZ2VzL0NyeXB0YW5hbHlzZS9EZWNvbXBvc2l0aW9uLXBpeGVsaXNlZQovLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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HgzKzF4MSsweDErMXgyKzB4MysxeDErMHgxKzF4NisweDErMXgxKzB4MysxeDErMHgyKzF4MSsweDE0KzF4MisweDgrMXgxKzB4MTArMXgyKzB4MysxeDIrMHgxKzF4MSsweDEKCjB4NisxeDUrMHg0KzF4MSsweDcrMXgxKzB4MisxeDErMHgzKzF4MisweDQrMXgxKzB4OCsxeDErMHgzKzF4MisweDErMXgyKzB4MysxeDErMHg4KzF4MSsweDIrMXgyKzB4MSsxeDErMHgzKzF4NysweDUrMXgyKzB4MisxeDErMHgyKzF4MisweDMKCjB4MSsxeDErMHgyKzF4MSsweDErMXgyKzB4NSsxeDErMHg2KzF4MisweDMrMXgxKzB4MisxeDErMHgxKzF4MisweDIwKzF4OCsweDErMXgxKzB4MSsxeDErMHg0KzF4MisweDMrMXgxKzB4MisxeDIrMHgzKzF4MisweDcrMXgyKzB4MysxeDIrMHg0CgoweDIrMXgxKzB4MysxeDUrMHg1KzF4MisweDcrMXgxKzB4NCsxeDIrMHgyKzF4MSsweDIrMXgyKzB4MSsxeDErMHgzKzF4MSsweDYrMXgyKzB4MisxeDIrMHgzKzF4MisweDIrMXgzKzB4MSsxeDErMHg2KzF4MysweDMrMXg1KzB4MysxeDErMHg0KzF4MSsweDUKCjB4NCsxeDIrMHgzKzF4MisweDMrMXgxKzB4NSsxeDIrMHgyKzF4MSsweDErMXgxKzB4MSsxeDErMHgxKzF4MisweDkrMXgxKzB4MysxeDErMHgyKzF4MSsweDErMXgxKzB4MisxeDErMHgxKzF4MisweDIrMXgxKzB4MisxeDErMHgxKzF4MSsweDQrMXgzKzB4MSsxeDErMHgyKzF4MisweDMrMXgyKzB4MysxeDErMHg1KzF4MSsweDQrMXgxKzB4MgoKMHg2KzF4NSsweDQrMXgxKzB4MSsxeDErMHgyKzF4MisweDYrMXgxKzB4MSsxeDcrMHg0KzF4MysweDMrMXgxKzB4NCsxeDErMHgyKzF4MisweDQrMXgxKzB4NisxeDErMHg2KzF4OCsweDMrMXgxKzB4NSs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