parent
96275d52f5
commit
df534acd24
|
@ -179,48 +179,48 @@ Extract_me(){
|
||||||
|
|
||||||
# cursed, carcinogenic code. TODO rewrite it better
|
# cursed, carcinogenic code. TODO rewrite it better
|
||||||
Bruteforce_extract_me() {
|
Bruteforce_extract_me() {
|
||||||
_me_destination="${1}"
|
_me_destination="${1}"
|
||||||
cdir="${2}" # must be an absolute path, not relative
|
cdir="${2}" # must be an absolute path, not relative
|
||||||
|
|
||||||
if [ -f "${_me_destination}" ]; then
|
if [ -f "${_me_destination}" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(
|
(
|
||||||
printf "Entering %s\n" "${cdir}"
|
printf "Entering %s\n" "${cdir}"
|
||||||
cd "${cdir}" || exit 1
|
cd "${cdir}" || exit 1
|
||||||
for i in *; do
|
for i in *; do
|
||||||
if [ -f "${_me_destination}" ]; then
|
if [ -f "${_me_destination}" ]; then
|
||||||
# me.bin found, so avoid needless further traversal
|
# me.bin found, so avoid needless further traversal
|
||||||
break
|
break
|
||||||
elif [ -L "${i}" ]; then
|
elif [ -L "${i}" ]; then
|
||||||
# symlinks are a security risk, in this context
|
# symlinks are a security risk, in this context
|
||||||
continue
|
continue
|
||||||
elif [ -f "${i}" ]; then
|
elif [ -f "${i}" ]; then
|
||||||
"${mecleaner}" -r -t -O "${_me_destination}" "${i}" \
|
"${mecleaner}" -r -t -O "${_me_destination}" "${i}" \
|
||||||
&& break # (we found me.bin)
|
&& break # (we found me.bin)
|
||||||
"${me7updateparser}" -O ${_me_destination} "${i}" \
|
"${me7updateparser}" -O ${_me_destination} "${i}" \
|
||||||
&& break
|
&& break
|
||||||
_7ztest="${_7ztest}a"
|
_7ztest="${_7ztest}a"
|
||||||
7z x "${i}" -o${_7ztest} || continue
|
7z x "${i}" -o${_7ztest} || continue
|
||||||
Bruteforce_extract_me "${_me_destination}" "${cdir}/${_7ztest}"
|
Bruteforce_extract_me "${_me_destination}" "${cdir}/${_7ztest}"
|
||||||
cdir="${1}"
|
cdir="${1}"
|
||||||
cd "${cdir}"
|
cd "${cdir}"
|
||||||
elif [ -d "$i" ]; then
|
elif [ -d "$i" ]; then
|
||||||
Bruteforce_extract_me "${_me_destination}" "${cdir}/${i}"
|
Bruteforce_extract_me "${_me_destination}" "${cdir}/${i}"
|
||||||
cdir="${1}"
|
cdir="${1}"
|
||||||
cd "${cdir}"
|
cd "${cdir}"
|
||||||
else
|
else
|
||||||
printf "SKIPPING: %s\n" "${i}"
|
printf "SKIPPING: %s\n" "${i}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
if [ ! -f "${_me_destination}" ]; then
|
if [ ! -f "${_me_destination}" ]; then
|
||||||
printf "me.bin not found in vendor update for board: `%s`\n" ${board}
|
printf "me.bin not found in vendor update for board: `%s`\n" ${board}
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
Main
|
Main
|
||||||
|
|
Loading…
Reference in New Issue