• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Release] Shell script for patching server binaries from tutorial

Newbie Spellweaver
Joined
Sep 8, 2014
Messages
19
Reaction score
20
These small shell scripts allow to patch server binaries.

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"
 
Newbie Spellweaver
Joined
Nov 4, 2013
Messages
44
Reaction score
0
These small shell scripts allow to patch server binaries.

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"

What is the code for my ip please ?


87.247.207.121
 
Back
Top