Tag Archives: code

[C++] Interesting example of C++ code obfuscation

Recently a friend of mine has given me a piece of code in C++: puts(&3["abcdef"]);puts(&3["abcdef"]); At first glance it seems to not compile at all. But not only it compiles, but also prints “def”.

Posted in C++ | Tagged , , | Leave a comment

[Python,Algorithms] Fast Modular exponentiation script

If we want to know the last ten digits of number an – we have to evaluate expression an mod 1010. Using brute force approach, we have to do O(n) ( If you don’t understand big „O” notation, visit: Big … Continue reading

Posted in Algorithms, Python | Tagged , , , | 3 Comments

[PHP] Execution/evaluation of code from variable

In PHP we can use function eval in order to evaluate given variable (string) as PHP code: <? $var = ‘for ($i=0;$i<5;$i++) { echo $i.\'<br>\’; }’; eval($var); ?><? $var = ‘for ($i=0;$i<5;$i++) { echo $i.\'<br>\’; }’; eval($var); ?> output: 0 … Continue reading

Posted in PHP | Tagged , | 3 Comments