-
Notifications
You must be signed in to change notification settings - Fork 7
/
flashtool.h
60 lines (45 loc) · 1.37 KB
/
flashtool.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// golden
#ifndef _FLASHTOOL_H
#define _FLASHTOOL_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#include <sys/stat.h>
#include "aes.h"
#include "sha1.h"
#include "hmac-sha1.h"
#include "crypto.h"
#include "keymgr.h"
#include "slb2.h"
#include "nvs.h"
#include "southbridge.h"
#define FLASHTOOL_VERSION "v1.0"
#define FLASHTOOL_CREDITS "golden"
#define FLASHTOOL_KEYFILE "keyfile.bin"
#define FLASH_BLOCK_SIZE 0x200
#define FLASH_SIZE 0x2000000
#define FLASH_NUMBLOCKS (FLASH_SIZE / FLASH_BLOCK_SIZE)
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
struct consolemap_entry {
char *model; // model sometimes has a component like B01 or B01X, leave that off
char *southbridge;
//char *keyfile;
};
struct codename_entry {
char *codename;
char *realname;
char *comment;
};
extern int verbose;
extern int noverify;
extern struct consolemap_entry g_consolemap[];
extern struct codename_entry g_codenames[];
#define NUM_CONSOLES (sizeof(g_consolemap) / sizeof(g_consolemap[0]))
#define NUM_CODENAMES (sizeof(g_codenames) / sizeof(g_codenames[0]))
struct consolemap_entry *find_consolemap(char *model);
struct codename_entry *find_codename(char *codename);
void hexdump(unsigned char *data, int length, int newlines);
int dumpbin(unsigned char *filename, unsigned char *data, int length);
#endif /* _FLASHTOOL_H */