From: hackbard Date: Mon, 14 Mar 2011 15:33:58 +0000 (+0100) Subject: added tool to extract elecard efp files X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=67d2a6cfaefba4da5210ee179cf93252fde0752a;p=my-code%2Fpnx.git added tool to extract elecard efp files --- 67d2a6cfaefba4da5210ee179cf93252fde0752a 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