Skip to content

Commit

Permalink
Remove binary files from repo, make intermezzo path configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBuchanan314 committed May 21, 2018
1 parent e53a3af commit 1056c09
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ Mkfile.old
dkms.conf

fusee-nano
*.bin
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CC= gcc
CFLAGS= -Wall -Wpedantic -Wextra -std=c99 -Os
INTERMEZZO= ./intermezzo.bin
CFLAGS= -Wall -Wpedantic -Wextra -std=c99 -Os -DINTERMEZZO_PATH=\"$(INTERMEZZO)\"
OBJ= exploit.o usb.o
TARGET= fusee-nano
SRCDIR= ./src/
Expand Down
Binary file removed fusee.bin
Binary file not shown.
Binary file removed intermezzo.bin
Binary file not shown.
6 changes: 3 additions & 3 deletions src/exploit.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ int main(int argc, char *argv[])
*(uint32_t *)&payload_buf[payload_idx] = INTERMEZZO_LOCATION;

/* load intermezzo.bin */
if ((intermezzo_file = fopen("intermezzo.bin", "r")) == NULL) {
perror("[-] Failed to open intermezzo file");
if ((intermezzo_file = fopen(INTERMEZZO_PATH, "r")) == NULL) {
perror("[-] Failed to open " INTERMEZZO_PATH);
close(usb_fd);
return -1;
}

int intermezzo_len = fread(&payload_buf[payload_idx], 1, MAX_LENGTH-payload_idx, intermezzo_file);
fclose(intermezzo_file);
printf("[*] Read %d bytes from intermezzo.bin\n", intermezzo_len);
printf("[*] Read %d bytes from "INTERMEZZO_PATH"\n", intermezzo_len);

/* pad until payload */
payload_idx += PAYLOAD_LOAD_BLOCK - INTERMEZZO_LOCATION;
Expand Down

0 comments on commit 1056c09

Please sign in to comment.