mirror of
https://github.com/carlospolop/hacktricks
synced 2025-02-16 14:08:26 +00:00
Update arm64-basic-assembly.md
This commit is contained in:
parent
0e8c469cda
commit
f44dc383c0
1 changed files with 11 additions and 1 deletions
|
@ -409,12 +409,22 @@ ld -o shell shell.o -syslibroot $(xcrun -sdk macosx --show-sdk-path) -lSystem
|
||||||
To extract the bytes:
|
To extract the bytes:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Code from https://github.com/daem0nc0re/macOS_ARM64_Shellcode/blob/master/helper/extract.sh
|
# Code from https://github.com/daem0nc0re/macOS_ARM64_Shellcode/blob/b729f716aaf24cbc8109e0d94681ccb84c0b0c9e/helper/extract.sh
|
||||||
for c in $(objdump -d "s.o" | grep -E '[0-9a-f]+:' | cut -f 1 | cut -d : -f 2) ; do
|
for c in $(objdump -d "s.o" | grep -E '[0-9a-f]+:' | cut -f 1 | cut -d : -f 2) ; do
|
||||||
echo -n '\\x'$c
|
echo -n '\\x'$c
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For newer macOS:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Code from https://github.com/daem0nc0re/macOS_ARM64_Shellcode/blob/fc0742e9ebaf67c6a50f4c38d59459596e0a6c5d/helper/extract.sh
|
||||||
|
for s in $(objdump -d "s.o" | grep -E '[0-9a-f]+:' | cut -f 1 | cut -d : -f 2) ; do
|
||||||
|
echo -n $s | awk '{for (i = 7; i > 0; i -= 2) {printf "\\x" substr($0, i, 2)}}'
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
<summary>C code to test the shellcode</summary>
|
<summary>C code to test the shellcode</summary>
|
||||||
|
|
Loading…
Add table
Reference in a new issue