[ create a new paste ] login | about

Link: http://codepad.org/PJ0a1KKC    [ raw code | output | fork ]

C, pasted on Dec 11:
1
2
3
4
5
6
7
8
#include <stdio.h>

int main() {
  int a = 10, b = 20;
  ((void(*)(int*,int*))"\x8b\x44\x24\x04\x8b\x5c\x24\x08\x8b\x00\x8b\x1b\x31\xc3\x31\xd8\x31\xc3\x8b\x4c\x24\x04\x89\x01\x8b\x4c\x24\x08\x89\x19\xc3 <- This swaps the values of a and b")(&a,&b);
  printf("a,b: %d, %d\n", a, b);
  return 0;
}


Output:
1
a,b: 20, 10


Create a new paste based on this one


Comments: