I have a problem with _statxFlow. I try to call statx and save GID in uidGidRecieved. I don’t know what the problem is (well, besides that _print is not suited for integers, but that’s I have already fixed).
Here is my code:
section .data
gid db "GID: ", 0
nl db 10
section .bss
uidGidRecieved resb 128
section .text
global _start
_start:
lea rdi, [rsp+16] ;temporary saving "path" for statx
call _statxFlow
call _printGid:
_statxFlow:
mov rax, 332 ; call statx
mov rsi, rdi ;passing path to statx
mov rdi, 0 ; from current dir
mov rdx, 0x100 ;flags
mov r10, 0x00000010 ;mask
mov r8, uidGidRecieved ;buff
syscall
ret
_printGid:
mov rax, gid
call _print
mov rax, uidGidRecieved
call _print
ret
_print:
push rax
mov rbx, 0
_LoopPrint:
inc rax
inc rbx
mov cl, [rax]
cmp cl, 0
jne _LoopPrint
mov rax, 1
mov rdi, 1
pop rsi
mov rdx, rbx
syscall
ret
New contributor
Vik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.