Код: Выделить всё
// ARM64 Assembly Shellcode to Access Contacts
// Define strings for URI and query
.data
uri_string: .asciz "content://contacts/phones/"
query_string: .asciz "display_name:number"
.text
.global _start
_start:
// Open the contacts content provider
adrp x0, uri_string // Load the address of URI string into x0
add x0, x0, :lo12:uri_string // Calculate the actual address
mov x1, #0 // No offset
mov x2, #0 // No additional arguments
mov x8, #26 // __NR_openat syscall number for openat(AT_FDCWD, pathname, flags)
svc #0 // Invoke syscall
// Query the contacts content provider
adrp x0, query_string // Load the address of query string into x0
add x0, x0, :lo12:query_string // Calculate the actual address
mov x1, #0 // No offset
mov x2, #0 // No additional arguments
mov x8, #221 // __NR_ioctl syscall number for ioctl(fd, request, ...)
svc #0 // Invoke syscall
// Handle the results or print them
// Your code to handle or print the results goes here
// Exit
mov x0, #0 // Return 0 (success)
mov x8, #93 // __NR_exit syscall number for exit(status)
svc #0 // Invoke syscall
Из этой команды: «запрос содержимого оболочки adb --uri content://contacts/ телефоны/ " мы получаем правильный вывод, но когда мы используем это в шелл-коде, он не дает никакого вывода.
Мы ожидаем, что этот шеллкод должен печатать контактные данные моего телефона, вот и все разрешение, необходимое для запуска кода оболочки, мы попробовали небольшой код helloworld, и он работает нормально, но код оболочки контактов не выдает никаких результатов
Подробнее здесь: https://stackoverflow.com/questions/786 ... anguage-an