Skip to content

Commit

Permalink
cleanup target4 Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Nov 15, 2023
1 parent 904df6c commit ef65630
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export HACKATHON_NOV_2023=$(git rev-parse --show-toplevel)/../programtargets/Hackathon_November_23
export HACKATHON_NOV_2023=$(git rev-parse --show-toplevel)/../Hackathon_November_23
27 changes: 13 additions & 14 deletions demos/nov-2023/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.PHONY: target4 target4-self target1-self target3 target3-self
.PHONY: target4-patch1 target4 target4-self target1-self target3 target3-self

target4.original.exe:
cp "$(HACKATHON_NOV_2023)/Target 4 - Grid IDPS (ARM Cortex M7)/build/Amp_Chal_IDPS_Unpatched.ino.elf" $@

target4.patched.exe:
target4-master:
cp "$(HACKATHON_NOV_2023)/Target 4 - Grid IDPS (ARM Cortex M7)/build/Amp_Chal_IDPS_Patched.ino.elf" $@

target4.csv:
cp "$(HACKATHON_NOV_2023)/Chal4Amp_Chal_IDPS.ino.elf.sym.csv" $@
echo "entry1, code:60001429, code:60001429" >> $@
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 \
Expand All @@ -19,14 +19,12 @@ target4-self: target4.original.exe target4.csv
-b target4.toml \
-e ContinueAfterRecoverableFailures \
-r AllowEqRescopeFailure \
-s entry1 \
-s FUN_00000138 \
-s FUN_00000f38 \
-s get_bitchunk \
--original-csv-function-hints target4.csv \
--patched-csv-function-hints target4.csv \
--save-macaw-cfgs target4_CFGs

target4: target4.original.exe target4.patched.exe
target4: target4.original.exe target4.patched.exe target4.csv
../../pate.sh \
--ignore-segments 1 \
--read-only-segments 3 \
Expand All @@ -35,15 +33,16 @@ target4: target4.original.exe target4.patched.exe
-b target4.toml \
-e ContinueAfterRecoverableFailures \
-r AllowEqRescopeFailure \
-s entry1 \
-s FUN_00000138 \
-s FUN_00000f38 \
-s FUN_00002178 \
-s FUN_00000e40 \
-s get_bitchunk \
--original-csv-function-hints target4.csv \
--patched-csv-function-hints target4.csv \
--save-macaw-cfgs 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
arm-none-eabi-objdump -M force-thumb-mode -d target4.patched.exe > target4.patched.dump
diff target4.original.dump target4.patched.dump > target4.diff

target1.original.exe:
cp "$(HACKATHON_NOV_2023)/Target 1 - NASA Lunar Relay Sat (powerpc)/cpu1/core-cpu1" $@

Expand Down

0 comments on commit ef65630

Please sign in to comment.