These small shell scripts allow to patch server binaries.
Mission Server 1-hour crashing
World Server IP binding
Zone Server IP binding
Mission Server 1-hour crashing
Code:
#!/bin/sh
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
NOW=$(date "+%m%d.%H%M")
BINFILE="$DIR/date_patch.bin.$NOW.tmp"
MISSIONFILE="$DIR/MissionServer"
# hex code e1 51 33 01 = 0x13351e1 = 20140513
# 31 4a 40 01 = 0x1404a31 = 20990513
printf '\x31\x4a\x40\x01' > "$BINFILE"
dd if="$BINFILE" of="$MISSIONFILE" bs=1 count=4 seek=2025213 conv=notrunc
rm -f "$BINFILE"
World Server IP binding
Code:
#!/bin/sh
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
NOW=$(date "+%m%d.%H%M")
BINFILE="$DIR/ip_pacth.bin.$NOW.tmp"
WORLDFILE="$DIR/WorldServer"
# PUT HERE YOUR 3 IP BYTES
# Bounded files to 192.168.1.X has '\xc0\xa8\x01'.
# c0 = 192
# a8 = 168
# 01 = 1
printf '\xc0\xa8\x5c' > "$BINFILE"
dd if="$BINFILE" of="$WORLDFILE" bs=1 count=3 seek=2345445 conv=notrunc
dd if="$BINFILE" of="$WORLDFILE" bs=1 count=3 seek=2346341 conv=notrunc
dd if="$BINFILE" of="$WORLDFILE" bs=1 count=3 seek=2345969 conv=notrunc
dd if="$BINFILE" of="$WORLDFILE" bs=1 count=3 seek=2346865 conv=notrunc
dd if="$BINFILE" of="$WORLDFILE" bs=1 count=3 seek=2345983 conv=notrunc
dd if="$BINFILE" of="$WORLDFILE" bs=1 count=3 seek=2346879 conv=notrunc
rm -f "$BINFILE"
Zone Server IP binding
Code:
#!/bin/sh
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
NOW=$(date "+%m%d.%H%M")
BINFILE="$DIR/ip_pacth.bin.$NOW.tmp"
ZONEFILE="$DIR/ZoneServer"
# PUT HERE YOUR 3 IP BYTES
# Bounded files to 192.168.1.X has '\xc0\xa8\x01'.
# c0 = 192
# a8 = 168
# 01 = 1
printf '\xc0\xa8\x5c' > "$BINFILE"
dd if="$BINFILE" of="$ZONEFILE" bs=1 count=3 seek=6947381 conv=notrunc
dd if="$BINFILE" of="$ZONEFILE" bs=1 count=3 seek=6948277 conv=notrunc
dd if="$BINFILE" of="$ZONEFILE" bs=1 count=3 seek=6947905 conv=notrunc
dd if="$BINFILE" of="$ZONEFILE" bs=1 count=3 seek=6948801 conv=notrunc
dd if="$BINFILE" of="$ZONEFILE" bs=1 count=3 seek=6947919 conv=notrunc
dd if="$BINFILE" of="$ZONEFILE" bs=1 count=3 seek=6948815 conv=notrunc
rm -f "$BINFILE"