File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed
encrypted/hello_encrypted Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 11# Example encrypted binard
22add_executable (hello_encrypted
33 hello_encrypted.c
4+ secret.S
45 )
56
7+ # include secret.txt
8+ target_include_directories (hello_encrypted PRIVATE ${CMAKE_CURRENT_LIST_DIR} )
9+
10+ # add dependency on secret.txt
11+ set_property (SOURCE secret.S APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_LIST_DIR} /secret.txt)
12+
613# pull in common dependencies
714target_link_libraries (hello_encrypted pico_stdlib)
815
Original file line number Diff line number Diff line change @@ -20,11 +20,14 @@ int main() {
2020 rom_explicit_buy (buffer , 4096 );
2121 free (buffer );
2222#endif
23+ extern char secret_data [];
2324
2425 while (true) {
2526 printf ("Hello, world!\n" );
2627 printf ("I'm a self-decrypting binary\n" );
2728 printf ("My secret is...\n" );
2829 sleep_ms (1000 );
30+ printf (secret_data );
31+ sleep_ms (10000 );
2932 }
3033}
Original file line number Diff line number Diff line change 1+ .section .rodata
2+ .global secret_data
3+ secret_data:
4+ .incbin "secret.txt"
5+ .byte 0
Original file line number Diff line number Diff line change 1+ TODO: Put a funny secret here
You can’t perform that action at this time.
0 commit comments