Skip to content

Commit

Permalink
Merge pull request #952 from m-1-k-3/master
Browse files Browse the repository at this point in the history
s14 r2 startup command update
  • Loading branch information
m-1-k-3 committed Dec 11, 2023
2 parents 9d1f870 + d25fb3d commit 1914a0b
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions modules/S14_weak_func_radare_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ radare_function_check_PPC32(){
radare_log_bin_hardening "${NAME}" "${FUNCTION}"
if [[ "${FUNCTION}" == "mmap" ]] ; then
# For the mmap check we need the disasm after the call
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
else
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 2 -B 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 2 -B 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
fi
if [[ -f "${FUNC_LOG}" ]] && [[ $(wc -l "${FUNC_LOG}" | awk '{print $1}') -gt 0 ]] ; then
radare_color_output "${FUNCTION}"
Expand Down Expand Up @@ -214,9 +214,9 @@ radare_function_check_MIPS() {
radare_log_bin_hardening "${NAME}" "${FUNCTION}"
if [[ "${FUNCTION}" == "mmap" ]] ; then
# For the mmap check we need the disasm after the call
r2 -e io.cache=true -e scr.color=false -q -c 'pI $ss' "${BINARY_}" 2>/dev/null | grep -A 20 "^l[wd] .*${FUNCTION}""(gp)" >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $ss' "${BINARY_}" 2>/dev/null | grep -A 20 "^l[wd] .*${FUNCTION}""(gp)" >> "${FUNC_LOG}" || true
else
r2 -e io.cache=true -e scr.color=false -q -c 'pI $ss' "${BINARY_}" 2>/dev/null | grep -A 20 -B 25 "^l[wd] .*${FUNCTION}""(gp)" >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $ss' "${BINARY_}" 2>/dev/null | grep -A 20 -B 25 "^l[wd] .*${FUNCTION}""(gp)" >> "${FUNC_LOG}" || true
fi
if [[ -f "${FUNC_LOG}" ]] && [[ $(wc -l "${FUNC_LOG}" | awk '{print $1}') -gt 0 ]] ; then
radare_color_output "${FUNCTION}"
Expand Down Expand Up @@ -255,9 +255,9 @@ radare_function_check_ARM64() {
FUNC_LOG="${LOG_PATH_MODULE}""/vul_func_""${FUNCTION}""-""${NAME}"".txt"
radare_log_bin_hardening "${NAME}" "${FUNCTION}"
if [[ "${FUNCTION}" == "mmap" ]] ; then
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -A 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -A 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
else
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -A 2 -B 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -A 2 -B 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
fi
if [[ -f "${FUNC_LOG}" ]] && [[ $(wc -l "${FUNC_LOG}" | awk '{print $1}') -gt 0 ]] ; then
radare_color_output "${FUNCTION}"
Expand Down Expand Up @@ -296,9 +296,9 @@ radare_function_check_ARM32() {
FUNC_LOG="${LOG_PATH_MODULE}""/vul_func_""${FUNCTION}""-""${NAME}"".txt"
radare_log_bin_hardening "${NAME}" "${FUNCTION}"
if [[ "${FUNCTION}" == "mmap" ]] ; then
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -A 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -A 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
else
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -A 2 -B 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -A 2 -B 20 "bl.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
fi
if [[ -f "${FUNC_LOG}" ]] && [[ $(wc -l "${FUNC_LOG}" | awk '{print $1}') -gt 0 ]] ; then
radare_color_output "${FUNCTION}"
Expand Down Expand Up @@ -339,9 +339,9 @@ radare_function_check_hexagon() {
radare_log_bin_hardening "${NAME}" "${FUNCTION}"
if [[ "${FUNCTION}" == "mmap" ]] ; then
# For the mmap check we need the disasm after the call
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
else
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 2 -B 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 2 -B 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
fi
if [[ -f "${FUNC_LOG}" ]] && [[ $(wc -l "${FUNC_LOG}" | awk '{print $1}') -gt 0 ]] ; then
radare_color_output "${FUNCTION}"
Expand Down Expand Up @@ -381,9 +381,9 @@ radare_function_check_x86() {
radare_log_bin_hardening "${NAME}" "${FUNCTION}"
if [[ "${FUNCTION}" == "mmap" ]] ; then
# For the mmap check we need the disasm after the call
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
else
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 2 -B 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 2 -B 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
fi
if [[ -f "${FUNC_LOG}" ]] && [[ $(wc -l "${FUNC_LOG}" | awk '{print $1}') -gt 0 ]] ; then
radare_color_output "${FUNCTION}"
Expand Down Expand Up @@ -423,9 +423,9 @@ radare_function_check_x86_64() {
radare_log_bin_hardening "${NAME}" "${FUNCTION}"
if [[ "${FUNCTION}" == "mmap" ]] ; then
# For the mmap check we need the disasm after the call
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
else
r2 -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 2 -B 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
r2 -e bin.cache=true -e io.cache=true -e scr.color=false -q -c 'pI $s' "${BINARY_}" | grep -E -A 2 -B 20 "call.*${FUNCTION}" 2> /dev/null >> "${FUNC_LOG}" || true
fi
if [[ -f "${FUNC_LOG}" ]] && [[ $(wc -l "${FUNC_LOG}" | awk '{print $1}') -gt 0 ]] ; then
radare_color_output "${FUNCTION}"
Expand Down

0 comments on commit 1914a0b

Please sign in to comment.