-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.section .text | ||
|
||
.global main | ||
main: | ||
|
||
.code 32 | ||
add r6,pc,#1 | ||
bx r6 | ||
|
||
.code 16 | ||
/*write()*/ | ||
mov r2,#6 | ||
mov r1,pc | ||
add r1,#12 | ||
mov r0,$0x1 | ||
mov r7,$0x4 | ||
svc 0 | ||
|
||
/*exit()*/ | ||
sub r0,r0,r0 /*0=1-1*/ | ||
mov r7,$0x1 | ||
svc 0 | ||
|
||
|
||
|
||
.ascii "lsusb\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.syntax unified | ||
|
||
@ -------------------------------- | ||
.global main | ||
main: | ||
@ Stack the return address (lr) in addition to a dummy register (ip) to | ||
@ keep the stack 8-byte aligned. | ||
push {ip, lr} | ||
|
||
@ Load the argument and perform the call. This is like 'printf("...")' in C. | ||
ldr r0, =message | ||
bl printf | ||
|
||
@ Exit from 'main'. This is like 'return 0' in C. | ||
mov r0, #0 @ Return 0. | ||
|
||
@ Pop the dummy ip to reverse our alignment fix, and pop the original lr | ||
@ value directly into pc — the Program Counter — to return. | ||
pop {ip, pc} | ||
|
||
@ -------------------------------- | ||
@ Data for the printf calls. The GNU assembler's ".asciz" directive | ||
@ automatically adds a NULL character termination. | ||
message: | ||
.asciz "vamos within temptation.\n" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.section .text | ||
|
||
.global main | ||
main: | ||
|
||
.code 32 | ||
add r6,pc,#1 | ||
bx r6 | ||
|
||
.code 16 | ||
/*write()*/ | ||
mov r2,#6 | ||
mov r1,pc | ||
add r1,#14 | ||
mov r0,$0x1 | ||
mov r7,$0x4 | ||
svc 1 | ||
|
||
/*exit()*/ | ||
sub r4,r4,r4 | ||
mov r0,r4 | ||
mov r7,$0x1 | ||
svc 1 | ||
|
||
.ascii "lsusb\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.global main | ||
|
||
main: | ||
mov r1,#5 | ||
mov r2,#7 | ||
add r0,r1,r2 | ||
bx lr | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
r0 0 | ||
r1 /bin/sh | ||
r2 /bin/sh | ||
r7 11 | ||
*/ | ||
|
||
|
||
.section .text | ||
|
||
.global main | ||
main: | ||
|
||
.code 32 | ||
add r6,pc,#1 | ||
bx r6 | ||
|
||
.code 16 | ||
|
||
mov r0,pc /*guardomos el program counter en r0*/ | ||
add r0,#10 | ||
|
||
str r3,[sp,#4] | ||
add r1,sp,#4 | ||
sub r2,r2,r2 | ||
mov r7,#11 | ||
svc 1 | ||
|
||
|
||
|
||
.ascii "//bin/sh\n" |