1 |
commit: 952dae6d912e080bec84034cf6341fdb140fd5a7 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 9 01:09:16 2015 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 9 01:09:16 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/dev/blueness.git/commit/?id=952dae6d |
7 |
|
8 |
dev-utils/elfsh: getting ready to move it off the tree. |
9 |
|
10 |
Package-Manager: portage-2.2.20.1 |
11 |
Manifest-Sign-Key: 0x9384FA6EF52D4BBA |
12 |
|
13 |
dev-util/elfsh/Manifest | 7 +++ |
14 |
dev-util/elfsh/elfsh-0.51_beta3.ebuild | 43 +++++++++++++ |
15 |
dev-util/elfsh/elfsh-0.65_rc1.ebuild | 59 ++++++++++++++++++ |
16 |
dev-util/elfsh/files/0.51_beta3-gentoo.patch | 63 +++++++++++++++++++ |
17 |
.../elfsh/files/elfsh-0.51_beta3-glibc210.patch | 70 ++++++++++++++++++++++ |
18 |
dev-util/elfsh/metadata.xml | 10 ++++ |
19 |
6 files changed, 252 insertions(+) |
20 |
|
21 |
diff --git a/dev-util/elfsh/Manifest b/dev-util/elfsh/Manifest |
22 |
new file mode 100644 |
23 |
index 0000000..a160b2e |
24 |
--- /dev/null |
25 |
+++ b/dev-util/elfsh/Manifest |
26 |
@@ -0,0 +1,7 @@ |
27 |
+AUX 0.51_beta3-gentoo.patch 2027 SHA256 7e2ca434936f97c2726ebf5c1bae92f67b4d0f4de7bbfba9719447eb566da32d SHA512 52e9f9b3d126fc7b0090588d2e9d5265e941ee23a9ba18b7ac20fb5bbb4621d64ebe71339278c0451ab4e2d0ab1c87ed71fc487880fa0f24844ed5a5942fa806 WHIRLPOOL 5957a690106ac0cedd3bbdf5780f83f15d6e72adf2d6b16f2d4004f40e9d7c18d3449faff2de973094b597a8d3ef2acce2243cfbaefcb3e272c248237f0677d4 |
28 |
+AUX elfsh-0.51_beta3-glibc210.patch 2426 SHA256 9b6cff64b5448268f761967217cde3fab051b1885c18240888b37a95966fa0d0 SHA512 b3062af7eea9229f1216479c6915057dae6eca72e4d460c7b3f0ba7026491d0c8abdd60a16e2ed363aa533ae1c06eeb0433c75466e8714194c48fd88d1f55c72 WHIRLPOOL a06c291923799baa39638fcb28daf60dcd6247df4b30a171126a035f43697e8e9a3c1635bf47215b6a2ea07780b9853663c6c3df6f5c5ed540daad98cbcc7fc1 |
29 |
+DIST elfsh-0.51b3-portable.tgz 136679 SHA256 ecffe100d0da12235cfe464726313491409739493030f3fbdb3a28696b23447f SHA512 3af4a7f031e830c24ecd05701c4ade052845cdd3808f6d5b60f19f8fff3ffa66f2edd1490fc62b9bbd8ac51d7c8aadb045fc2d369c885eb47a33210690f1c9df WHIRLPOOL 3d19b1bca64ebf98de3637978531bd1823c1f4b5fa9d2144873be9cf91c3c7771abb33b42107a156cfe7ca52ee0af33a5837581250ead29fa3a937883f946592 |
30 |
+DIST elfsh-0.65_rc1.zip 444993 SHA256 740e0bda6c368cbf7ceb6082e038d84c155220666c4edbb8dc8724b83d4feb93 SHA512 4268b29467cecfa661b4162214f1dc9dd9e465558aa62aa5ee412c6533a0405e3783c536d8e5bee420f87b636aafa4d1902d9f5b1b6fe0a3ad771894cd05ac76 WHIRLPOOL 89cef773854537865ef0f7a88dbcc44046ddfa8096c01a71f90719bdcc231d659b5d56767649c7d955e3e1d10dfe5673817d642b6ad8a2414b2295dfe3aedea4 |
31 |
+EBUILD elfsh-0.51_beta3.ebuild 1072 SHA256 0bd6b022c0239bb2bce3496136d3254935c92c44b26bec2c215703c9eca417cb SHA512 2631ff72218aa2a82e1230fd28f32645bf94ce19e2f2b21427de3af97385ea1fb9e000247a070b904f3cdfb3805c47e066746066be03a06e628df7c5421981e9 WHIRLPOOL 9e7a05bcff90d2737bf2bc1cab8d3ece08c4f41e56de42253400ba8d49afca7997fe632dc7cae3beac0f46b32c78c770690d7c75b113a4dc7d5e3fa6827926b2 |
32 |
+EBUILD elfsh-0.65_rc1.ebuild 1327 SHA256 d830cb56a4445761df2bd905b2f2b01c87d8b7f9422b1a830309c20af4a7aa35 SHA512 97055ca88ad9870ce17caa79ec01c579842bfff1d9a614e99f50afe4353fa94c20dc26fee943e8af8c54a5ae2163fff1e1cd5df364cbc2bf4f66c4740d89aa31 WHIRLPOOL 08318d73f3832ecb8f1b23db01089360852b49607938ed3530ff9b054851d508caa7ed3652d65990253924c5eddac127f789e4ac903bc0870324695eccc2b1dd |
33 |
+MISC metadata.xml 578 SHA256 852586b5dae5c1647fb4772dc6f1a8f29d6f6cf78e4ce15d43f3cbb4fdabda35 SHA512 824b118337396eb7041dad98e8e255b0559e02d022dc0e5b15c061373ad512cbb343d22608c70948e1bf86036d7c8caac9232b8c5cd510e6e2ae11c4ef4b8b12 WHIRLPOOL 92e17d208cdd2616ab4dd013db5e1e8d1d1fda2cb901167f001aff888d44a8be4e12a2566682c418b78c55d7982d164255e0c40a30b81b777007da33c45d82d2 |
34 |
|
35 |
diff --git a/dev-util/elfsh/elfsh-0.51_beta3.ebuild b/dev-util/elfsh/elfsh-0.51_beta3.ebuild |
36 |
new file mode 100644 |
37 |
index 0000000..b7ebaac |
38 |
--- /dev/null |
39 |
+++ b/dev-util/elfsh/elfsh-0.51_beta3.ebuild |
40 |
@@ -0,0 +1,43 @@ |
41 |
+# Copyright 1999-2012 Gentoo Foundation |
42 |
+# Distributed under the terms of the GNU General Public License v2 |
43 |
+# $Id$ |
44 |
+ |
45 |
+inherit eutils multilib toolchain-funcs |
46 |
+ |
47 |
+MY_PV=${PV/_beta/b} |
48 |
+S=${WORKDIR}/${PN}-${MY_PV} |
49 |
+DESCRIPTION="scripting language to modify ELF binaries" |
50 |
+HOMEPAGE="http://www.eresi-project.org/" |
51 |
+SRC_URI="mirror://gentoo/elfsh-${MY_PV}-portable.tgz" |
52 |
+#http://elfsh.segfault.net/files/elfsh-${MY_PV}-portable.tgz |
53 |
+ |
54 |
+LICENSE="GPL-2" |
55 |
+SLOT="0" |
56 |
+KEYWORDS="~amd64 ~ppc ~x86" |
57 |
+IUSE="" |
58 |
+ |
59 |
+DEPEND=">=dev-libs/expat-1.95" |
60 |
+RDEPEND="${DEPEND}" |
61 |
+ |
62 |
+src_unpack() { |
63 |
+ unpack ${A} |
64 |
+ cd "${S}" |
65 |
+ epatch "${FILESDIR}"/${PV}-gentoo.patch |
66 |
+ epatch "${FILESDIR}"/${P}-glibc210.patch |
67 |
+ sed -i \ |
68 |
+ -e "s:-g3 -O2:${CFLAGS}:" \ |
69 |
+ -e "s:\$(CC):& \$(CFLAGS) \$(ELDFLGS): "\ |
70 |
+ `find -name Makefile` \ |
71 |
+ || die |
72 |
+ sed -i -e "s:LIBPATH = \$(PREFIX)/lib:LIBPATH = \$(PREFIX)/$(get_libdir):" Makefile |
73 |
+ |
74 |
+} |
75 |
+ |
76 |
+src_compile() { |
77 |
+ # emacs does not have to be a requirement. |
78 |
+ emake CC=$(tc-getCC) ETAGS=echo ELDFLGS="${LDFLAGS}" || die "emake failed" |
79 |
+} |
80 |
+ |
81 |
+src_install() { |
82 |
+ make install DESTDIR="${D}" || die "einstall failed" |
83 |
+} |
84 |
|
85 |
diff --git a/dev-util/elfsh/elfsh-0.65_rc1.ebuild b/dev-util/elfsh/elfsh-0.65_rc1.ebuild |
86 |
new file mode 100644 |
87 |
index 0000000..4b481d8 |
88 |
--- /dev/null |
89 |
+++ b/dev-util/elfsh/elfsh-0.65_rc1.ebuild |
90 |
@@ -0,0 +1,59 @@ |
91 |
+# Copyright 1999-2009 Gentoo Foundation |
92 |
+# Distributed under the terms of the GNU General Public License v2 |
93 |
+# $Id$ |
94 |
+ |
95 |
+inherit eutils toolchain-funcs |
96 |
+ |
97 |
+DESCRIPTION="scripting language to modify ELF binaries" |
98 |
+HOMEPAGE="http://www.eresi-project.org/" |
99 |
+SRC_URI="mirror://gentoo/${P}.zip" |
100 |
+#http://www.eresi-project.org/browser/tags/elfsh_0_65rc1 |
101 |
+ |
102 |
+LICENSE="GPL-2" |
103 |
+SLOT="0" |
104 |
+KEYWORDS="" |
105 |
+IUSE="readline" |
106 |
+ |
107 |
+DEPEND=">=dev-libs/expat-1.95 |
108 |
+ readline? ( sys-libs/readline ) |
109 |
+ app-arch/unzip |
110 |
+ dev-libs/libhash" |
111 |
+RDEPEND="" |
112 |
+ |
113 |
+S="${WORKDIR}/tags/elfsh_0_65rc1" |
114 |
+ |
115 |
+src_unpack() { |
116 |
+ unpack ${A} |
117 |
+ cd "${S}" |
118 |
+ sed -i \ |
119 |
+ -e 's: -O2 : :g' \ |
120 |
+ -e "s: -g3 : ${CFLAGS} :" \ |
121 |
+ -e "/^LDFLAGS/s:=:=${LDFLAGS} :" \ |
122 |
+ $(find -name Makefile) \ |
123 |
+ || die |
124 |
+ chmod +x configure |
125 |
+} |
126 |
+ |
127 |
+src_compile() { |
128 |
+ local bits |
129 |
+ touch foo.c && $(tc-getCC) -c foo.c -o foo.o || die |
130 |
+ case $(file foo.o) in |
131 |
+ *64-bit*) bits=64;; |
132 |
+ *32-bit*) bits=32;; |
133 |
+ *) die "unknown bits: $(file foo.o)";; |
134 |
+ esac |
135 |
+ # not an autoconf script |
136 |
+ ./configure \ |
137 |
+ $([[ ${bits} == "64" ]] && echo "--enable-m64") \ |
138 |
+ --enable-${bits} \ |
139 |
+ $(use_enable readline) \ |
140 |
+ || die |
141 |
+ # emacs does not have to be a requirement. |
142 |
+ emake ETAGS=echo || die "emake failed" |
143 |
+} |
144 |
+ |
145 |
+src_install() { |
146 |
+ make install DESTDIR="${D}" || die "install failed" |
147 |
+ dodoc README.FIRST doc/AUTHOR doc/CREDITS doc/Changelog doc/*.txt |
148 |
+ doman doc/*.1 |
149 |
+} |
150 |
|
151 |
diff --git a/dev-util/elfsh/files/0.51_beta3-gentoo.patch b/dev-util/elfsh/files/0.51_beta3-gentoo.patch |
152 |
new file mode 100644 |
153 |
index 0000000..26c4f7b |
154 |
--- /dev/null |
155 |
+++ b/dev-util/elfsh/files/0.51_beta3-gentoo.patch |
156 |
@@ -0,0 +1,63 @@ |
157 |
+diff -ur elfsh-0.51b3.orig/Makefile elfsh-0.51b3/Makefile |
158 |
+--- elfsh-0.51b3.orig/Makefile 2004-09-20 22:20:22.152723392 -0400 |
159 |
++++ elfsh-0.51b3/Makefile 2004-09-20 22:21:37.270303784 -0400 |
160 |
+@@ -5,12 +5,14 @@ |
161 |
+ ## Last update Sun May 25 18:12:43 2003 mayhem |
162 |
+ ## |
163 |
+ |
164 |
++DESTDIR = / |
165 |
++PREFIX = $(DESTDIR)/usr |
166 |
+ RM = rm -f |
167 |
+ ETAGS = etags |
168 |
+-MODPATH = /usr/share/elfsh/ |
169 |
+-BINPATH = /usr/bin |
170 |
+-LIBPATH = /usr/lib/ |
171 |
+-INCPATH = /usr/include/ |
172 |
++BINPATH = $(PREFIX)/bin |
173 |
++LIBPATH = $(PREFIX)/lib |
174 |
++INCPATH = $(PREFIX)/include |
175 |
++MODPATH = $(LIBPATH)/elfsh |
176 |
+ |
177 |
+ all : |
178 |
+ @echo 'Builting libelfsh...' |
179 |
+@@ -32,14 +34,15 @@ |
180 |
+ #$(MAKE) -s tags |
181 |
+ |
182 |
+ install : mod_install |
183 |
++ @mkdir -p $(BINPATH) $(LIBPATH) $(INCPATH) |
184 |
+ @cp vm/elfsh $(BINPATH)/ |
185 |
+ @cp libelfsh/libelfsh.a libelfsh/libelfsh.so $(LIBPATH) |
186 |
+ @cp libelfsh/include/libelfsh*.h $(INCPATH) |
187 |
+- @chmod 755 $(BINPATH)/elfsh $(LIBPATH)libelfsh.so $(LIBPATH)libelfsh.a $(INCPATH)libelfsh*.h |
188 |
++ @chmod 755 $(BINPATH)/elfsh $(LIBPATH)/libelfsh.so |
189 |
+ @echo 'ELFsh and Libelfsh installed successfully .' |
190 |
+ |
191 |
+ mod_install: |
192 |
+- @mkdir $(MODPATH) 2>/dev/null || true |
193 |
++ @mkdir -p $(MODPATH) |
194 |
+ @cp modules/*.so $(MODPATH) |
195 |
+ @chmod -R 755 $(MODPATH) |
196 |
+ |
197 |
+diff -ur elfsh-0.51b3.orig/vm/Makefile elfsh-0.51b3/vm/Makefile |
198 |
+--- elfsh-0.51b3.orig/vm/Makefile 2004-09-20 22:20:22.117728712 -0400 |
199 |
++++ elfsh-0.51b3/vm/Makefile 2004-09-20 22:22:17.807141248 -0400 |
200 |
+@@ -13,6 +13,7 @@ |
201 |
+ #DLOPT_linux-gnu = -ldl |
202 |
+ #DLOPT_solaris = -ldl |
203 |
+ #EXTRAOPT = -lefence |
204 |
++EXTRAOPT = -ldl |
205 |
+ |
206 |
+ # Uncomment that to use libasm |
207 |
+ #ASMOPT = -DUSE_LIBASM |
208 |
+diff -ur elfsh-0.51b3.orig/vm/include/elfsh.h elfsh-0.51b3/vm/include/elfsh.h |
209 |
+--- elfsh-0.51b3.orig/vm/include/elfsh.h 2004-09-20 22:20:22.116728864 -0400 |
210 |
++++ elfsh-0.51b3/vm/include/elfsh.h 2004-09-20 22:20:22.358692080 -0400 |
211 |
+@@ -94,7 +94,7 @@ |
212 |
+ #define ELFSH_SHELL "/bin/bash" |
213 |
+ #define ELFSH_INIT "elfsh_init" |
214 |
+ #define ELFSH_FINI "elfsh_fini" |
215 |
+-#define ELFSH_MODPATH "/usr/share/elfsh/" |
216 |
++#define ELFSH_MODPATH "/usr/lib/elfsh/" |
217 |
+ |
218 |
+ /* For elfsh/elfsh/disasm.c:display_object() */ |
219 |
+ #define ELFSH_HEXA_VIEW 0 |
220 |
|
221 |
diff --git a/dev-util/elfsh/files/elfsh-0.51_beta3-glibc210.patch b/dev-util/elfsh/files/elfsh-0.51_beta3-glibc210.patch |
222 |
new file mode 100644 |
223 |
index 0000000..2e83c93 |
224 |
--- /dev/null |
225 |
+++ b/dev-util/elfsh/files/elfsh-0.51_beta3-glibc210.patch |
226 |
@@ -0,0 +1,70 @@ |
227 |
+diff -NrU5 elfsh-0.51b3.original/modules/modgraph.c elfsh-0.51b3/modules/modgraph.c |
228 |
+--- elfsh-0.51b3.original/modules/modgraph.c 2009-07-22 23:17:51.000000000 -0600 |
229 |
++++ elfsh-0.51b3/modules/modgraph.c 2009-07-22 23:33:28.000000000 -0600 |
230 |
+@@ -181,11 +181,11 @@ |
231 |
+ } |
232 |
+ } |
233 |
+ else |
234 |
+ { |
235 |
+ name = elfsh_reverse_metasym(world.current, blk->vaddr, &off); |
236 |
+- dprintf(fd, "%s_%08x", name, off); |
237 |
++ d_printf(fd, "%s_%08x", name, off); |
238 |
+ |
239 |
+ } |
240 |
+ free(buffer); |
241 |
+ world.state.vm_quiet = vm_quiet; |
242 |
+ } |
243 |
+diff -NrU5 elfsh-0.51b3.original/vm/disasm.c elfsh-0.51b3/vm/disasm.c |
244 |
+--- elfsh-0.51b3.original/vm/disasm.c 2009-07-22 23:17:51.000000000 -0600 |
245 |
++++ elfsh-0.51b3/vm/disasm.c 2009-07-22 23:33:53.000000000 -0600 |
246 |
+@@ -80,30 +80,30 @@ |
247 |
+ |
248 |
+ /* Are we in quiet mode ? */ |
249 |
+ if (world.state.vm_quiet) |
250 |
+ { |
251 |
+ snprintf(buf, sizeof(buf), " %08X %s + %u", vaddr + index, name, nindex); |
252 |
+- dprintf(fd, "%-40s %-30s ", buf, s); |
253 |
++ d_printf(fd, "%-40s %-30s ", buf, s); |
254 |
+ } |
255 |
+ else |
256 |
+ { |
257 |
+ snprintf(buf, sizeof(buf), " %08X [foff: %u] %s + %u", |
258 |
+ vaddr + index, foffset + index, name, nindex); |
259 |
+- dprintf(fd, "%-60s %-50s ", buf, s); |
260 |
++ d_printf(fd, "%-60s %-50s ", buf, s); |
261 |
+ } |
262 |
+ |
263 |
+ /* Print bytes in hexa for this instruction */ |
264 |
+ ret = asm_instr_len(&ptr); |
265 |
+ if (!ret) |
266 |
+ ret++; |
267 |
+ |
268 |
+ if (!world.state.vm_quiet) |
269 |
+ for (idx_bytes = 0; idx_bytes < ret; idx_bytes++) |
270 |
+- dprintf(fd, "%c%c ", |
271 |
++ d_printf(fd, "%c%c ", |
272 |
+ base[(buff[index + idx_bytes] >> 4) & 0x0F], |
273 |
+ base[buff[index + idx_bytes] & 0x0F]); |
274 |
+- dprintf(fd, "\n"); |
275 |
++ d_printf(fd, "\n"); |
276 |
+ return (ret); |
277 |
+ } |
278 |
+ #endif /* USE_LIBASM */ |
279 |
+ |
280 |
+ |
281 |
+diff -NrU5 elfsh-0.51b3.original/vm/include/elfsh.h elfsh-0.51b3/vm/include/elfsh.h |
282 |
+--- elfsh-0.51b3.original/vm/include/elfsh.h 2009-07-22 23:17:51.000000000 -0600 |
283 |
++++ elfsh-0.51b3/vm/include/elfsh.h 2009-07-22 23:22:30.000000000 -0600 |
284 |
+@@ -469,11 +469,11 @@ |
285 |
+ int vm_getsort(u_int index, u_int argc, char **argv); |
286 |
+ int vm_getdisasm(u_int index, u_int argc, char **argv); |
287 |
+ int vm_gethexa(u_int index, u_int argc, char **argv); |
288 |
+ int vm_getvarparams(u_int index, u_int argc, char **argv); |
289 |
+ |
290 |
+-int dprintf(int fd, char *format, ...); |
291 |
++int d_printf(int fd, char *format, ...); |
292 |
+ |
293 |
+ /* Libasm resolve handler */ |
294 |
+ void do_resolve(void *data, u_int vaddr, char *, u_int); |
295 |
+ u_int display_instr(int, u_int, u_int, u_int, u_int, |
296 |
+ char *, u_int, char *); |
297 |
|
298 |
diff --git a/dev-util/elfsh/metadata.xml b/dev-util/elfsh/metadata.xml |
299 |
new file mode 100644 |
300 |
index 0000000..d48e561 |
301 |
--- /dev/null |
302 |
+++ b/dev-util/elfsh/metadata.xml |
303 |
@@ -0,0 +1,10 @@ |
304 |
+<?xml version="1.0" encoding="UTF-8"?> |
305 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
306 |
+<pkgmetadata> |
307 |
+<maintainer> |
308 |
+ <email>blueness@g.o</email> |
309 |
+</maintainer> |
310 |
+<longdescription> |
311 |
+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. |
312 |
+</longdescription> |
313 |
+</pkgmetadata> |