From f3bc4a05de38ff1e4907501617c6400ce3b44508 Mon Sep 17 00:00:00 2001 From: Nigel Barink Date: Tue, 8 Sep 2020 20:34:43 +0200 Subject: [PATCH] Initial setup --- .gitignore | 14 ++++++++++++++ premake4.lua | 24 ++++++++++++++++++++++++ readme.md | 34 ++++++++++++++++++++++++++++++++++ src/recover.c | 7 +++++++ 4 files changed, 79 insertions(+) create mode 100644 .gitignore create mode 100644 premake4.lua create mode 100644 readme.md create mode 100644 src/recover.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..469fa3d --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# ignore binary directories +bin/ +build/ +results/ +rsc/ +# Ignore Visual studio +.vs/ +obj/ +*.vcxproj.user +*.vcxproj +*.sln + + + diff --git a/premake4.lua b/premake4.lua new file mode 100644 index 0000000..1b61805 --- /dev/null +++ b/premake4.lua @@ -0,0 +1,24 @@ +#!lua +solution "Rec0ver_H4rv4rd" + + configurations { "Debug", "Release" } + + project "Rec0ver Program" + basedir "./" + language "C" + + files { + "src/recover.c" + } + + kind "ConsoleApp" + targetname "recover" + targetdir "build/debug" + + configuration "Debug" + defines {"DEBUG"} + Symbols "On" + + configuration "Release" + defines {"NDEBUG"} + Optimize "On" \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..b80fc12 --- /dev/null +++ b/readme.md @@ -0,0 +1,34 @@ +# Rec0v3r h4rv4rd +## CS50 + +### Goal: +__Implement a program that recovers JPEGs from a forensic image, per the below.__ + +```cmd +$ ./recover card.raw +``` + +### Specification +Implement a program called recover ``recover`` that recovers JPEGs from a forensic image. + +* Implement your program in a file called ``recover.c`` ~~in a directory called ``recover``~~ + +* Your program should accept exactly one command-line argument, the name of a forensic image from which to recover JPEGs. + +* If your program is not executed with exactly one command-line argument, it should remind the user of correct usage, and ``main`` should return ``1``. + +* Your program, if it uses ``malloc``, must not leak any memory. + +### Usage + +Your program should behave per the examples below. + +```cmd +$ ./recover +Usage: ./recover image +``` + +```cmd +$ ./recover card.raw +``` + diff --git a/src/recover.c b/src/recover.c new file mode 100644 index 0000000..1a403e9 --- /dev/null +++ b/src/recover.c @@ -0,0 +1,7 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + printf("Hello world!"); +}