main + obfuscations
This commit is contained in:
parent
5378e7ad26
commit
6d8cf617a5
2 changed files with 196 additions and 175 deletions
3
.clang-format
Normal file
3
.clang-format
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
IndentWidth: 4
|
||||||
|
ColumnLimit: 80
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
#pragma clang diagnostic ignored "-Wwritable-strings"
|
#pragma clang diagnostic ignored "-Wwritable-strings"
|
||||||
#include "stdafx.h" // IWYU pragma: keep
|
#include "stdafx.h" // IWYU pragma: keep
|
||||||
#include "functions.h"
|
|
||||||
#include "lonesha256.h"
|
|
||||||
#include "tables_poly.h"
|
|
||||||
#include "encryption.h"
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "encryption.h"
|
||||||
|
#include "functions.h"
|
||||||
|
#include "lonesha256.h"
|
||||||
|
#include "tables_poly.h"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -19,222 +20,239 @@
|
||||||
|
|
||||||
// Multiplication dans GF(256) : a * b mod 0x1B
|
// Multiplication dans GF(256) : a * b mod 0x1B
|
||||||
uint8_t gf_mul(uint8_t a, uint8_t b) {
|
uint8_t gf_mul(uint8_t a, uint8_t b) {
|
||||||
uint8_t p = 0;
|
uint8_t p = 0;
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
if (b & 1)
|
if (b & 1)
|
||||||
p ^= a;
|
p ^= a;
|
||||||
uint8_t hi_bit = a & 0x80;
|
uint8_t hi_bit = a & 0x80;
|
||||||
a <<= 1;
|
a <<= 1;
|
||||||
if (hi_bit)
|
if (hi_bit)
|
||||||
a ^= 0x1B;
|
a ^= 0x1B;
|
||||||
b >>= 1;
|
b >>= 1;
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Évaluation d'un polynôme de degré 7 sur GF(256)
|
// Évaluation d'un polynôme de degré 7 sur GF(256)
|
||||||
uint8_t evaluate_polynomial(uint8_t x, const uint8_t coeffs[8]) {
|
uint8_t evaluate_polynomial(uint8_t x, const uint8_t coeffs[8]) {
|
||||||
uint8_t result = 0;
|
uint8_t result = 0;
|
||||||
uint8_t x_pow = 1;
|
uint8_t x_pow = 1;
|
||||||
for (int j = 0; j < 8; j++) {
|
for (int j = 0; j < 8; j++) {
|
||||||
result ^= gf_mul(coeffs[j], x_pow);
|
result ^= gf_mul(coeffs[j], x_pow);
|
||||||
x_pow = gf_mul(x_pow, x);
|
x_pow = gf_mul(x_pow, x);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *(*p1)();
|
char *(*p1)();
|
||||||
int (*p2)(char *decoded);
|
int (*p2)(char *decoded);
|
||||||
} FuncList;
|
} FuncList;
|
||||||
|
|
||||||
char *this_is_useful_fr_dont_miss_it() { // it's not, pure red herring
|
char *this_is_useful_fr_dont_miss_it() { // it's not, pure red herring
|
||||||
char *useful = (char *)malloc(sizeof(char) * 100);
|
char *useful = (char *)malloc(sizeof(char) * 100);
|
||||||
for (int i = 0; i < 99; i++) {
|
for (int i = 0; i < 99; i++) {
|
||||||
useful[i] ^= useful[i + 1] + 'c';
|
useful[i] ^= useful[i + 1] + 'c';
|
||||||
}
|
}
|
||||||
return useful;
|
return useful;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmp_hash(char *decoded) {
|
int cmp_hash(char *decoded) {
|
||||||
unsigned char hash[32] = {0xf4, 0xed, 0x2a, 0x38, 0xd2, 0xff, 0xcc, 0x38,
|
unsigned char hash[32] = {0xf4, 0xed, 0x2a, 0x38, 0xd2, 0xff, 0xcc, 0x38,
|
||||||
0xbc, 0x63, 0x28, 0x46, 0xaf, 0xe2, 0x4f, 0x34,
|
0xbc, 0x63, 0x28, 0x46, 0xaf, 0xe2, 0x4f, 0x34,
|
||||||
0x2d, 0xd8, 0xb8, 0x5e, 0x74, 0xbd, 0x73, 0x99,
|
0x2d, 0xd8, 0xb8, 0x5e, 0x74, 0xbd, 0x73, 0x99,
|
||||||
0x2d, 0x91, 0x56, 0x24, 0xb4, 0x73, 0x5d, 0xee};
|
0x2d, 0x91, 0x56, 0x24, 0xb4, 0x73, 0x5d, 0xee};
|
||||||
unsigned char hash_computed[32];
|
unsigned char hash_computed[32];
|
||||||
lonesha256(hash_computed, (unsigned char *)decoded, sizeof(char) * 57);
|
lonesha256(hash_computed, (unsigned char *)decoded, sizeof(char) * 57);
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
if (hash[i] != hash_computed[i]) {
|
if (hash[i] != hash_computed[i]) {
|
||||||
return hash[i] - hash_computed[i];
|
return hash[i] - hash_computed[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fake main
|
// Fake main
|
||||||
int fakemain(int argc, wchar_t *argv[]) {
|
int fakemain(int argc, wchar_t *argv[]) {
|
||||||
Obfuscated_stdFunclist *stdfunclist = new Obfuscated_stdFunclist();
|
Obfuscated_stdFunclist *stdfunclist = new Obfuscated_stdFunclist();
|
||||||
|
|
||||||
FuncList list = {this_is_useful_fr_dont_miss_it, cmp_hash};
|
FuncList list = {this_is_useful_fr_dont_miss_it, cmp_hash};
|
||||||
// char* encoded = "Salut a tous les amis, gg pour avoir dechiffre ce string";
|
// char* encoded = "Salut a tous les amis, gg pour avoir dechiffre ce
|
||||||
char *encoded = "\x64\x55\x56\x41\x43\x14\x56\x13\x46\x5b\x47\x40\x14\x5e\x52"
|
// string";
|
||||||
"\x47\x13\x56\x5e\x5d\x40\x1f\x13\x53\x54\x14\x42\x5b\x41\x40"
|
char *encoded =
|
||||||
"\x13\x53\x47\x58\x5d\x46\x14\x53\x51\x54\x5b\x5b\x52\x54\x41"
|
"\x64\x55\x56\x41\x43\x14\x56\x13\x46\x5b\x47\x40\x14\x5e\x52"
|
||||||
"\x51\x12\x54\x51\x13\x44\x47\x46\x5a\x5d\x54";
|
"\x47\x13\x56\x5e\x5d\x40\x1f\x13\x53\x54\x14\x42\x5b\x41\x40"
|
||||||
char *key = (char *)malloc(sizeof(char) * 9);
|
"\x13\x53\x47\x58\x5d\x46\x14\x53\x51\x54\x5b\x5b\x52\x54\x41"
|
||||||
for (int i = 0; argv[1][i] != '\0'; ++i) {
|
"\x51\x12\x54\x51\x13\x44\x47\x46\x5a\x5d\x54";
|
||||||
key[i] = (char)argv[1][i] ^ this_is_useful_fr_dont_miss_it()[i] ^
|
char *key = (char *)malloc(sizeof(char) * 9);
|
||||||
list.p1()[i]; // xors to argv[1][i]
|
for (int i = 0; argv[1][i] != '\0'; ++i) {
|
||||||
}
|
key[i] = (char)argv[1][i] ^ this_is_useful_fr_dont_miss_it()[i] ^
|
||||||
key[8] = '\0';
|
list.p1()[i]; // xors to argv[1][i]
|
||||||
// printf("Key: %s\n", key);
|
}
|
||||||
encrypt_decrypt(key, encoded);
|
key[8] = '\0';
|
||||||
|
// printf("Key: %s\n", key);
|
||||||
|
encrypt_decrypt(key, encoded);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
DWORD old;
|
DWORD old;
|
||||||
VirtualProtect(&list.p1, 0x100, PAGE_EXECUTE_READWRITE, &old);
|
VirtualProtect(&list.p1, 0x100, PAGE_EXECUTE_READWRITE, &old);
|
||||||
#endif
|
#endif
|
||||||
if (!list.p2(encoded)) { // cmp_hash
|
if (!list.p2(encoded)) { // cmp_hash
|
||||||
stdfunclist->obfusc_printf("%s", encoded);
|
stdfunclist->obfusc_printf("%s", encoded);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ==============================================================================
|
/* ==============================================================================
|
||||||
* MOTEUR D'OBFUSCATION BRANCHLESS (POINT-FUNCTION OBFUSCATION)
|
* MOTEUR D'OBFUSCATION BRANCHLESS (POINT-FUNCTION OBFUSCATION)
|
||||||
* ==============================================================================
|
* ==============================================================================
|
||||||
*/
|
*/
|
||||||
|
typedef struct {
|
||||||
|
uint8_t (*evaluate_polynomial)(uint8_t x, const uint8_t coeffs[8]);
|
||||||
|
void *(*memcpy)(void *__restrict __dest, const void *__restrict __src,
|
||||||
|
size_t __n);
|
||||||
|
int (*lonesha256)(unsigned char out[32], const unsigned char *in,
|
||||||
|
size_t len);
|
||||||
|
} FuncList2;
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
if (argc < 2 || strlen(argv[1]) > 8) {
|
// Init des struct d'obfuscation d'appel de fonction
|
||||||
printf("Arguments invalides.\n");
|
Obfuscated_stdFunclist *stdfunclist = new Obfuscated_stdFunclist();
|
||||||
return 1;
|
FuncList2 list = {evaluate_polynomial, memcpy, lonesha256};
|
||||||
}
|
|
||||||
|
|
||||||
fakemain(argc, (wchar_t**) argv);
|
if (argc < 2 || strlen(argv[1]) > 8) {
|
||||||
|
printf("Arguments invalides.\n");
|
||||||
uint8_t input[8];
|
return 1;
|
||||||
memcpy(input, argv[1], 8);
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------
|
|
||||||
* 1. EXPANSION SPATIALE (FORWARD-COMPUTATION)
|
|
||||||
* Objectif : Projeter l'entrée (8 octets) sur un espace pseudo-aléatoire de
|
|
||||||
* 64 octets (512 bits) pour remplir parfaitement un bloc de compression
|
|
||||||
* SHA-256 sans ajout de bits de padding prévisibles.
|
|
||||||
*
|
|
||||||
* Équation de récurrence non-linéaire :
|
|
||||||
* S_{c, i+1} = P_{c, i}(S_{c, i} \oplus x_i)
|
|
||||||
* où:
|
|
||||||
* - c : Index de la chaîne d'évaluation parallèle (de 0 à 7).
|
|
||||||
* - i : Index du caractère de l'entrée en cours de traitement (de 0 à
|
|
||||||
* 7).
|
|
||||||
* - S_{c, i} : État interne de la chaîne 'c' à l'étape 'i'.
|
|
||||||
* - x_i : i-ème octet (caractère) de l'entrée fournie.
|
|
||||||
* - P_{c, i} : Polynôme de transition aléatoire sur GF(2^8) spécifique à
|
|
||||||
* cette étape.
|
|
||||||
* --------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
uint8_t super_bloc[64];
|
|
||||||
for (int c = 0; c < 8; c++) {
|
|
||||||
uint8_t state = INITIAL_STATES[c];
|
|
||||||
for (int i = 0; i < 8; i++) {
|
|
||||||
// Mélange non-linéaire du caractère d'entrée avec l'état courant
|
|
||||||
state = evaluate_polynomial(state ^ input[i], POLY_COEFFS[c][i]);
|
|
||||||
// Capture de la trace pour former le bloc final
|
|
||||||
super_bloc[c * 8 + i] = state;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------
|
fakemain(argc, (wchar_t **)argv);
|
||||||
* 2. VÉRIFICATION D'INTÉGRITÉ (ORACLE ALÉATOIRE)
|
|
||||||
* Calcul de l'empreinte H1 = SHA256(super_bloc)
|
|
||||||
* --------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
unsigned char h1[32];
|
|
||||||
lonesha256(h1, super_bloc, 64);
|
|
||||||
|
|
||||||
// Accumulation des erreurs bit-à-bit par rapport à la cible cryptographique
|
uint8_t input[8];
|
||||||
// Diff = \bigvee_{k=0}^{31} (H_1[k] ^ H_{cible}[k])
|
list.memcpy(input, argv[1], 8);
|
||||||
uint32_t diff = 0;
|
|
||||||
for (int i = 0; i < 32; i++) {
|
|
||||||
diff |= (h1[i] ^ h_cible[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------
|
||||||
* 3. FILTRE MATHÉMATIQUE "BRANCHLESS" (ZÉRO CONDITION)
|
* 1. EXPANSION SPATIALE (FORWARD-COMPUTATION)
|
||||||
* Transforme l'erreur accumulée en un masque binaire absolu.
|
* Objectif : Projeter l'entrée (8 octets) sur un espace pseudo-aléatoire de
|
||||||
* Formule : Mask = ( (Diff | (~Diff + 1)) >> 63 ) - 1
|
* 64 octets (512 bits) pour remplir parfaitement un bloc de compression
|
||||||
* --------------------------------------------------------------------------
|
* SHA-256 sans ajout de bits de padding prévisibles.
|
||||||
*/
|
*
|
||||||
|
* Équation de récurrence non-linéaire :
|
||||||
|
* S_{c, i+1} = P_{c, i}(S_{c, i} \oplus x_i)
|
||||||
|
* où:
|
||||||
|
* - c : Index de la chaîne d'évaluation parallèle (de 0 à 7).
|
||||||
|
* - i : Index du caractère de l'entrée en cours de traitement (de 0
|
||||||
|
* à 7).
|
||||||
|
* - S_{c, i} : État interne de la chaîne 'c' à l'étape 'i'.
|
||||||
|
* - x_i : i-ème octet (caractère) de l'entrée fournie.
|
||||||
|
* - P_{c, i} : Polynôme de transition aléatoire sur GF(2^8) spécifique à
|
||||||
|
* cette étape.
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
uint64_t diff64 = diff;
|
uint8_t super_bloc[64];
|
||||||
|
for (int c = 0; c < 8; c++) {
|
||||||
|
uint8_t state = INITIAL_STATES[c];
|
||||||
|
for (int i = 0; i < 8; i++) {
|
||||||
|
// Mélange non-linéaire du caractère d'entrée avec l'état courant
|
||||||
|
state =
|
||||||
|
list.evaluate_polynomial(state ^ input[i], POLY_COEFFS[c][i]);
|
||||||
|
// Capture de la trace pour former le bloc final
|
||||||
|
super_bloc[c * 8 + i] = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Si diff > 0 (mot de passe faux) -> is_wrong = 1
|
/* --------------------------------------------------------------------------
|
||||||
// Si diff == 0 (mot de passe bon) -> is_wrong = 0
|
* 2. VÉRIFICATION D'INTÉGRITÉ (ORACLE ALÉATOIRE)
|
||||||
uint64_t is_wrong = (diff64 | (~diff64 + 1)) >> 63;
|
* Calcul de l'empreinte H1 = SHA256(super_bloc)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
unsigned char h1[32];
|
||||||
|
list.lonesha256(h1, super_bloc, 64);
|
||||||
|
|
||||||
// Si is_wrong == 1 -> Mask = 0x0000000000000000 (Ferme la porte au payload)
|
// Accumulation des erreurs bit-à-bit par rapport à la cible cryptographique
|
||||||
// Si is_wrong == 0 -> Mask = 0xFFFFFFFFFFFFFFFF (Ouvre la porte au payload)
|
// Diff = \bigvee_{k=0}^{31} (H_1[k] ^ H_{cible}[k])
|
||||||
uint64_t mask = is_wrong - 1;
|
uint32_t diff = 0;
|
||||||
|
for (int i = 0; i < 32; i++) {
|
||||||
|
diff |= (h1[i] ^ h_cible[i]);
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------
|
||||||
* 4. DÉRIVATION DE LA CLÉ DE LEURRE (COMPORTEMENT GOODWARE)
|
* 3. FILTRE MATHÉMATIQUE "BRANCHLESS" (ZÉRO CONDITION)
|
||||||
* K_G = SHA256(L)_{[0..7]} où L est une chaîne d'apparence inoffensive.
|
* Transforme l'erreur accumulée en un masque binaire absolu.
|
||||||
* Permet une indistinguabilité totale lors d'une analyse statique (strings).
|
* Formule : Mask = ( (Diff | (~Diff + 1)) >> 63 ) - 1
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
unsigned char leurre[] = "Microsoft_CRT_Initialization";
|
|
||||||
unsigned char h_leurre[32];
|
|
||||||
lonesha256(h_leurre, leurre, 28); // K_G correspond aux 8 premiers octets
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------
|
uint64_t diff64 = diff;
|
||||||
* 5. SÉPARATION DES DOMAINES (DOMAIN SEPARATION)
|
|
||||||
* Calcul de l'empreinte de dérivation H2.
|
|
||||||
* H_2 = SHA256(super_bloc \parallel \text{"DERIVATION"})
|
|
||||||
* Garantit l'indépendance mathématique entre la vérification (H1) et le
|
|
||||||
* déchiffrement (H2).
|
|
||||||
* --------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
unsigned char buffer_h2[74]; // 64 octets (SB) + 10 octets (Sel)
|
// Si diff > 0 (mot de passe faux) -> is_wrong = 1
|
||||||
memcpy(buffer_h2, super_bloc, 64);
|
// Si diff == 0 (mot de passe bon) -> is_wrong = 0
|
||||||
memcpy(buffer_h2 + 64, "DERIVATION", 10);
|
uint64_t is_wrong = (diff64 | (~diff64 + 1)) >> 63;
|
||||||
|
|
||||||
unsigned char h2[32];
|
// Si is_wrong == 1 -> Mask = 0x0000000000000000 (Ferme la porte au payload)
|
||||||
lonesha256(h2, buffer_h2, 74);
|
// Si is_wrong == 0 -> Mask = 0xFFFFFFFFFFFFFFFF (Ouvre la porte au payload)
|
||||||
|
uint64_t mask = is_wrong - 1;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------
|
||||||
* 6. RÉSOLUTION ALGÉBRIQUE ET DÉCHIFFREMENT
|
* 4. DÉRIVATION DE LA CLÉ DE LEURRE (COMPORTEMENT GOODWARE)
|
||||||
* Formule maîtresse : K_{finale} = K_G ^ ( (E_\Delta ^ H_2) \ \& \ Mask )
|
* K_G = SHA256(L)_{[0..7]} où L est une chaîne d'apparence inoffensive.
|
||||||
* - Si Mask == 0x00 : K_{finale} = K_G ^ 0 = K_G (Goodware)
|
* Permet une indistinguabilité totale lors d'une analyse statique
|
||||||
* - Si Mask == 0xFF : K_{finale} = K_G ^ \Delta = K_G ^ (K_M ^ K_G) = K_M
|
* (strings).
|
||||||
* (Malware)
|
* --------------------------------------------------------------------------
|
||||||
* --------------------------------------------------------------------------
|
*/
|
||||||
*/
|
unsigned char leurre[] = "Microsoft_CRT_Initialization";
|
||||||
unsigned char derived_key[8];
|
unsigned char h_leurre[32];
|
||||||
for (int i = 0; i < 8; i++) {
|
list.lonesha256(h_leurre, leurre,
|
||||||
// Tentative de déchiffrement du secret (\Delta)
|
28); // K_G correspond aux 8 premiers octets
|
||||||
uint8_t computed_delta = enc_delta[i] ^ h2[i];
|
|
||||||
|
|
||||||
// Application du masque d'annihilation (filtre AND)
|
/* --------------------------------------------------------------------------
|
||||||
uint8_t applied_delta = computed_delta & (mask & 0xFF);
|
* 5. SÉPARATION DES DOMAINES (DOMAIN SEPARATION)
|
||||||
|
* Calcul de l'empreinte de dérivation H2.
|
||||||
|
* H_2 = SHA256(super_bloc \parallel \text{"DERIVATION"})
|
||||||
|
* Garantit l'indépendance mathématique entre la vérification (H1) et le
|
||||||
|
* déchiffrement (H2).
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
// Recombinaison finale de la clé
|
unsigned char buffer_h2[74]; // 64 octets (SB) + 10 octets (Sel)
|
||||||
derived_key[i] = h_leurre[i] ^ applied_delta;
|
list.memcpy(buffer_h2, super_bloc, 64);
|
||||||
|
list.memcpy(buffer_h2 + 64, "DERIVATION", 10);
|
||||||
|
|
||||||
// Déchiffrement immédiat in-place du payload
|
unsigned char h2[32];
|
||||||
payload[i] ^= derived_key[i];
|
list.lonesha256(h2, buffer_h2, 74);
|
||||||
}
|
|
||||||
payload[7] = '\0'; // Protection d'affichage C-String
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------
|
||||||
* 7. EXÉCUTION DU PAYLOAD DÉCHIFFRÉ
|
* 6. RÉSOLUTION ALGÉBRIQUE ET DÉCHIFFREMENT
|
||||||
* --------------------------------------------------------------------------
|
* Formule maîtresse : K_{finale} = K_G ^ ( (E_\Delta ^ H_2) \ \& \ Mask )
|
||||||
*/
|
* - Si Mask == 0x00 : K_{finale} = K_G ^ 0 = K_G (Goodware)
|
||||||
printf((char *)payload, argv[1]);
|
* - Si Mask == 0xFF : K_{finale} = K_G ^ \Delta = K_G ^ (K_M ^ K_G) = K_M
|
||||||
|
* (Malware)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
unsigned char derived_key[8];
|
||||||
|
for (int i = 0; i < 8; i++) {
|
||||||
|
// Tentative de déchiffrement du secret (\Delta)
|
||||||
|
uint8_t computed_delta = enc_delta[i] ^ h2[i];
|
||||||
|
|
||||||
// Boucle infinie demandée pour suspendre le processus
|
// Application du masque d'annihilation (filtre AND)
|
||||||
while (1) {
|
uint8_t applied_delta = computed_delta & (mask & 0xFF);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
// Recombinaison finale de la clé
|
||||||
|
derived_key[i] = h_leurre[i] ^ applied_delta;
|
||||||
|
|
||||||
|
// Déchiffrement immédiat in-place du payload
|
||||||
|
payload[i] ^= derived_key[i];
|
||||||
|
}
|
||||||
|
payload[7] = '\0'; // Protection d'affichage C-String
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------
|
||||||
|
* 7. EXÉCUTION DU PAYLOAD DÉCHIFFRÉ
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
stdfunclist->obfusc_printf((char *)payload, argv[1]);
|
||||||
|
|
||||||
|
// Boucle infinie demandée pour suspendre le processus
|
||||||
|
while (1) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue