================================================================================
Please, we need your help! The cotton candy machine is broken!
We replaced the SD card in the Cranberry Pi that controls it and reinstalled the
software. Now it's complaining that it can't find a registration file!
Perhaps you could figure out what the cotton candy software is looking for...
================================================================================
The binary is missing some configuration file:
kotton_kandy_co@d1c631b1cf57:~$ ./make_the_candy
Unable to open configuration file.
Let’s strace that file to see if we can find some missing dependency:
kotton_kandy_co@d1c631b1cf57:~$ strace ./make_the_candy
..
openat(AT_FDCWD, "registration.json", O_RDONLY) = -1 ENOENT (No such file or directory)
..
Let's create that file with some dummy content and run the binary again:
kotton_kandy_co@d1c631b1cf57:~$ touch registration.json
ton_kandy_co@d1c631b1cf57:~$ echo something >> registration.jso
kotton_kandy_co@d1c631b1cf57:~$ ./make_the_candy
Unregistered - Exiting.
Seems the binary expects that file to contain certain information, let’s ltrace that file (maybe we can found some function calls regarding the content):
kotton_kandy_co@d1c631b1cf57:~$ ltrace -S -f ./make_the_candy
..
[pid 26] strstr("something\n", "Registration") = nil
..
This way we can see the strings that are expected and we can rebuild the full configuration file:
kotton_kandy_co@d1c631b1cf57:~$ vim registration.json
kotton_kandy_co@d1c631b1cf57:~$ cat registration.json
Registration: True
kotton_kandy_co@d1c631b1cf57:~$ ./make_the_candy
Launching...