x86_64 assembly execve *char[] syscall

后端 未结 1 805
礼貌的吻别
礼貌的吻别 2021-01-18 20:26

I am trying to get into a bit of Linux 64bit x86 assembly without using the standard libs, however I am having some issues dealing with arguments presented to my program (ar

相关标签:
1条回答
  • 2021-01-18 20:48

    At rsp+8 you'll find the address of a string with the program path. The pointer to the first argument is at [rsp+16]. But for execve you need a pointer to an array of pointer to strings which begins with a pointer to a program path (you can (ab)use [rsp+8]).

    So change

    mov rsi, [rsp + 8]
    

    to

    lea rsi, [rsp + 8]
    
    0 讨论(0)
提交回复
热议问题