Advertisement
Guest User

co ja robię źle?

a guest
Jan 21st, 2017
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. typedef __cdecl void (*lazyFunc)(void);
  6.  
  7. int __cdecl functionA(int a, int b) {
  8.     cout<<a<<" "<<b<<endl;
  9.     return a+b;
  10. }
  11.  
  12. int main() {
  13.     int result = 0;
  14.     lazyFunc func = (lazyFunc)(functionA);
  15.     asm("push 2");
  16.     asm("push 3");
  17.     func();
  18.     asm("add esp, 8");
  19.     asm("mov eax, 7");
  20.     cout<<result<<endl;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement