Sunday, April 29, 2012

My md5sum

This is a little example of a md5 sum application, using the Hash lib.

#include "commons.h"
#include "Hash.h"
#include <stdio.h>
int main(int argc, char** argv)
{
if (argc == 2)
{
PHASH lpHash = {0};
if (newHash(&lpHash))
{
PCUBYTE pszHash = lpHash->md5File((PCUBYTE)*(argv + 1));
if (pszHash)
printf("[%s] %s", *(argv + 1), pszHash);
else
perror("Error : File not found : ");
}
else
perror("Error : Can't create a hash object : ");
}
else
perror("Error : Specify a file : ");
return 0;
}
view raw gistfile1.c hosted with ❤ by GitHub


Get a md5 sum of a entire device, here's a screenshoot.



Download Source

Enjoy!

No comments: