rev/armssembly_0

This commit is contained in:
2026-07-05 06:55:37 +09:00
parent 7fcc8e4cc8
commit 17f0ebef80
2 changed files with 65 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
.arch armv8-a
.file "chall.c"
.text
.align 2
.global func1
.type func1, %function
func1:
sub sp, sp, #16
str w0, [sp, 12]
str w1, [sp, 8]
ldr w1, [sp, 12]
ldr w0, [sp, 8]
cmp w1, w0
bls .L2
ldr w0, [sp, 12]
b .L3
.L2:
ldr w0, [sp, 8]
.L3:
add sp, sp, 16
ret
.size func1, .-func1
.section .rodata
.align 3
.LC0:
.string "Result: %ld\n"
.text
.align 2
.global main
.type main, %function
main:
stp x29, x30, [sp, -48]!
add x29, sp, 0
str x19, [sp, 16]
str w0, [x29, 44]
str x1, [x29, 32]
ldr x0, [x29, 32]
add x0, x0, 8
ldr x0, [x0]
bl atoi
mov w19, w0
ldr x0, [x29, 32]
add x0, x0, 16
ldr x0, [x0]
bl atoi
mov w1, w0
mov w0, w19
bl func1
mov w1, w0
adrp x0, .LC0
add x0, x0, :lo12:.LC0
bl printf
mov w0, 0
ldr x19, [sp, 16]
ldp x29, x30, [sp], 48
ret
.size main, .-main
.ident "GCC: (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0"
.section .note.GNU-stack,"",@progbits
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p pkgsCross.aarch64-multiplatform.stdenv.cc
"$CC_FOR_TARGET" chall.S -o chall
./chall 2593949075 2233560849 | cut -d' ' -f2 | xargs printf "picoCTF{%08x}\n"