Created
March 5, 2020 20:26
-
-
Save 911992/bbcd709416b6c7ce82fd10772a6ad18f to your computer and use it in GitHub Desktop.
C trigraphs, and some little tip for obfuscating
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%:include <stdio.h> | |
main(void) ??< | |
char _vls<:4:>=<%1,3,5,7%>; | |
printf("val:%d ??/n", 1??(_vls??) ); | |
??> | |
/* | |
Above code equals to following code. | |
Prints 3. | |
*/ | |
/* | |
#include <stdio.h> | |
int main(void) { | |
char _vls[4]={1,3,5,7}; | |
printf("val:%d \n", _vals[1] ); | |
return 0; | |
}/* | |
/* | |
More reading: | |
Trigraphs: | |
http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1256.pdf § 5.1.1.2 and § 5.2.1.1 | |
main(startup) function related: | |
http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1256.pdf § 5.1.2.2.3 | |
Array indexing: | |
http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1256.pdf § 6.5.2.1 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment