파일 경로를 리틀엔디안으로 8바이트씩 끊어서 push 하는 것 대신 .data 섹션을 이용하는 방법은 없을까요?
; File name: ex.asm
section .data
path db "/home/shell_basic/flag_name_is_loooooong", 0
section .text
global _start
_start:
mov rdi, path ; file name
xor rsi, rsi ; null
xor rdx, rdx ; null
mov rax, 2 ; syscall number (open)
syscall ; open
mov rdi, rax ; fd
sub rsp, 0x50 ; create buf
mov rsi, rsp ; buf
mov rdx, 0x50 ; count
xor rax, rax ; syscall number (read)
syscall ; read
mov rdi , 0x01 ; fd
mov rax, 0x01 ; syscall number (write)
syscall
이렇게 작성해보았는데, 뭐가 문제인지 알 수 있을까요..??