From f3a2a44bd77e93419d2e424e2bd69bf3a9ed2b37 Mon Sep 17 00:00:00 2001 From: Daniel Matichuk Date: Wed, 15 Nov 2023 13:28:43 -0800 Subject: [PATCH] fixup hackathon Makefile --- demos/nov-2023/Makefile | 85 ++++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 34 deletions(-) diff --git a/demos/nov-2023/Makefile b/demos/nov-2023/Makefile index 9d0aa7c2..528554e0 100644 --- a/demos/nov-2023/Makefile +++ b/demos/nov-2023/Makefile @@ -1,42 +1,48 @@ -.PHONY: target4-patch1 target4 target4-self target1-self target3 target3-self +.PHONY: target4-patch1 target4 target4-self target1-self target3 target3-self target3-room_1011_dendy target4-room_1011_dendy target4-master + +PATE=../../pate.sh +#PATE=docker run --rm -it -v `pwd`:/demos pate + +DEMOS=. +#DEMOS=/demos target4.original.exe: cp "$(HACKATHON_NOV_2023)/Target 4 - Grid IDPS (ARM Cortex M7)/build/Amp_Chal_IDPS_Unpatched.ino.elf" $@ target4-master: - cp "$(HACKATHON_NOV_2023)/Target 4 - Grid IDPS (ARM Cortex M7)/build/Amp_Chal_IDPS_Patched.ino.elf" $@ + cp "$(HACKATHON_NOV_2023)/Target 4 - Grid IDPS (ARM Cortex M7)/build/Amp_Chal_IDPS_Patched.ino.elf" target4.patched.exe target4-room_1011_dendy: cd "$(HACKATHON_NOV_2023)" && git fetch && git checkout room_1011_dendy cp "$(HACKATHON_NOV_2023)/Target 4 - Grid IDPS (ARM Cortex M7)/Amp_Chal_IDPS_Ghidra_patched_r3.ino.elf" target4.patched.exe target4-self: target4.original.exe target4.csv - ../../pate.sh \ + $(PATE) \ --ignore-segments 1 \ --read-only-segments 3 \ - -o target4.original.exe \ - -p target4.original.exe \ - -b target4.toml \ + -o $(DEMOS)/target4.original.exe \ + -p $(DEMOS)/target4.original.exe \ + -b $(DEMOS)/target4.toml \ -e ContinueAfterRecoverableFailures \ -r AllowEqRescopeFailure \ -s get_bitchunk \ - --original-csv-function-hints target4.csv \ - --patched-csv-function-hints target4.csv \ - --save-macaw-cfgs target4_CFGs + --original-csv-function-hints $(DEMOS)/target4.csv \ + --patched-csv-function-hints $(DEMOS)/target4.csv \ + --save-macaw-cfgs $(DEMOS)/target4_CFGs target4: target4.original.exe target4.patched.exe target4.csv - ../../pate.sh \ + $(PATE) \ --ignore-segments 1 \ --read-only-segments 3 \ - -o target4.original.exe \ - -p target4.patched.exe \ - -b target4.toml \ + -o $(DEMOS)/target4.original.exe \ + -p $(DEMOS)/target4.patched.exe \ + -b $(DEMOS)/target4.toml \ -e ContinueAfterRecoverableFailures \ -r AllowEqRescopeFailure \ -s get_bitchunk \ - --original-csv-function-hints target4.csv \ - --patched-csv-function-hints target4.csv \ - --save-macaw-cfgs target4_CFGs + --original-csv-function-hints $(DEMOS)/target4.csv \ + --patched-csv-function-hints $(DEMOS)/target4.csv \ + --save-macaw-cfgs $(DEMOS)/target4_CFGs target4.diff: target4.original.exe target4.patched.exe arm-none-eabi-objdump -M force-thumb-mode -d target4.original.exe > target4.original.dump @@ -47,36 +53,47 @@ target1.original.exe: cp "$(HACKATHON_NOV_2023)/Target 1 - NASA Lunar Relay Sat (powerpc)/cpu1/core-cpu1" $@ target1-self: target1.original.exe - ../../pate.sh \ - -o target1.original.exe \ - -p target1.original.exe \ + $(PATE) \ + -o $(DEMOS)/target1.original.exe \ + -p $(DEMOS)/target1.original.exe \ -e ContinueAfterRecoverableFailures \ -r AllowEqRescopeFailure \ -s main \ - --save-macaw-cfgs target1_CFGs + --save-macaw-cfgs $(DEMOS)/target1_CFGs target3.original.so: cp "$(HACKATHON_NOV_2023)/Target 3 - MRZR Vehicle Interface Controller (BBB)/bin/libroscpp.so" $@ -target3.patched.so: - cp "$(HACKATHON_NOV_2023)/Target 3 - MRZR Vehicle Interface Controller (BBB)/bin/libroscpp_manually_patched.so" $@ +target3-patched-master: + cp "$(HACKATHON_NOV_2023)/Target 3 - MRZR Vehicle Interface Controller (BBB)/bin/libroscpp_manually_patched.so" target3.patched.so + +target3-room_1011_dendy: + cd "$(HACKATHON_NOV_2023)" && git fetch && git checkout room_1011_dendy + cp "$(HACKATHON_NOV_2023)/Target 3 - MRZR Vehicle Interface Controller (BBB)/patched_target3_irene_patcherex" target3.patched.so target3-self: target3.original.so - ../../pate.sh \ - --ignore-segments 1 \ - -o target3.original.so \ - -p target3.original.so \ + $(PATE) \ + -o $(DEMOS)/target3.original.so \ + -p $(DEMOS)/target3.original.so \ -e ContinueAfterRecoverableFailures \ -r AllowEqRescopeFailure \ - -s main \ - --save-macaw-cfgs target1_CFGs + -s _ZN3ros22TransportPublisherLink15onMessageLengthERKN5boost10shared_ptrINS_10ConnectionEEERKNS1_12shared_arrayIhEEjb \ + -s _ZN3ros22TransportPublisherLink16onHeaderReceivedERKN5boost10shared_ptrINS_10ConnectionEEERKNS_6HeaderE \ + -s _ZN3ros22TransportPublisherLinkD2Ev \ + --save-macaw-cfgs $(DEMOS)/target1_CFGs target3: target3.original.so target3.patched.so - ../../pate.sh \ - --ignore-segments 1 \ - -o target3.original.so \ - -p target3.patched.so \ + $(PATE) \ + -o $(DEMOS)/target3.original.so \ + -p $(DEMOS)/target3.patched.so \ -e ContinueAfterRecoverableFailures \ -r AllowEqRescopeFailure \ - -s main \ - --save-macaw-cfgs target1_CFGs \ No newline at end of file + -s _ZN3ros22TransportPublisherLink15onMessageLengthERKN5boost10shared_ptrINS_10ConnectionEEERKNS1_12shared_arrayIhEEjb \ + -s _ZN3ros22TransportPublisherLink16onHeaderReceivedERKN5boost10shared_ptrINS_10ConnectionEEERKNS_6HeaderE \ + -s _ZN3ros22TransportPublisherLinkD2Ev \ + --save-macaw-cfgs $(DEMOS)/target1_CFGs + +target3.diff: target3.original.so target3.patched.so + arm-none-eabi-objdump -M force-thumb-mode -d target3.original.so > target3.original.dump + arm-none-eabi-objdump -M force-thumb-mode -d target3.patched.so > target3.patched.dump + diff target3.original.dump target3.patched.dump > target3.diff \ No newline at end of file