Skip to content

Commit

Permalink
Jump to bootloader to resolve challenge instead of bruteforcing
Browse files Browse the repository at this point in the history
  • Loading branch information
mat1jaczyyy committed Jan 3, 2020
1 parent a37a686 commit f7717c7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SOURCES += src/flash/flash.c src/flash/settings.c
SOURCES += src/led/led.c src/led/palettes.c
SOURCES += src/send/send.c
SOURCES += src/sysex/sysex.c src/sysex/messages.c
SOURCES += src/other/challenge.c src/other/conversion.c src/other/tempo.c
SOURCES += src/other/conversion.c src/other/tempo.c

SOURCES += src/modes/mode.c
SOURCES += src/modes/normal/performance.c src/modes/normal/ableton.c src/modes/normal/note.c src/modes/normal/drum.c src/modes/normal/fader.c src/modes/normal/programmer.c src/modes/normal/piano.c src/modes/normal/text.c
Expand Down
Binary file modified build/cfw.syx
Binary file not shown.
13 changes: 0 additions & 13 deletions include/other/challenge.h

This file was deleted.

1 change: 0 additions & 1 deletion include/sysex/sysex.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "string.h"
#include "modes/mode.h"
#include "other/challenge.h"

void handle_sysex(u8 port, u8 * d, u16 l);

Expand Down
2 changes: 0 additions & 2 deletions src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ void app_timer_event() {

tempo_timer++; tempo_tick();

if (challenge_do) challenge_timer_event();

(*mode_timer_event[mode])();
}

Expand Down
21 changes: 0 additions & 21 deletions src/other/challenge.c

This file was deleted.

13 changes: 11 additions & 2 deletions src/sysex/sysex.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,17 @@ void handle_sysex(u8 port, u8 * d, u16 l) {
if (!memcmp(d, &syx_challenge[0], syx_challenge_length)) {
if (port == USBMIDI) {
if (l == 12) {
challenge_do = 1;
challenge_counter = 0;
u32 result = (* // wtf?

This comment has been minimized.

Copy link
@mat1jaczyyy

mat1jaczyyy Jan 3, 2020

Author Owner

@dvhdr hey I don't have to brute-force this anymore 🥇

(u32 (*)(u32)) // cast to function pointer
*(u32*)0x080000EC // grab pointer to challenge function from table
)( // call
*(u32*)(d + 7) // grab Live's challenge value
); // :b1:

syx_challenge_response[7] = result & 0x7F;
syx_challenge_response[8] = (result >> 8) & 0x7F;

hal_send_sysex(USBMIDI, &syx_challenge_response[0], syx_challenge_response_length);

} else if (l == 8) { // Live Quit Message
mode_default_update(mode_performance);
Expand Down

0 comments on commit f7717c7

Please sign in to comment.