我想将带有系统调用的x86 Linux shellcode转换为ARM Linux系统调用 [英] I want to convert x86 Linux shellcode with system calls to ARM Linux system calls
本文介绍了我想将带有系统调用的x86 Linux shellcode转换为ARM Linux系统调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将Intel x86汇编代码转换为ARM.我不知道如何使用堆栈.
I want to convert Intel x86 assembly code to ARM. I do not know how to use the stack.
我使用32位x86 Linux的 int 0x80
系统调用编写了对execve的调用.但是,ARM使用svc或swi.
I wrote a call to execve using an int 0x80
system call for 32-bit x86 Linux.
However, ARM uses svc or swi.
但是我不知道如何使用这样的东西: push 0x0068732f
和 push 0x6e69622f
But I do not know how to use something like this:
push 0x0068732f
and push 0x6e69622f
.globl main
main:
push 0x0068732f
push 0x6e69622f
mov edx, 0
mov ecx, 0
mov ebx, esp
mov eax, 11
int 0x80
mov ebx, 0
mov eax, 1
int 0x80
arm上的syscall希望使用swi来像这样:
The syscall on arm expects to use the swi to look like this:
.global _start
_start:
?????
mov r7, #11
swi #0
_exit:
mov r7, #1
swi #0
我想使用堆栈推送方法而不是.ascii方法.
I want to use the stack push method rather than the .ascii method.
推荐答案
man syscall
arch/ABI instruction syscall # retval error Notes
────────────────────────────────────────────────────────────────────
arm/EABI swi 0x0 r7 r0 -
x32 syscall rax rax - [5]
arch/ABI arg1 arg2 arg3 arg4 arg5 arg6 arg7 Notes
──────────────────────────────────────────────────────────────
arm/EABI r0 r1 r2 r3 r4 r5 r6
查看全文