C/C + + Struct Randomization

The antispy™ C/C + + Struct randomization provides a random arrangement of Fields into structures. This can break heuristics that assume that certain fields in your structures are consecutive in the code segment. Normally, you want structures to always have the same layout (data formats!). However, there are cases, especially in the gaming industry where you should have modified structures in every software building. Structures that change after each build are very tedious for an attacker to recreate. The im

Implementierung

plementation is carried out with the marking by the macro ANTI _ SPY _ STRUCT _ LAYOUT _ RANDOMIZER between the fields.

#include<antispy bfuscation.hpp=""></antispy>

struct random _ layout
{
    ANTI _ SPY _ STRUCT _ LAYOUT _ RANDOMIZER
    value1_;
    ANTI _ SPY _ STRUCT _ LAYOUT _ RANDOMIZER
    value2_;
    ANTI _ SPY _ STRUCT _ LAYOUT _ RANDOMIZER
   value3_;
   ANTI _ SPY _ STRUCT _ LAYOUT _ RANDOMIZER
};

int main (int argc, const char * * argv)
{    
    random _ laystru {};
    stru.value1_ = 123;
    stru.value2_ = 234;
    stru.value3_ = 345;
    std:: Cout< "Structure"></ "Structure"> 
        < "="" value="" 1:="" "="">< stru.value1_></ stru.value1_>
        < "="" value="" 2:="" "="">< stru.value2_></ stru.value2_>
        < "="" value="" 3:="" "="">< stru.value3_></ stru.value3_>
        < std::endl;></ std::endl;>
    Return 0;
}