Is there any straightforward way to modify a binary from the commandline? Let\'s say I know that my binary contains 1234abcd and i want to change it to 12FFabcd or FFFFabcd
Here's a Bash function replaceByte, which takes the following parameters:
#!/bin/bash
# param 1: file
# param 2: offset
# param 3: value
function replaceByte() {
printf "$(printf '\\x%02X' $3)" | dd of="$1" bs=1 seek=$2 count=1 conv=notrunc &> /dev/null
}
# Usage:
# replaceByte 'thefile' $offset 95