summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/sbtools/Makefile11
-rw-r--r--utils/sbtools/sb.h4
-rw-r--r--utils/sbtools/sbtoelf.c10
3 files changed, 12 insertions, 13 deletions
diff --git a/utils/sbtools/Makefile b/utils/sbtools/Makefile
index 9427eaf875..e8bb68aadd 100644
--- a/utils/sbtools/Makefile
+++ b/utils/sbtools/Makefile
@@ -1,9 +1,10 @@
1TGT = sbinfo 1all: elftosb sbtoelf
2 2
3all: $(TGT) 3sbtoelf: sbtoelf.c crc.c crypto.h aes128.c sha1.c elf.c sb.h
4 gcc -g -std=c99 -o $@ -W -Wall $^
4 5
5$(TGT): sbinfo.c crc.c crypto.h aes128.c sha1.c elf.c 6elftosb: elftosb.c crc.c crypto.h aes128.c sha1.c elf.c sb.h
6 $(CC) -g -std=c99 -o $(TGT) -W -Wall sbinfo.c aes128.c crc.c sha1.c elf.c 7 gcc -g -std=c99 -o $@ -W -Wall $^
7 8
8clean: 9clean:
9 rm -fr $(TGT) 10 rm -fr elftosb sbtoelf
diff --git a/utils/sbtools/sb.h b/utils/sbtools/sb.h
index 29b7d7d894..be25b4bf88 100644
--- a/utils/sbtools/sb.h
+++ b/utils/sbtools/sb.h
@@ -19,9 +19,7 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#define _ISOC99_SOURCE /* snprintf() */ 22#include <stdint.h>
23#include <sys/types.h>
24#include <sys/stat.h>
25 23
26#define BLOCK_SIZE 16 24#define BLOCK_SIZE 16
27 25
diff --git a/utils/sbtools/sbtoelf.c b/utils/sbtools/sbtoelf.c
index 632c4b3eb9..3eb168ddd1 100644
--- a/utils/sbtools/sbtoelf.c
+++ b/utils/sbtools/sbtoelf.c
@@ -78,9 +78,9 @@ const char *key_file;
78 78
79void *xmalloc(size_t s) /* malloc helper, used in elf.c */ 79void *xmalloc(size_t s) /* malloc helper, used in elf.c */
80{ 80{
81 void * r = malloc(s); 81 void * r = malloc(s);
82 if(!r) bugp("malloc"); 82 if(!r) bugp("malloc");
83 return r; 83 return r;
84} 84}
85 85
86static void print_hex(byte *data, int len, bool newline) 86static void print_hex(byte *data, int len, bool newline)
@@ -91,7 +91,7 @@ static void print_hex(byte *data, int len, bool newline)
91 printf("\n"); 91 printf("\n");
92} 92}
93 93
94int convxdigit(char digit, byte *val) 94static int convxdigit(char digit, byte *val)
95{ 95{
96 if(digit >= '0' && digit <= '9') 96 if(digit >= '0' && digit <= '9')
97 { 97 {
@@ -495,7 +495,7 @@ static void extract(unsigned long filesize)
495 int encrypted = !(sec_hdr->flags & SECTION_CLEARTEXT); 495 int encrypted = !(sec_hdr->flags & SECTION_CLEARTEXT);
496 496
497 color(GREEN); 497 color(GREEN);
498 printf(" Chunk "); 498 printf(" Section ");
499 color(YELLOW); 499 color(YELLOW);
500 printf("'%s'\n", name); 500 printf("'%s'\n", name);
501 color(GREEN); 501 color(GREEN);