我有一个“Hello,World!” ARM汇编语言中的程序,我想将其转换为shell代码,以便在内存区域中执行它。在英特尔汇编语言中,我删除了.data部分,因为转换为shell代码时只使用.text部分。 (See here)
现在我正在努力在ARM汇编语言中做同样的事情。基础是以下代码:
ARM程序集Hello World
.global _start
.global mymessage
mymessage:
mov r7, #4
mov r0, #1
pop {r1}
mov r2, #12
swi 0
mov r7, #1
swi 0
_start:
bl mymessage
.ascii "Hello, World"
修改了ARM Assembly Hello World以省略.data部分
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<div>
<table width="620" border"0">
<tbody>
<!-- Main text & Logo -->
<tr>
<td><img src="https://s14.postimg.org/bqnzp5681/Driven_Signature_Logo_v3.jpg" height="61" width="180"/></td>
<td><img src="https://s2.postimg.org/50ail0rzt/Signature_Break.jpg" height="80" width="2"/></td>
<td><p style="font-family:'Arial, Helvetica, sans-serif'; color:#7e7b7a; font-size:10px">
<span style="color: #3b3836; font-size:12px">Jack Kerry</span><br />
<span style="color: #7e7b7a; font-size:10px">Marketing/Admin Assistant</span><br />
E<span style="color: #ED7D31"> | </span>jack@driven-international.com<br />
T<span style="color: #ED7D31"> | </span>+44 1256 767 766<br />
F<span style="color: #ED7D31"> | </span>+44 1189 195 043<br />
A<span style="color: #ED7D31"> | </span>Acorn House, London Road, Hook. RG27 9DY. UK<br />
<td><img src="https://s2.postimg.org/50ail0rzt/Signature_Break.jpg" height="80" width="2"/></td>
</p></td>
<!-- Social Media Icons -->
<td valign="middle"><table item-width="600" border="0">
<tbody>
<tr>
<td><a href="https://www.linkedin.com/in/jack-kerry-b2550a11a/"><img src="https://s12.postimg.org/t33ekd765/Driven_linkedin_logo.png" height="35" width="35"/></td>
<td><a href="https://twitter.com/DrivenInt"><img src="https://s12.postimg.org/iuaxejj4d/Driven_twitter_logo.png" height="35" width="35"/></td>
<td><a href="http://driven-international.com/"><img src="https://s12.postimg.org/7vznwcuj1/Driven_Website_link.png" height="35" width="35"/></td>
<td><a href="https://www.youtube.com/channel/UCJtVJ8uQtU7XHemdulN8KMg"><img src="https://s12.postimg.org/gsag0al59/Driven_Youtube_Logo.png" height="35" width="35"/></td>
</tr>
</tbody>
</table>
</table>
</div>
<img src="https://s4.postimg.org/61wphkbxp/recycle-logo2.png" height="20" width="20"/>
<div>
<p style="font-family:'Arial, Helvetica, san-serif'; color: #7e7b7a; font-size:10px"> Please consider the environment before printing this email </p>
</div>
</body>
</html>
但这不起作用,因为这显然是“非法指令”。有什么想法吗?
答案 0 :(得分:2)
ARM已经具有PC相关寻址,并且在任何情况下,bl
都不会推送堆栈上的返回地址。
这有效:
.global _start
_start:
mov r7, #4
mov r0, #1
adr r1, string
mov r2, #12
swi 0
mov r7, #1
swi 0
string:
.ascii "Hello, World"