Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8820)

Unified Diff: chrome/test/data/safe_browsing/dmg/generate_test_data.sh

Issue 2926473002: Mac Archive Type Sniffing (Closed)
Patch Set: matching style Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/safe_browsing/dmg/generate_test_data.sh
diff --git a/chrome/test/data/safe_browsing/dmg/generate_test_data.sh b/chrome/test/data/safe_browsing/dmg/generate_test_data.sh
index a1a6b6557c2be91a85ce69b8e19204e0592eee1c..0bdb4e5591fa3f1f37cbdae0f7893615ee0c238c 100755
--- a/chrome/test/data/safe_browsing/dmg/generate_test_data.sh
+++ b/chrome/test/data/safe_browsing/dmg/generate_test_data.sh
@@ -84,6 +84,23 @@ generate_test_data() {
"${OUT_DIR}/mach_o_in_dmg"
rm -rf "${DMG_SOURCE}"
+
+ # Copy of Mach-O DMG with 'koly' signature overwritten #######################
+ cp "${OUT_DIR}/mach_o_in_dmg.dmg" \
+ "${OUT_DIR}/mach_o_in_dmg_no_koly_signature.dmg"
Robert Sesek 2017/06/12 16:38:39 nit: indent continuation lines by 4 spaces so it's
mortonm 2017/06/12 18:31:16 Done.
+ # Gets size of Mach-O DMG copy.
+ SIZE=`stat -f%z "${OUT_DIR}/mach_o_in_dmg_no_koly_signature.dmg"`
+ # Overwrites 'koly' with '????'.
+ printf '\xa1\xa1\xa1\xa1' | dd conv=notrunc \
+ of="${OUT_DIR}/mach_o_in_dmg_no_koly_signature.dmg" bs=1 seek=$(($SIZE - 512))
+
+ # Copy of Mach-O DMG with extension changed to .txt.
+ cp "${OUT_DIR}/mach_o_in_dmg.dmg" "${OUT_DIR}/mach_o_in_dmg.txt"
+
+ # Copy of Mach-O DMG with extension changed to .txt and no 'koly' signature ##
+ cp "${OUT_DIR}/mach_o_in_dmg_no_koly_signature.dmg" \
+ "${OUT_DIR}/mach_o_in_dmg_no_koly_signature.txt"
+
Robert Sesek 2017/06/12 16:38:39 nit: extra blank line
mortonm 2017/06/12 18:31:16 Done.
}
# Silence any stdout, but keep stderr.

Powered by Google App Engine
This is Rietveld 408576698