mirror of
https://github.com/nigelbarink/R3c0v3r.git
synced 2026-02-14 10:20:50 +00:00
started openening and reading file. Added copy instruction to premake file. TODO: correctly add premake copy instruction as a build step
This commit is contained in:
@@ -2,6 +2,39 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
printf("Hello world!");
|
||||
{
|
||||
FILE* file = fopen("G:\\Users\\Nigel\\Code\\Rec0ver_H4rv4rd\\rsc\\card.raw", "rb");
|
||||
if (!file) {
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
const char* ReadBuffer = malloc(sizeof(char) * 512);
|
||||
if (ReadBuffer == NULL) {
|
||||
exit(-2);
|
||||
}
|
||||
|
||||
|
||||
int read = 0 ;
|
||||
int total_read = 0;
|
||||
do {
|
||||
read = fread(ReadBuffer, sizeof(char), 512, file);
|
||||
total_read += read;
|
||||
printf("==============Begin Block==============\n");
|
||||
for (int i = 0; i < 512 ; i++)
|
||||
{
|
||||
if ( i % 50 == 0){
|
||||
printf("\n");
|
||||
}
|
||||
printf("%x", ReadBuffer[i]);
|
||||
}
|
||||
printf("==============End Block===============\n");
|
||||
|
||||
printf("Bytes read total : %X\n", total_read);
|
||||
|
||||
} while (read != 0);
|
||||
|
||||
printf("Total read: %i bytes\n", total_read);
|
||||
|
||||
free(ReadBuffer);
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user