我正在嘗試洗掉或取消鏈接檔案。取消鏈接意味著洗掉,我認為(從我讀過的內容來看)。
我閱讀了檔案和另一個檔案。他們都說取消鏈接需要 1 個引數。const char * pathname.
我已經這樣做了,但是,我想洗掉的檔案并沒有被洗掉。有誰知道為什么?這是我的代碼:
global start
section .text
start:
;This is the deleting/unlinking part
mov rax, 0x2000010; unlinking
mov rdi, file ; contains path and the file. If you look down more in section .data you can see the file and path
syscall
;This part is not important: Its just exiting
mov rax, 0x2000001 ;Exiting
xor rdi, rdi
syscall
section .data
file: db "/Users/daniel.yoffe/desktop/assembly/CoolFile.txt", 0
我還查看了 linux 中的一個示例。就是這樣。我做錯了什么嗎?取消鏈接甚至洗掉檔案嗎?我錯過了什么也許是另一個論點?
幫助將不勝感激。
uj5u.com熱心網友回復:
您使用的是不正確的十進制和十六進制數字的混合體。對于10你想要的系統呼叫:
;This is the deleting/unlinking part
mov rax, 0x200000a; unlinking
mov rdi, file ; contains path and the file. If you look down more in section .data you can see the file and path
syscall
旁注ret而不是您的第二個系統退出系統呼叫應該足以滿足現代 Mach-o MacOS 可執行檔案的要求。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/326213.html
上一篇:ARM匯編中的立即值編碼
下一篇:交易視圖如何請求資料?
