1
0
Fork 0
forked from len0rd/rockbox

nwztools/upgtools: add support for windows

In order to avoid the crypto++ mess, the code uses the Windows Cryptography API,
which is standard. There is also some makefile magic to cross-compile:
  make PREFIX=i686-w64-mingw32- EXE_EXT=.exe
I selected the option so that it should statically link supports libraries used
by gcc (slsj and libwinpthread).

Change-Id: Iaf07da23afe81ed217fb3921ce13367c5441514d
This commit is contained in:
Amaury Pouly 2020-06-17 23:31:31 +02:00
parent 05fa8fc343
commit 1f338f7078
9 changed files with 239 additions and 90 deletions

View file

@ -28,9 +28,7 @@
#include <stdarg.h>
#include <ctype.h>
#include "misc.h"
#include "elf.h"
#include <sys/stat.h>
#include "crypt.h"
#include "keysig_search.h"
#include "upg.h"
@ -197,10 +195,10 @@ static int extract_upg(int argc, char **argv)
}
g_in_file = argv[0];
FILE *fin = fopen(g_in_file, "r");
FILE *fin = fopen(g_in_file, "rb");
if(fin == NULL)
{
perror("Cannot open boot file");
perror("Cannot open UPG file");
return 1;
}
fseek(fin, 0, SEEK_END);