From e03a6cd0ca5e77aca0e29ea55773324bf0a4fbf0 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Tue, 24 Nov 2020 10:08:44 +0100 Subject: [PATCH] check: executables and frameworks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • check command line tools • check framework names • check server names as strings in binaries --- Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0975608..119e571 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ MY_INTERNALS = $(HOME)/Library/Mobile\ Documents/com~apple~TextEdit/Documents/Apple\ Internals.rtf DB := $(if $(DB),$(DB:.lz=),internals-$(shell sw_vers -productVersion).db) DB_TARGETS = db_files db_binaries -CHECK_TARGETS = check_files +CHECK_TARGETS = check_files check_binaries .PHONY: all check $(DB_TARGETS) $(CHECK_TARGETS) .INTERMEDIATE: $(DB) @@ -113,3 +113,17 @@ check_files: internals.txt $(DB) grep -ow '~\?/[^,;]*' $< | sed -E 's/ \(.*\)$$//;s/^\/(etc|var)\//\/private&/' | \ sed "s/'/''/g;s|.*|SELECT count(*), '&' FROM files WHERE path GLOB '&';|" | \ sqlite3 $(DB) | sed -n "/^0|/{s/^0|//;p;}" + +check_binaries: internals.txt $(DB) + printf '\033[1mchecking command line tools...\033[m\n' >&2 + grep -o 'command line tools\?: [^;]*' $< | sed 's/^[^:]*: //;s/ //g;s/([^)]*)//g' | tr , '\n' | \ + sed "s/'/''/g;s|.*|SELECT count(*), '&' FROM files WHERE executable = true AND path GLOB '*/&';|" | \ + sqlite3 $(DB) | sed -n "/^0|/{s/^0|//;p;}" + printf '\033[1mchecking frameworks...\033[m\n' >&2 + grep -ow '[[:alnum:]]*\.framework[[:alnum:]/.]*' $< | \ + sed "s|/|/*/|g;s/'/''/g;s|.*|SELECT count(*), '&' FROM files WHERE executable = true AND path GLOB '*/&/*';|" | \ + sqlite3 $(DB) | sed -n "/^0|/{s/^0|//;p;}" + printf '\033[1mchecking servers...\033[m\n' >&2 + grep -o 'servers\?: [^;]*' $< | sed 's/^[^:]*: //;s/ //g;s/([^)]*)//g' | tr , '\n' | \ + sed "s/'/''/g;s/.*/SELECT count(*), '&' FROM strings WHERE string GLOB '*&*';/" | \ + sqlite3 $(DB) | sed -n "/^0|/{s/^0|//;p;}"