summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-10-08 21:09:16 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-10-08 21:09:16 -0400
commit952dae6d912e080bec84034cf6341fdb140fd5a7 (patch)
tree1656e2692417f5e7ac74101ebb7b7d4511f67b6c
parentapp-portage/grs: moved to tree. (diff)
downloadblueness-952dae6d912e080bec84034cf6341fdb140fd5a7.tar.gz
blueness-952dae6d912e080bec84034cf6341fdb140fd5a7.tar.bz2
blueness-952dae6d912e080bec84034cf6341fdb140fd5a7.zip
dev-utils/elfsh: getting ready to move it off the tree.
Package-Manager: portage-2.2.20.1 Manifest-Sign-Key: 0x9384FA6EF52D4BBA
-rw-r--r--dev-util/elfsh/Manifest7
-rw-r--r--dev-util/elfsh/elfsh-0.51_beta3.ebuild43
-rw-r--r--dev-util/elfsh/elfsh-0.65_rc1.ebuild59
-rw-r--r--dev-util/elfsh/files/0.51_beta3-gentoo.patch63
-rw-r--r--dev-util/elfsh/files/elfsh-0.51_beta3-glibc210.patch70
-rw-r--r--dev-util/elfsh/metadata.xml10
6 files changed, 252 insertions, 0 deletions
diff --git a/dev-util/elfsh/Manifest b/dev-util/elfsh/Manifest
new file mode 100644
index 0000000..a160b2e
--- /dev/null
+++ b/dev-util/elfsh/Manifest
@@ -0,0 +1,7 @@
+AUX 0.51_beta3-gentoo.patch 2027 SHA256 7e2ca434936f97c2726ebf5c1bae92f67b4d0f4de7bbfba9719447eb566da32d SHA512 52e9f9b3d126fc7b0090588d2e9d5265e941ee23a9ba18b7ac20fb5bbb4621d64ebe71339278c0451ab4e2d0ab1c87ed71fc487880fa0f24844ed5a5942fa806 WHIRLPOOL 5957a690106ac0cedd3bbdf5780f83f15d6e72adf2d6b16f2d4004f40e9d7c18d3449faff2de973094b597a8d3ef2acce2243cfbaefcb3e272c248237f0677d4
+AUX elfsh-0.51_beta3-glibc210.patch 2426 SHA256 9b6cff64b5448268f761967217cde3fab051b1885c18240888b37a95966fa0d0 SHA512 b3062af7eea9229f1216479c6915057dae6eca72e4d460c7b3f0ba7026491d0c8abdd60a16e2ed363aa533ae1c06eeb0433c75466e8714194c48fd88d1f55c72 WHIRLPOOL a06c291923799baa39638fcb28daf60dcd6247df4b30a171126a035f43697e8e9a3c1635bf47215b6a2ea07780b9853663c6c3df6f5c5ed540daad98cbcc7fc1
+DIST elfsh-0.51b3-portable.tgz 136679 SHA256 ecffe100d0da12235cfe464726313491409739493030f3fbdb3a28696b23447f SHA512 3af4a7f031e830c24ecd05701c4ade052845cdd3808f6d5b60f19f8fff3ffa66f2edd1490fc62b9bbd8ac51d7c8aadb045fc2d369c885eb47a33210690f1c9df WHIRLPOOL 3d19b1bca64ebf98de3637978531bd1823c1f4b5fa9d2144873be9cf91c3c7771abb33b42107a156cfe7ca52ee0af33a5837581250ead29fa3a937883f946592
+DIST elfsh-0.65_rc1.zip 444993 SHA256 740e0bda6c368cbf7ceb6082e038d84c155220666c4edbb8dc8724b83d4feb93 SHA512 4268b29467cecfa661b4162214f1dc9dd9e465558aa62aa5ee412c6533a0405e3783c536d8e5bee420f87b636aafa4d1902d9f5b1b6fe0a3ad771894cd05ac76 WHIRLPOOL 89cef773854537865ef0f7a88dbcc44046ddfa8096c01a71f90719bdcc231d659b5d56767649c7d955e3e1d10dfe5673817d642b6ad8a2414b2295dfe3aedea4
+EBUILD elfsh-0.51_beta3.ebuild 1072 SHA256 0bd6b022c0239bb2bce3496136d3254935c92c44b26bec2c215703c9eca417cb SHA512 2631ff72218aa2a82e1230fd28f32645bf94ce19e2f2b21427de3af97385ea1fb9e000247a070b904f3cdfb3805c47e066746066be03a06e628df7c5421981e9 WHIRLPOOL 9e7a05bcff90d2737bf2bc1cab8d3ece08c4f41e56de42253400ba8d49afca7997fe632dc7cae3beac0f46b32c78c770690d7c75b113a4dc7d5e3fa6827926b2
+EBUILD elfsh-0.65_rc1.ebuild 1327 SHA256 d830cb56a4445761df2bd905b2f2b01c87d8b7f9422b1a830309c20af4a7aa35 SHA512 97055ca88ad9870ce17caa79ec01c579842bfff1d9a614e99f50afe4353fa94c20dc26fee943e8af8c54a5ae2163fff1e1cd5df364cbc2bf4f66c4740d89aa31 WHIRLPOOL 08318d73f3832ecb8f1b23db01089360852b49607938ed3530ff9b054851d508caa7ed3652d65990253924c5eddac127f789e4ac903bc0870324695eccc2b1dd
+MISC metadata.xml 578 SHA256 852586b5dae5c1647fb4772dc6f1a8f29d6f6cf78e4ce15d43f3cbb4fdabda35 SHA512 824b118337396eb7041dad98e8e255b0559e02d022dc0e5b15c061373ad512cbb343d22608c70948e1bf86036d7c8caac9232b8c5cd510e6e2ae11c4ef4b8b12 WHIRLPOOL 92e17d208cdd2616ab4dd013db5e1e8d1d1fda2cb901167f001aff888d44a8be4e12a2566682c418b78c55d7982d164255e0c40a30b81b777007da33c45d82d2
diff --git a/dev-util/elfsh/elfsh-0.51_beta3.ebuild b/dev-util/elfsh/elfsh-0.51_beta3.ebuild
new file mode 100644
index 0000000..b7ebaac
--- /dev/null
+++ b/dev-util/elfsh/elfsh-0.51_beta3.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils multilib toolchain-funcs
+
+MY_PV=${PV/_beta/b}
+S=${WORKDIR}/${PN}-${MY_PV}
+DESCRIPTION="scripting language to modify ELF binaries"
+HOMEPAGE="http://www.eresi-project.org/"
+SRC_URI="mirror://gentoo/elfsh-${MY_PV}-portable.tgz"
+#http://elfsh.segfault.net/files/elfsh-${MY_PV}-portable.tgz
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND=">=dev-libs/expat-1.95"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PV}-gentoo.patch
+ epatch "${FILESDIR}"/${P}-glibc210.patch
+ sed -i \
+ -e "s:-g3 -O2:${CFLAGS}:" \
+ -e "s:\$(CC):& \$(CFLAGS) \$(ELDFLGS): "\
+ `find -name Makefile` \
+ || die
+ sed -i -e "s:LIBPATH = \$(PREFIX)/lib:LIBPATH = \$(PREFIX)/$(get_libdir):" Makefile
+
+}
+
+src_compile() {
+ # emacs does not have to be a requirement.
+ emake CC=$(tc-getCC) ETAGS=echo ELDFLGS="${LDFLAGS}" || die "emake failed"
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die "einstall failed"
+}
diff --git a/dev-util/elfsh/elfsh-0.65_rc1.ebuild b/dev-util/elfsh/elfsh-0.65_rc1.ebuild
new file mode 100644
index 0000000..4b481d8
--- /dev/null
+++ b/dev-util/elfsh/elfsh-0.65_rc1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="scripting language to modify ELF binaries"
+HOMEPAGE="http://www.eresi-project.org/"
+SRC_URI="mirror://gentoo/${P}.zip"
+#http://www.eresi-project.org/browser/tags/elfsh_0_65rc1
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="readline"
+
+DEPEND=">=dev-libs/expat-1.95
+ readline? ( sys-libs/readline )
+ app-arch/unzip
+ dev-libs/libhash"
+RDEPEND=""
+
+S="${WORKDIR}/tags/elfsh_0_65rc1"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -i \
+ -e 's: -O2 : :g' \
+ -e "s: -g3 : ${CFLAGS} :" \
+ -e "/^LDFLAGS/s:=:=${LDFLAGS} :" \
+ $(find -name Makefile) \
+ || die
+ chmod +x configure
+}
+
+src_compile() {
+ local bits
+ touch foo.c && $(tc-getCC) -c foo.c -o foo.o || die
+ case $(file foo.o) in
+ *64-bit*) bits=64;;
+ *32-bit*) bits=32;;
+ *) die "unknown bits: $(file foo.o)";;
+ esac
+ # not an autoconf script
+ ./configure \
+ $([[ ${bits} == "64" ]] && echo "--enable-m64") \
+ --enable-${bits} \
+ $(use_enable readline) \
+ || die
+ # emacs does not have to be a requirement.
+ emake ETAGS=echo || die "emake failed"
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die "install failed"
+ dodoc README.FIRST doc/AUTHOR doc/CREDITS doc/Changelog doc/*.txt
+ doman doc/*.1
+}
diff --git a/dev-util/elfsh/files/0.51_beta3-gentoo.patch b/dev-util/elfsh/files/0.51_beta3-gentoo.patch
new file mode 100644
index 0000000..26c4f7b
--- /dev/null
+++ b/dev-util/elfsh/files/0.51_beta3-gentoo.patch
@@ -0,0 +1,63 @@
+diff -ur elfsh-0.51b3.orig/Makefile elfsh-0.51b3/Makefile
+--- elfsh-0.51b3.orig/Makefile 2004-09-20 22:20:22.152723392 -0400
++++ elfsh-0.51b3/Makefile 2004-09-20 22:21:37.270303784 -0400
+@@ -5,12 +5,14 @@
+ ## Last update Sun May 25 18:12:43 2003 mayhem
+ ##
+
++DESTDIR = /
++PREFIX = $(DESTDIR)/usr
+ RM = rm -f
+ ETAGS = etags
+-MODPATH = /usr/share/elfsh/
+-BINPATH = /usr/bin
+-LIBPATH = /usr/lib/
+-INCPATH = /usr/include/
++BINPATH = $(PREFIX)/bin
++LIBPATH = $(PREFIX)/lib
++INCPATH = $(PREFIX)/include
++MODPATH = $(LIBPATH)/elfsh
+
+ all :
+ @echo 'Builting libelfsh...'
+@@ -32,14 +34,15 @@
+ #$(MAKE) -s tags
+
+ install : mod_install
++ @mkdir -p $(BINPATH) $(LIBPATH) $(INCPATH)
+ @cp vm/elfsh $(BINPATH)/
+ @cp libelfsh/libelfsh.a libelfsh/libelfsh.so $(LIBPATH)
+ @cp libelfsh/include/libelfsh*.h $(INCPATH)
+- @chmod 755 $(BINPATH)/elfsh $(LIBPATH)libelfsh.so $(LIBPATH)libelfsh.a $(INCPATH)libelfsh*.h
++ @chmod 755 $(BINPATH)/elfsh $(LIBPATH)/libelfsh.so
+ @echo 'ELFsh and Libelfsh installed successfully .'
+
+ mod_install:
+- @mkdir $(MODPATH) 2>/dev/null || true
++ @mkdir -p $(MODPATH)
+ @cp modules/*.so $(MODPATH)
+ @chmod -R 755 $(MODPATH)
+
+diff -ur elfsh-0.51b3.orig/vm/Makefile elfsh-0.51b3/vm/Makefile
+--- elfsh-0.51b3.orig/vm/Makefile 2004-09-20 22:20:22.117728712 -0400
++++ elfsh-0.51b3/vm/Makefile 2004-09-20 22:22:17.807141248 -0400
+@@ -13,6 +13,7 @@
+ #DLOPT_linux-gnu = -ldl
+ #DLOPT_solaris = -ldl
+ #EXTRAOPT = -lefence
++EXTRAOPT = -ldl
+
+ # Uncomment that to use libasm
+ #ASMOPT = -DUSE_LIBASM
+diff -ur elfsh-0.51b3.orig/vm/include/elfsh.h elfsh-0.51b3/vm/include/elfsh.h
+--- elfsh-0.51b3.orig/vm/include/elfsh.h 2004-09-20 22:20:22.116728864 -0400
++++ elfsh-0.51b3/vm/include/elfsh.h 2004-09-20 22:20:22.358692080 -0400
+@@ -94,7 +94,7 @@
+ #define ELFSH_SHELL "/bin/bash"
+ #define ELFSH_INIT "elfsh_init"
+ #define ELFSH_FINI "elfsh_fini"
+-#define ELFSH_MODPATH "/usr/share/elfsh/"
++#define ELFSH_MODPATH "/usr/lib/elfsh/"
+
+ /* For elfsh/elfsh/disasm.c:display_object() */
+ #define ELFSH_HEXA_VIEW 0
diff --git a/dev-util/elfsh/files/elfsh-0.51_beta3-glibc210.patch b/dev-util/elfsh/files/elfsh-0.51_beta3-glibc210.patch
new file mode 100644
index 0000000..2e83c93
--- /dev/null
+++ b/dev-util/elfsh/files/elfsh-0.51_beta3-glibc210.patch
@@ -0,0 +1,70 @@
+diff -NrU5 elfsh-0.51b3.original/modules/modgraph.c elfsh-0.51b3/modules/modgraph.c
+--- elfsh-0.51b3.original/modules/modgraph.c 2009-07-22 23:17:51.000000000 -0600
++++ elfsh-0.51b3/modules/modgraph.c 2009-07-22 23:33:28.000000000 -0600
+@@ -181,11 +181,11 @@
+ }
+ }
+ else
+ {
+ name = elfsh_reverse_metasym(world.current, blk->vaddr, &off);
+- dprintf(fd, "%s_%08x", name, off);
++ d_printf(fd, "%s_%08x", name, off);
+
+ }
+ free(buffer);
+ world.state.vm_quiet = vm_quiet;
+ }
+diff -NrU5 elfsh-0.51b3.original/vm/disasm.c elfsh-0.51b3/vm/disasm.c
+--- elfsh-0.51b3.original/vm/disasm.c 2009-07-22 23:17:51.000000000 -0600
++++ elfsh-0.51b3/vm/disasm.c 2009-07-22 23:33:53.000000000 -0600
+@@ -80,30 +80,30 @@
+
+ /* Are we in quiet mode ? */
+ if (world.state.vm_quiet)
+ {
+ snprintf(buf, sizeof(buf), " %08X %s + %u", vaddr + index, name, nindex);
+- dprintf(fd, "%-40s %-30s ", buf, s);
++ d_printf(fd, "%-40s %-30s ", buf, s);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), " %08X [foff: %u] %s + %u",
+ vaddr + index, foffset + index, name, nindex);
+- dprintf(fd, "%-60s %-50s ", buf, s);
++ d_printf(fd, "%-60s %-50s ", buf, s);
+ }
+
+ /* Print bytes in hexa for this instruction */
+ ret = asm_instr_len(&ptr);
+ if (!ret)
+ ret++;
+
+ if (!world.state.vm_quiet)
+ for (idx_bytes = 0; idx_bytes < ret; idx_bytes++)
+- dprintf(fd, "%c%c ",
++ d_printf(fd, "%c%c ",
+ base[(buff[index + idx_bytes] >> 4) & 0x0F],
+ base[buff[index + idx_bytes] & 0x0F]);
+- dprintf(fd, "\n");
++ d_printf(fd, "\n");
+ return (ret);
+ }
+ #endif /* USE_LIBASM */
+
+
+diff -NrU5 elfsh-0.51b3.original/vm/include/elfsh.h elfsh-0.51b3/vm/include/elfsh.h
+--- elfsh-0.51b3.original/vm/include/elfsh.h 2009-07-22 23:17:51.000000000 -0600
++++ elfsh-0.51b3/vm/include/elfsh.h 2009-07-22 23:22:30.000000000 -0600
+@@ -469,11 +469,11 @@
+ int vm_getsort(u_int index, u_int argc, char **argv);
+ int vm_getdisasm(u_int index, u_int argc, char **argv);
+ int vm_gethexa(u_int index, u_int argc, char **argv);
+ int vm_getvarparams(u_int index, u_int argc, char **argv);
+
+-int dprintf(int fd, char *format, ...);
++int d_printf(int fd, char *format, ...);
+
+ /* Libasm resolve handler */
+ void do_resolve(void *data, u_int vaddr, char *, u_int);
+ u_int display_instr(int, u_int, u_int, u_int, u_int,
+ char *, u_int, char *);
diff --git a/dev-util/elfsh/metadata.xml b/dev-util/elfsh/metadata.xml
new file mode 100644
index 0000000..d48e561
--- /dev/null
+++ b/dev-util/elfsh/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>blueness@gentoo.org</email>
+</maintainer>
+<longdescription>
+ELFsh is an interactive and scriptable ELF machine to play with executable files, shared libraries and relocatable ELF32 objects. It is useful for daily binary manipulations such as on-the-fly patching, embedded code injection, and binary analysis in research fields such as reverse engineering, security auditing and intrusion detection.
+</longdescription>
+</pkgmetadata>