#include #include #include //Import our code #include "decrypt.h" #include "fileReader.h" #include "utils/min.h" int main(int argc, unsigned char *argv[]) { printf("Hello World!\n"); //TODO: verify argv and assign it to variables //Initialise file reader initFileReader("1234", 0UL); //Skip header (30 bytes + additional length) char* fileHeader = getBytes(30UL); printf(fileHeader); //TODO: check that header is correct //Initialise decryption (pass decryption keys) initDecryptor(0, 0, 0);//TODO //Skip 12-byte encryption header char* encryptionHeader = getBytes(12UL); decrypt(encryptionHeader, 12); //Read actual file unsigned long remainingBytes = 0xFFFF;//TODO while (remainingBytes > 0) { const unsigned long chunkSize = min(0xFF, remainingBytes); char* chunk = getBytes(chunkSize); remainingBytes -= chunkSize; decrypt(chunk, chunkSize); //Decompress file //TODO //Optionally perform xdelta3 //TODO } return 0; }