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

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

Issue 2926473002: Mac Archive Type Sniffing (Closed)
Patch Set: avoiding multiple asynchronous calls in tester for mac 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
« no previous file with comments | « chrome/test/BUILD.gn ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cbb266fa27610966df0ab9c5570acddf6754ebca 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"
+ # 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"
}
# Silence any stdout, but keep stderr.
« no previous file with comments | « chrome/test/BUILD.gn ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698