Index: branches/2020Q2/sysutils/memfetch/Makefile =================================================================== --- branches/2020Q2/sysutils/memfetch/Makefile (revision 536239) +++ branches/2020Q2/sysutils/memfetch/Makefile (revision 536240) @@ -1,32 +1,30 @@ # Created by: Yonatan # $FreeBSD$ PORTNAME= memfetch PORTVERSION= 0.05b CATEGORIES= sysutils MASTER_SITES= http://lcamtuf.coredump.cx/soft/ DISTNAME= ${PORTNAME} MAINTAINER= onatan@gmail.com COMMENT= Utility to dump memory of a running process -BROKEN= unfetchable - LICENSE= GPLv2 USES= perl5 shebangfix tar:tgz USE_PERL5= run MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}" SHEBANG_FILES= mffind.pl WRKSRC= ${WRKDIR}/${PORTNAME} OPTIONS_DEFINE= DOCS do-install: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin ${INSTALL_SCRIPT} ${WRKSRC}/mffind.pl ${STAGEDIR}${PREFIX}/bin @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR} .include Index: branches/2020Q2/sysutils/memfetch/distinfo =================================================================== --- branches/2020Q2/sysutils/memfetch/distinfo (revision 536239) +++ branches/2020Q2/sysutils/memfetch/distinfo (revision 536240) @@ -1,2 +1,3 @@ -SHA256 (memfetch.tgz) = 923fe5dc11e4bcd611853c42d637da11941ea83c7f53d5c16f741be116573140 -SIZE (memfetch.tgz) = 12435 +TIMESTAMP = 1588564241 +SHA256 (memfetch.tgz) = bf5fd71fa645c19b2ad6cd9b578837dfb8cffcd2d2d6691b2cc43fd87c510e09 +SIZE (memfetch.tgz) = 12438 Index: branches/2020Q2/sysutils/memfetch/files/patch-memfetch.c =================================================================== --- branches/2020Q2/sysutils/memfetch/files/patch-memfetch.c (revision 536239) +++ branches/2020Q2/sysutils/memfetch/files/patch-memfetch.c (revision 536240) @@ -1,111 +1,111 @@ --- memfetch.c.orig Mon Oct 20 20:04:45 2003 +++ memfetch.c Thu Nov 25 15:51:00 2004 @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include #include @@ -27,7 +29,8 @@ #include #include #include -#include +/* #include */ +#include #include #include @@ -49,7 +52,7 @@ fprintf(outfile,"** Error message: " x); \ fclose(outfile); \ } \ - if (tracepid>0) ptrace(PTRACE_DETACH,tracepid,0,lastsig); \ + if (tracepid>0) ptrace(PT_DETACH,tracepid,0,lastsig); \ exit(1); \ } @@ -74,6 +77,7 @@ " -a - skip non-anonymous maps (libraries etc)\n" " -w - write index file to stdout instead of mfetch.lst\n" " -m - avoid mmap(), helps prevent hanging on some 2.2 boxes\n" + " - this is the only way to go on FreeBSD, for now.\n" " -S xxx - dump segment containing address xxx (hex) only\n",myname); exit(3); } @@ -124,7 +128,7 @@ if (kill(tracepid,0)) fatal("Process does not exist or is not accessible.\n"); - if (ptrace(PTRACE_ATTACH,tracepid,0,0)) + if (ptrace(PT_ATTACH,tracepid,0,0)) fatal("Cannot attach to this process (already traced?).\n"); if ( wait(&st)<=0 || !WIFSTOPPED(st) ) { @@ -149,7 +153,7 @@ while (1) { - ptrace(PTRACE_CONT,tracepid,0,lastsig); + ptrace(PT_CONTINUE,tracepid,0,lastsig); if (wait(&st)<=0) { debug("[-] Process gone before receiving a fault signal.\n"); @@ -198,7 +202,7 @@ leavewait: // GOTOs for president! - sprintf(tmp,"/proc/%d/maps",tracepid); + sprintf(tmp,"/proc/%d/map",tracepid); mapfile=fopen(tmp,"r"); if (!mapfile) fatal("Cannot open %s for reading.\n",tmp); @@ -237,8 +241,8 @@ int* writeptr; char mapped=1; - if (sscanf(tmp,"%x-%x",&st,&en)!=2) { - debug("[!] Parse error in /proc/%d/maps (mockery?): %s",tracepid,tmp); + if (sscanf(tmp,"%x %x",&st,&en)!=2) { + debug("[!] Parse error in /proc/%d/map (mockery?): %s",tracepid,tmp); continue; } @@ -280,7 +284,7 @@ st,len); if (avoid_mmap) writeptr=MAP_FAILED; else { -- for (i=st;i<=en;i+=PAGE_SIZE) ptrace(PTRACE_PEEKDATA,tracepid,i,0); -+ for (i=st;i<=en;i+=PAGE_SIZE) ptrace(PT_READ_D,tracepid,(caddr_t)i,0); +- for (i=st;i