Skip to content

Commit

Permalink
fixup hackathon Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Nov 15, 2023
1 parent ef65630 commit f3a2a44
Showing 1 changed file with 51 additions and 34 deletions.
85 changes: 51 additions & 34 deletions demos/nov-2023/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
-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

0 comments on commit f3a2a44

Please sign in to comment.