When I try to define a multi-instruction shared byte obfuscating code with c macro, there is an error when compiling, the error codes are C2414 and C2400 If the c macro definition is not used, it can be compiled successfully
#include <stdio.h>
#define test __asm{\
__asm jmp $+5\
}
#define test1 __asm{\
__asm _emit 0xeb\
__asm _emit 0xff\
__asm _emit 0xc0\
__asm _emit 0x48\
}
int main()
{
test1;
}
How can I use this obfuscating code inside a c macro?
According to this then multiple __asm
on a single line should be ok. But after compiling your code in MSVC, the actual problem reported is:
(15): error C2059: syntax error: 'bad suffix on number'
And then we realize that your macro expands to __asm _emit 0xeb__asm _emit 0xff
and so on, where 0xeb__asm
is gibberish. Adding a space to each row like 0xeb \
made your code compile cleanly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.