Skip to content

Instantly share code, notes, and snippets.

@Cih2001

Cih2001/macro.cc Secret

Created July 3, 2020 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cih2001/002a5753dd2e848f4c13dc9af36cfc08 to your computer and use it in GitHub Desktop.
Save Cih2001/002a5753dd2e848f4c13dc9af36cfc08 to your computer and use it in GitHub Desktop.
/*
* This macro is a lambda function to pack all required steps into one single command
* when defining strings.
*/
#define STR(str) \
[]() -> char* { \
constexpr auto size = sizeof(str)/sizeof(str[0]); \
constexpr auto obfuscated_str = obfuscator<size>(str); \
static char original_string[size]; \
obfuscated_str.deobfoscate((unsigned char *)original_string); \
return original_string; \
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment