View Full Version : help on c++ macro's

August 8th, 2008, 02:22
hi guys im currently trying to make a little macro to at compiletime Select some random bytes for creating some assembly opfuscation but im having some troubles doing it :P cant seem to find good resource on goolgle for what i need todo ..now let me explain i have

#define OpfuscationTable { 0xa1 };
#define OpfuTest(x) __asm { __emit x[0] }

so in my head now ..i should be able todo like this

OpfuTest(OpfuscationTable) but it then complains i have an illegal number of oprands , so then i figured id try to access the defined table straight away like this

#define OpfuscationTable { 0xa1 };
#define OpfuTest() __asm { __emit OpfuscationTable[0] }

but ..that dident really work either hehe so i figured id post here hope a helping soul will help me out , in continuating work on it..so might get it to work but general suggestion on opfuscation and macro's are more then welcome

August 13th, 2008, 18:27
__emit emits only constant bytes (no array references), and the preprocessor cannot generate random choices for each macro invocation. Instead, you could write your own "preprocessor" (just search & replace).

August 13th, 2008, 23:48
okay..thnx mate i thought of that..but i hoped i could do it this way , but ill just make a tool to insert stuff then