Is there a method / plugin / addon to ignore the following sentence (for some c / C ++ compiler)? Change the order of declaring members in a structure at the same stage as a preprocessor or similar? Perhaps adding a keyword like volatile or something similar to the beginning of a structure declaration.
I thought: a compiler option, an inline keyword, or a programming method.
C99 §6.7.2.1 Clause 13:
Inside an object are structures of members that are not bit fields, and units in which there are bit fields, addresses that increase the order in which they are declared.
C ++ seems to have a similar article, and that interests me too. These sentences indicate a reasonable function that, in terms of later declarations, has a larger memory bias. But I often do not need to know the declaration order of my structure for interface purposes or any other. It would be nice to write code like:
scrambled struct foo {
int a;
int bar;
};
or, suppose the order does not matter for this structure.
scrambled struct foo {
int bar;
int a;
};
So, declare aand bdeclare randomly every time you compile. I believe this also applies to undoing stack memory.
main() {
scrambled int a;
scrambled int foo;
scrambled int bar;
..
Why am I asking?
I was curious to see how the program bots were created. I watched as some people analyzed memory offsets for changes during the launch of a program for which a hack would be created.
, : . .
, , . , , , , .