mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-05-26 07:38:41 -04:00
12 lines
324 B
Bash
Executable File
12 lines
324 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Extracts a segment from the binary that was produced by ld.
|
|
|
|
segment=$1
|
|
|
|
pos=$(grep "^\.$segment " $B_DIR/pd.map | awk '{print $6}')
|
|
len=$(grep "^\.$segment " $B_DIR/pd.map | awk '{print $3}')
|
|
|
|
dd if=$B_DIR/pd.bin of=$B_DIR/ucode/$segment.bin skip=$(($pos)) iflag=skip_bytes bs=$(($len)) count=1 status=none
|
|
|