MCPcopy Create free account
hub / github.com/DacoTaco/priiloader / WriteUpdateFile

Function WriteUpdateFile

tools/HashGenerator/HashGenerator.cpp:85–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85char WriteUpdateFile(UpdateStruct* update)
86{
87 //write the version file
88 printf("writing v2 version file...\n");
89 FILE* outputBin = fopen("versionV2.bin", "wb");
90 FILE* outputDat = fopen("versionV2.dat", "wb");
91 if (!outputBin || !outputDat)
92 {
93 if (outputBin)
94 fclose(outputBin);
95 if (outputDat)
96 fclose(outputDat);
97
98 printf("failed to open/create file!\n");
99 return -1;
100 }
101
102 fwrite(update, 1, sizeof(UpdateStruct), outputBin);
103 fwrite(update, 1, sizeof(UpdateStruct), outputDat);
104 fclose(outputBin);
105 fclose(outputDat);
106 printf("done!\n");
107 return 1;
108}
109
110char CalculateBinaryHash(char* filename, unsigned int* hash)
111{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected