Initial commit
This commit is contained in:
commit
b073f2ebd5
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by makepkg 5.1.3
|
||||||
|
# Thu Mar 21 11:36:16 UTC 2019
|
||||||
|
pkgbase = amiitool
|
||||||
|
pkgdesc = Reverse-engineered amiibo cryptography
|
||||||
|
pkgver = 2
|
||||||
|
pkgrel = 1
|
||||||
|
url = https://github.com/socram8888/amiitool
|
||||||
|
arch = any
|
||||||
|
license = MIT
|
||||||
|
makedepends = git
|
||||||
|
makedepends = mbedtls
|
||||||
|
source = amiitool-r2.tar.gz::https://github.com/socram8888/amiitool/archive/r2.tar.gz
|
||||||
|
source = fix-mbedtls_include.patch
|
||||||
|
md5sums = a3c193286e4930fa903d742424f5cad5
|
||||||
|
md5sums = ec7d604b88be91eea182d9d5da73f413
|
||||||
|
|
||||||
|
pkgname = amiitool
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Contributor: TBK <alpine@jjtc.eu>
|
||||||
|
# Maintainer: TBK <alpine@jjtc.eu>
|
||||||
|
pkgname=amiitool
|
||||||
|
pkgver=2
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='Reverse-engineered amiibo cryptography'
|
||||||
|
url='https://github.com/socram8888/amiitool'
|
||||||
|
arch=('any')
|
||||||
|
license=('MIT')
|
||||||
|
makedepends=('git' 'mbedtls') # git is used to pull head version
|
||||||
|
source=("$pkgname-r$pkgver.tar.gz::https://github.com/socram8888/amiitool/archive/r$pkgver.tar.gz"
|
||||||
|
fix-mbedtls_include.patch)
|
||||||
|
md5sums=('a3c193286e4930fa903d742424f5cad5'
|
||||||
|
'ec7d604b88be91eea182d9d5da73f413')
|
||||||
|
_builddir="$pkgname-r$pkgver"
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "_$builddir"
|
||||||
|
patch -p1 < "${srcdir}/fix-mbedtls_include.patch"
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "_$builddir"
|
||||||
|
make prefix=/usr
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "_$builddir"
|
||||||
|
make prefix=/usr DESTDIR="$pkgdir" install
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
+++ a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -19,7 +19,7 @@
|
||||||
|
bindir = $(exec_prefix)/bin
|
||||||
|
|
||||||
|
# mbed TLS libraries
|
||||||
|
-MBEDTLS_DIR = $(PWD)/mbedtls
|
||||||
|
+MBEDTLS_DIR = /usr/include/
|
||||||
|
MBEDTLS_CONFIG = $(PWD)/configs/mbedtls.h
|
||||||
|
MBEDTLS_CFLAGS = -DMBEDTLS_CONFIG_FILE='\"$(MBEDTLS_CONFIG)\"' $(CFLAGS)
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@
|
||||||
|
# Default target: compile all programs
|
||||||
|
all: $(BINS)
|
||||||
|
|
||||||
|
-%: %.o $(LIBSOBJ) $(STATICLIBS)
|
||||||
|
+%: %.o $(LIBSOBJ)
|
||||||
|
$(CC) $(ALL_CFLAGS) $(LIBSOBJ) $< -o $@ $(LDFLAGS)
|
||||||
|
|
||||||
|
%.o: %.c $(HEADERS)
|
||||||
|
|
||||||
|
--- a/configs/mbedtls.h
|
||||||
|
+++ b/configs/mbedtls.h
|
||||||
|
@@ -24,6 +24,6 @@
|
||||||
|
#define MBEDTLS_HAVE_ASM
|
||||||
|
#define MBEDTLS_PLATFORM_C
|
||||||
|
|
||||||
|
-#include "mbedtls/check_config.h"
|
||||||
|
+#include <mbedtls/check_config.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
--- a/amiibo.c
|
||||||
|
+++ b/amiibo.c
|
||||||
|
@@ -7,8 +7,8 @@
|
||||||
|
|
||||||
|
#include "nfc3d/amiibo.h"
|
||||||
|
#include "util.h"
|
||||||
|
-#include "mbedtls/md.h"
|
||||||
|
-#include "mbedtls/aes.h"
|
||||||
|
+#include <mbedtls/md.h>
|
||||||
|
+#include <mbedtls/aes.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include "portable_endian.h"
|
||||||
|
|
||||||
|
--- a/include/nfc3d/drbg.h
|
||||||
|
+++ b/include/nfc3d/drbg.h
|
||||||
|
@@ -10,7 +10,7 @@
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
-#include "mbedtls/md.h"
|
||||||
|
+#include <mbedtls/md.h>
|
||||||
|
|
||||||
|
#define NFC3D_DRBG_MAX_SEED_SIZE 480 /* Hardcoded max size in 3DS NFC module */
|
||||||
|
#define NFC3D_DRBG_OUTPUT_SIZE 32 /* Every iteration generates 32 bytes */
|
||||||
Loading…
Reference in New Issue