Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve diff mode #867

Merged
merged 4 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions emba
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ run_modules()
fi
local MOD_FIN=0
if ( file "${MODULE_FILE}" | grep -q "shell script" ) && ! [[ "${MODULE_FILE}" =~ \ |\' ]] ; then
if [[ "${MODULE_GROUP^^}" == "P" ]]; then
if [[ "${MODULE_GROUP^^}" == "P" ]] || [[ "${MODULE_GROUP^^}" == "D" ]]; then
# we are able to enable/disable threading on module basis in the the pre-checker modules with the header:
# export PRE_THREAD_ENA=1/0
# shellcheck source=/dev/null
Expand Down Expand Up @@ -295,7 +295,7 @@ run_modules()
fi
local MOD_FIN=0
if ( file "${MODULE_FILE}" | grep -q "shell script" ) && ! [[ "${MODULE_FILE}" =~ \ |\' ]] ; then
if [[ "${MODULE_GROUP^^}" == "P" ]]; then
if [[ "${MODULE_GROUP^^}" == "P" ]] || [[ "${MODULE_GROUP^^}" == "D" ]]; then
# we are able to enable/disable threading on module basis in the the pre-checker modules with the header:
# export PRE_THREAD_ENA=1/0
# shellcheck source=/dev/null
Expand Down Expand Up @@ -881,9 +881,6 @@ main() {
#######################################################################################
if [[ "${DIFF_MODE}" -eq 1 ]] ; then

# Diff mode is unthreaded
export THREADED=0

print_ln "no_log"
if [[ -d "${LOG_DIR}" ]]; then
print_output "[!] Diff mode started on ""$(date)" "main"
Expand Down
3 changes: 1 addition & 2 deletions helpers/helpers_emba_dependency_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ dependency_check()
#######################################################################################
print_output "[*] Network connection:" "no_log"


if [[ "${CONTAINER_NUMBER}" -ne 1 ]]; then
print_output " Internet connection - \\c" "no_log"

Expand Down Expand Up @@ -285,7 +284,7 @@ dependency_check()
fi
# Note: we are running into issues in the case where the key can't be verified, but GPT is not enabled at all
# In such a case we will fail the check without the need of GPT
DEP_ERROR=1
# DEP_ERROR=1
fi
if grep -q "Testing phase ended" "${LOG_DIR}"/"${MAIN_LOG_FILE}" 2>/dev/null; then
print_output " Testing phase ended - \\c" "no_log"
Expand Down
1 change: 1 addition & 0 deletions helpers/helpers_emba_html_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ add_link_tags() {
if ( grep -a -q -E '\[REF\]' "${LINK_FILE}" ) ; then
readarray -t REF_LINKS_L_NUMBER < <(grep -a -n -E '\[REF\].*' "${LINK_FILE}" | cut -d':' -f1 )
for REF_LINK_NUMBER in "${REF_LINKS_L_NUMBER[@]}" ; do
DEPTH="."
REF_LINK="$(sed "${REF_LINK_NUMBER}""q;d" "${LINK_FILE}" | cut -c12- | cut -d'<' -f1 || true)"
URL_REGEX='(www.|https?|ftp|file):\/\/'
if [[ -f "$(echo "${REF_LINK}" | cut -d"#" -f1)" ]] ; then
Expand Down
3 changes: 3 additions & 0 deletions modules/D02_firmware_diffing_bin_details.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
# This module is doing some basic checks on the firmware. It uses mainly
# the functionality from the p02 module but on both firmware images.

export PRE_THREAD_ENA=0


D02_firmware_diffing_bin_details() {

module_log_init "${FUNCNAME[0]}"
Expand Down
2 changes: 2 additions & 0 deletions modules/D05_firmware_diffing_extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# unblob extraction from module p55. There is currently no deep extraction
# mode supported.

export PRE_THREAD_ENA=0


D05_firmware_diffing_extractor() {
module_log_init "${FUNCNAME[0]}"
Expand Down