From 67d2a6cfaefba4da5210ee179cf93252fde0752a Mon Sep 17 00:00:00 2001 From: hackbard Date: Mon, 14 Mar 2011 16:33:58 +0100 Subject: [PATCH 1/1] added tool to extract elecard efp files --- efp_extract.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 efp_extract.c diff --git a/efp_extract.c b/efp_extract.c new file mode 100644 index 0000000..7198ef4 --- /dev/null +++ b/efp_extract.c @@ -0,0 +1,127 @@ +/* + * extract elecard efp files + * + * author: hackbard@hackdaworld.org + * + * build: gcc -Wall efp_extract -o efp_extract + * usage: ./efp_extract file.efp + * chmod 640 file_?? + * + * based on info from Muart232 + * http://www.mikrocontroller.net/topic/210759 + * + * elecard: + * http://www.elecard.com/forum/index.php?topic=4174.0 + * + */ + +#include +#include +#include +#include +#include +#include + +int getbytes(int fd,char *buf,int len) { + + int cnt,ret; + + cnt=len; + while(cnt) { + ret=read(fd,buf+len-cnt,cnt); + cnt-=ret; + } + + return 0; +} + +int hexprint(char *buf,int len) { + + int i; + + for(i=0;i