Hello,
I'm returning to WoW after my 6 month ban and I'm looking to get back into PE. I run on a mac and used to use a script (I'll put it below) to find my offsets for the new patches and then enter them into the unlocked script and be fine. Since coming back the script no longer seems to work properly. Does anyone have a working OS X unlocked for 10.11 with a way to find the new offsets? Or can someone tell me what is going on with what I'm using?
Here is the script I use to unlock:
Here is the errors I'm getting in terminal when trying to find new offsets:
Here is the script I use to find the offsets:
Thanks in advance for any help!
I'm returning to WoW after my 6 month ban and I'm looking to get back into PE. I run on a mac and used to use a script (I'll put it below) to find my offsets for the new patches and then enter them into the unlocked script and be fine. Since coming back the script no longer seems to work properly. Does anyone have a working OS X unlocked for 10.11 with a way to find the new offsets? Or can someone tell me what is going on with what I'm using?
Here is the script I use to unlock:
Code:
echo -e "process attach -p `ps ax|grep MacOS/[W]orld|awk '{print $1}'`\nmemory write 0x100a8273a 0xeb\nprocess detach\nquit" > /tmp/luaunlock && lldb -s /tmp/luaunlock
Code:
/Users/xxxxx/Desktop/GetWowPatchAddress.sh: line 1: {rtf1ansiansicpg1252cocoartf1404cocoasubrtf110: command not found
/Users/xxxxx/Desktop/GetWowPatchAddress.sh: line 2: syntax error near unexpected token `}'
/Users/xxxxx/Desktop/GetWowPatchAddress.sh: line 2: `{\fonttbl\f0\fmodern\fcharset0 Courier;}'
Code:
#!/bin/bash
# Find the patch address for WoW. This is the address of the first ja instruction in the
# CanPerformFunction procedure which is called by many other Lua functions.
LANG=C
wowapp=$1
wowbin="$(find -f "${wowapp}/Contents/MacOS" \( -type f -not -name ".*" \) | sed -n -e "1 p;q")"
if [ ! -f "$wowbin" ]; then
Echo "# Error: \"$wowbin\" does not exist."
exit 1
fi
# Check for universal binary
lipo -detailed_info "${wowbin}" > /tmp/wowdetailedinfo.lipo
fileoffset=$(sed -n -E "/architecture i386/,/align/ { /i386/,/offset/ { /[ ]*offset[ ]+(.*)/{s//\1/p;q;}; }; }" /tmp/wowdetailedinfo.lipo)
if [ -z $fileoffset ]; then
fileoffset=0
fi
echo "# Getting segmments and sections from \"${wowbin}\"..."
otool -l "${wowbin}" > /tmp/wowheader.otool
is64=0
grep -q LC_SEGMENT_64 /tmp/wowheader.otool && is64=1
if [ $is64 -eq 1 ]; then
name=wow64
else
name=wow32
fi
cat /tmp/wowheader.otool > ${name}header.otool
cat /tmp/wowdetailedinfo.lipo > ${name}detailedinfo.lipo
echo "# Disassembling..."
otool -tvqj "${wowbin}" > ${name}.otool
sectionlist=$(
sed -n -E '
/^Section$/,/^ reserved2/{
/^ sectname/ {s/^[ ]*[a-z0-9]+ (.+)$/\1/;h;}
/^ segname/,/^ offset/ {s/^[ ]*[a-z0-9]+ (.+)$/\1/;H;}
/^ align/{g;y/\n/,/;p;}
}' ${name}header.otool
)
segmentlist=$(
sed -n -E '
/^ cmd LC_SEGMENT/,/^ flags/{
/^ segname/ {s/^[ ]*[a-z0-9]+ (.+)$/\1/;h;}
/^ vmaddr/,/^ filesize/ {s/^[ ]*[a-z0-9]+ (.+)$/\1/;H;}
/^ maxprot/{g;y/\n/,/;p;}
}' ${name}header.otool
)
ExtractSection () { # $1:segment name $2:section name $3:filename $4:type
thesection=$(echo "$sectionlist" | sed -n -E "/^$2,$1,(.*)/{s//\1/p;q;}")
theaddr=$(expr "$thesection" : '\([0-9a-fx]*\)')
thesize=$(expr "$thesection" : '[0-9a-fx]*,\([0-9a-fx]*\)')
offset=$(expr "$thesection" : '[0-9a-fx]*,[0-9a-fx]*,\([0-9]*\)')
offset=$(($offset + $fileoffset))
if [ "$4" == "1" ]; then # convert nulls to newlines (useful for cstring section)
dd if="${wowbin}" bs=1 skip=$offset count=$thesize 2> /dev/null | tr '\0' '\n' > "$3"
elif [ "$4" == "2" ]; then # output as list of hexadecimal integers
if [ $is64 -eq 1 ]; then
dd if="${wowbin}" bs=1 skip=$offset count=$thesize 2> /dev/null | xxd -g 8 -c 8 -p | sed -E "/(..)(..)(..)(..)(..)(..)(..)(..)/s//\8\7\6\5\4\3\2\1/" > "$3"
else
dd if="${wowbin}" bs=1 skip=$offset count=$thesize 2> /dev/null | xxd -g 4 -c 4 -p | sed -E "/(..)(..)(..)(..)/s//\4\3\2\1/" > "$3"
fi
else # output as raw binary
dd if="${wowbin}" of="$3" bs=1 skip=$offset count=$thesize 2> /dev/null
fi
echo $theaddr
}
echo "# Extracting section __TEXT __cstring..."
addrTEXTcstring=$(ExtractSection '__TEXT' '__cstring' ${name}cstring.txt 1)
echo "# Extracting section __DATA __const..."
addrDATAconst=$(ExtractSection '__DATA' '__const' ${name}dataconst.txt 2)
echo "# Extracting section __DATA __data..."
addrDATAdata=$(ExtractSection '__DATA' '__data' ${name}datadata.txt 2)
GetLuaFunction () { # $1:luaFunc $2:sectionfile.txt
addrLuaString=$(printf "%0$((($is64+1)*8))x" $(( $(expr "$(grep -m 1 -o -a -b -E -e "^${1}$" ${name}cstring.txt)" : '\([0-9]*\):') + $addrTEXTcstring )) )
echo $(sed -n -E "/^$addrLuaString$/{n;p;q;}" $2)
}
echo "# Finding LUA Function SpellStopTargeting..."
addrSpellStopTargeting=$(GetLuaFunction "SpellStopTargeting" ${name}dataconst.txt)
if [ -z $addrSpellStopTargeting ]; then
addrSpellStopTargeting=$(GetLuaFunction "SpellStopTargeting" ${name}datadata.txt)
fi
echo "# Finding CanPerformFunction..."
addrCanPerformFunction=$(sed -n -E "/^$addrSpellStopTargeting"$'\t/,/\tcalll\t/{/.*\tcall.\t0x([0-9a-f]+)/'"{s//0000000000000000\1/;s/.*(.{$((($is64+1)*8))})/\1/p;q;};}" ${name}.otool)
echo $addrCanPerformFunction
echo "# Finding patch address..."
patchinstruction=$(sed -n -E "/^$addrCanPerformFunction"$'\t/,/\tret/{/\tja\t/{/\tja\t.*/{p;q;};};}' ${name}.otool)
echo $patchinstruction
echo "# Done"