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

csv export of p59, p60 and p70 #483

Merged
merged 5 commits into from
Feb 16, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions helpers/helpers_emba_prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,7 @@ detect_root_dir_helper() {
SEARCH_PATH="${1:-}"

print_output "[*] Root directory auto detection for $ORANGE$SEARCH_PATH$NC (could take some time)\\n"
ROOT_PATH=()
export ROOT_PATH
export ROOT_PATH=()
local R_PATH
local MECHANISM=""

Expand Down
7 changes: 7 additions & 0 deletions modules/P59_binwalk_extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ P59_binwalk_extractor() {

# now it should be fine to also set the FIRMWARE_PATH ot the FIRMWARE_PATH_CP
export FIRMWARE_PATH="$FIRMWARE_PATH_CP"

if [[ "${#ROOT_PATH[@]}" -gt 0 ]] ; then
write_csv_log "FILES" "UNIQUE_FILES" "DIRS" "Binaries" "LINUX_PATH_COUNTER" "Root PATH detected"
for R_PATH in "${ROOT_PATH[@]}"; do
write_csv_log "$FILES_EXT" "$UNIQUE_FILES" "$DIRS_EXT" "$BINS" "$LINUX_PATH_COUNTER" "$R_PATH"
done
fi
fi

module_end_log "${FUNCNAME[0]}" "$FILES_EXT"
Expand Down
7 changes: 7 additions & 0 deletions modules/P60_firmware_bin_extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ P60_firmware_bin_extractor() {

# now it should be fine to also set the FIRMWARE_PATH ot the FIRMWARE_PATH_CP
export FIRMWARE_PATH="$FIRMWARE_PATH_CP"

if [[ "${#ROOT_PATH[@]}" -gt 0 ]] ; then
write_csv_log "FILES" "UNIQUE_FILES" "DIRS" "Binaries" "LINUX_PATH_COUNTER" "Root PATH detected"
for R_PATH in "${ROOT_PATH[@]}"; do
write_csv_log "$FILES_EXT" "$UNIQUE_FILES" "$DIRS_EXT" "$BINS" "$LINUX_PATH_COUNTER" "$R_PATH"
done
fi
fi

module_end_log "${FUNCNAME[0]}" "$FILES_EXT"
Expand Down
3 changes: 3 additions & 0 deletions modules/P70_unblob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ P70_unblob() {
tree -sh "$OUTPUT_DIR_UNBLOB" | tee -a "$LOG_FILE"
fi
print_ln

write_csv_log "FILES Unblob" "UNIQUE FILES Unblob" "directories Unblob" "Binaries Unblob" "LINUX_PATH_COUNTER Unblob"
write_csv_log "$FILES_EXT_UB" "$UNIQUE_FILES_UB" "$DIRS_EXT_UB" "$BINS_UB" "$LINUX_PATH_COUNTER_UNBLOB"
fi

module_end_log "${FUNCNAME[0]}" "$FILES_EXT_UB"
Expand Down
7 changes: 7 additions & 0 deletions modules/P99_prepare_analyzer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ P99_prepare_analyzer() {
print_output "[*] RTOS system detected"
fi

if [[ "${#ROOT_PATH[@]}" -gt 0 ]] ; then
write_csv_log "FILES" "UNIQUE_FILES" "DIRS" "Binaries" "LINUX_PATH_COUNTER" "Root PATH detected" "architecture" "endianess"
for R_PATH in "${ROOT_PATH[@]}"; do
write_csv_log "$FILES_EXT" "$UNIQUE_FILES" "$DIRS_EXT" "$BINS" "$LINUX_PATH_COUNTER" "$R_PATH" "$ARCH" "$D_END"
done
fi

local NEG_LOG=1
module_end_log "${FUNCNAME[0]}" "$NEG_LOG"
}
Expand Down