How to push a 64bit int in NASM?

后端 未结 1 927
甜味超标
甜味超标 2020-11-28 14:16

I\'m trying to push a 64bit integer but when assembling NASM seems to want to see it as a DWORD not a QWORD.

I\'m using ASM to create the shellcode I need to inject

相关标签:
1条回答
  • 2020-11-28 14:43

    There is no push imm64 instruction. As a workaround you can do one of the following:

    1. go through a register: mov rax, 0xACEACEACACEACEAC; push rax
    2. go through memory: push qword [rel foo]
    3. write it in two parts: push dword low32; mov dword [rsp+4], high32 or sub rsp,8; mov dword [rsp], low32; mov dword [rsp+4], high32
    4. use sign-extension if your immediate allows it
    0 讨论(0)
提交回复
热议问题