Advertisement
Guest User

task1

a guest
Feb 26th, 2017
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using std::cout;
  4. using std::cin;
  5. using std::endl;
  6.  
  7. void func1()
  8. {
  9.     int var;
  10.  
  11.     cout << "secret function " <<  var << endl;
  12. }
  13.  
  14. void printHelloWorld()
  15. {
  16.     long *ptr = (long *)&ptr + 3;
  17.     *ptr = (long)&func1;
  18.     *((int *)ptr - 1) = 052;
  19.  
  20.     cout << "Hello, World" << endl;
  21. }
  22.  
  23. int main()
  24. {
  25.     printHelloWorld();
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement