Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled version? (or how to compile) #9

Open
Bangaio64 opened this issue Aug 19, 2017 · 20 comments
Open

Compiled version? (or how to compile) #9

Bangaio64 opened this issue Aug 19, 2017 · 20 comments

Comments

@Bangaio64
Copy link

Bangaio64 commented Aug 19, 2017

Would it be possible to provided a compiled version? I found one but it's old and it doesn't have the copy AppData functionality.

I got a VM with lubuntu and I have no clue what I'm doing:
git clone https://github.com/socram8888/amiitool.git
cd amiitool
git clone https://github.com/ARMmbed/mbedtls.git
make && sudo make install

I get an error:

make: *** No rule to make target '/configs/mbedtls.h', needed by 'mbedtls'. Stop.

Thanks.

@socram8888
Copy link
Owner

Try git submodule update --init --recursive inside the folder.

amiitool uses a static version of mbedtls which is included as a submodule.

@Bangaio64
Copy link
Author

Bangaio64 commented Aug 20, 2017

EDIT: nevermind, I'm a total linux noob and I didnt realize the make install command isn't necessary.

Thanks for the quick reply, but I still get the same error.

git clone https://github.com/socram8888/amiitool.git
cd amiitool
git submodule update --init --recursive
make && sudo make install

make: *** No rule to make target '/configs/mbedtls.h', needed by 'mbedtls'. Stop.

@socram8888
Copy link
Owner

Hm, it seems that your version of Make is not defining the $(PWD) variable which is used to pass mbedTLS the absolute path to the configuration header.

Can you tell me which OS are you using, and also the Make version (makefile --version)?

@socram8888
Copy link
Owner

As workaround, you should be able to compile it with:

git clone https://github.com/socram8888/amiitool.git
cd amiitool
git submodule update --init --recursive
make PWD=$(pwd) && sudo make install PWD=$(pwd)

@Bangaio64
Copy link
Author

lubuntu 15.10 / GNU Make 4.2

And it worked now with that workaround. Thanks!

@0milkyway0
Copy link

0milkyway0 commented Feb 19, 2018

Hello,
I take this thread to avoid creating a similar one ...
I would like to know how to compile under Windows? I tried to compile (cmder) with gcc under windows 10 and I get errors:

λ gcc -o amiitool.exe amiitool.c

gcc -o amiitool.exe amiitool.c amiitool.c: 8: 26: fatal error: nfc3d / amiibo.h: No such file or directory #include <nfc3d / amiibo.h> ^ compilation terminated.
Yet the class amiibo.h is present in the file nfc3d / amiibo.h

I also tried this without success:
λ mingw32-make

echo "#define GIT_COMMIT_ID 0xgit rev-parse HEAD | head -c8" > /gitversion.h fatal: Not a git repository (or any of the parent directories): .git echo "#define GIT_COMMIT_COUNT git rev-list --count --all" >> /gitversion.h fatal: Not a git repository (or any of the parent directories): .git mingw32-make: *** No rule to make target '/configs/mbedtls.h', needed by 'mbedtls'. Stop.

Thanks a lot for your help !

@socram8888
Copy link
Owner

socram8888 commented Feb 20, 2018

Mmm right now this isn't really useable as a library, since it's missing all the library compilation (ie compiling the library independently of the main executable)

If you're willing to change to Python, there's already a proper library written by a third party on PyPI (https://pypi.python.org/pypi/pyamiibo/)

For make to work, you'll need to clone the repository not download the zip, because it'll use the git command to automagically generate the version header.

@0milkyway0
Copy link

0milkyway0 commented Feb 20, 2018

I have already started coding a GUI in c.
So, would it really arrange me to be able to compile with your sources?
Could you tell me what to do and what is missing? I am only looking to create an interface capable of modifying the UID with that of the blank tag before writing.
Example:
https://games.kel.mn/en/companion-script-to-simplify-amiibo-cloning-with-arduino/

But under windows, and integrating it to a GUI

Thank you for listening!

@socram8888
Copy link
Owner

socram8888 commented Feb 20, 2018

git clone https://github.com/socram8888/amiitool/
cd amiitool
mingw32-make gitversion.h

That should do the job.

@0milkyway0
Copy link

not working:
λ mingw32-make gitversion.h echo "#define GIT_COMMIT_ID 0xgit rev-parse HEAD | head -c8" > /gitversion.h echo "#define GIT_COMMIT_COUNT git rev-list --count --all" >> /gitversion.h

compilation:
λ gcc -o amiitool.exe amiitool.c

amiitool.c:8:26: fatal error: nfc3d/amiibo.h: No such file or directory #include <nfc3d/amiibo.h> ^ compilation terminated.

@socram8888
Copy link
Owner

Seems to be missing yet again the "pwd" bit which is available somehow in my system.

Try PWD=$(pwd) mingw32-make gitversion.h

@socram8888
Copy link
Owner

As last resource, try creating a gitversion.h manually with:

#define GIT_COMMIT_ID 0xadda0295
#define GIT_COMMIT_COUNT 57

@socram8888
Copy link
Owner

socram8888 commented Feb 20, 2018

Hmmm have you included nfc3d folder in the compilation path?

I am not sure which IDE are you using, if any, but usually you'd give a directive such as:
gcc -Iamiitool/nfc3d yourfile.c -o yourexec so it knows where the headers are.

Note that's a dash followed by capital i.

At any rate, as is this can't be really used as a shared or static library, due to missing all the library compilation.

@0milkyway0
Copy link

Hi, thanks for your help, the changes you made in the MakeFile allowed me to go ahead;)
Thank you again for your work!

@papptallriik
Copy link

Hello! I'm a total noob to compiling so therefore I have been searching the web for several days, but always comes to dead ends. Everything that should work just doesn't, so this is my last option, to write here.

I'm just trying to compile and make an executable file, so I can start decrypting/encrypting etc, but nothing works.

In Windows 7 I've tried Cygwin and Mingw. The best result is an executable file that won't run (gets an error 0x00000013-ish). I think it has something to do with 32/64-bit?

In Ubuntu 18.04, gcc 7.3.0 was already installed, but it quits with an error that it can't find the include-file <nfc3d/amiibo.h>... I doesn't matter where I put that file, gcc just can't find it...

When I go with all the tricks you have written in this thread, it also fails. Writing that "make && sudo make install", it ends with that "no rule..."-error and the "git submodule --init --recursive" doesn't help...

I have no experience with compiling c-scripts, so I really don't know how to solve this. Can you try to help me?

@socram8888
Copy link
Owner

I have just tried again under Ubuntu Bionic (18.04.2) and it's working fine for me.

All I did was:

git clone https://github.com/socram8888/amiitool/
cd amiitool
git submodule update --init --recursive
make

Could you paste the exact output for the failed compilation?

@papptallriik
Copy link

I actually got it working on Ubuntu. Why it didn't work there was because of a 'space' in the folder name, so the compiler didn't find the files. Quite embarrassing...

But... I would really like to get it to compile on Windows, since I'm only emulating Ubuntu on VirtualBox, so it would help to get everything more smooth.

Right now I don't have any compiler installed under Windows 7, because they were all failing so I uninstalled them. Any recommendations of which to use? Cygwin? mingw? Something else...?

@socram8888
Copy link
Owner

I have successfully used MinGW64 under Ubuntu and Windows 10 WSL as explained above.

@Sam-Man16
Copy link

Sam-Man16 commented Oct 28, 2020

I have successfully used MinGW64 under Ubuntu and Windows 10 WSL as explained above.

I have followed all your steps above and the only error I am receiving is this: make[1]: Entering directory 'C:/Users/REDACTED/amiitool/mbedtls'
make[1]: *** No rule to make target 'lib'. Stop.
make[1]: Leaving directory 'C:/Users/REDACTED/amiitool/mbedtls'
make: *** [Makefile:57: mbedtls] Error 2
I am running Windows 10 x86.

EDIT: I am now getting:
"C:/Program Files/Git/mingw64/bin/make.exe" lib -C C:/Users/REDACTED/amiitool/mbedtls CFLAGS="-DMBEDTLS_CONFIG_FILE='"C:/Users/REDACTED/amiitool/configs/mbedtls.h"' -Wall -pedantic -O2 -fsigned-char"
make[1]: Entering directory 'C:/Users/REDACTED/amiitool/mbedtls'
make[2]: Entering directory 'C:/Users/REDACTED/amiitool/mbedtls/library'
CC aes.c
process_begin: CreateProcess(NULL, cc -Wall -W -Wdeclaration-after-statement -I../include -D_FILE_OFFSET_BITS=64 -DMBEDTLS_CONFIG_FILE="C:/Users/REDACTED/amiitool/configs/mbedtls.h" -Wall -pedantic -O2 -fsigned-char -c aes.c, ...) failed.
make (e=2): The system cannot find the file specified.
make[2]: *** [Makefile:162: aes.o] Error 2
make[2]: Leaving directory 'C:/Users/REDACTED/amiitool/mbedtls/library'
make[1]: *** [Makefile:18: lib] Error 2
make[1]: Leaving directory 'C:/Users/REDACTED/amiitool/mbedtls'
make: *** [Makefile:57: mbedtls] Error 2

@socram8888
Copy link
Owner

According to the "CreateProcess" line, it looks like problem is that your system is missing the cc.exe compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants