pentoo-overlay/app-exploits/the-backdoor-factory/the-backdoor-factory-3.4.2-r1.ebuild

50 lines
1.1 KiB
Bash

# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 )
inherit eutils python-single-r1
DESCRIPTION="BDF allows to patch executable binaries with user desired shellcode"
HOMEPAGE="https://github.com/secretsquirrel/the-backdoor-factory"
SRC_URI="https://github.com/secretsquirrel/the-backdoor-factory/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD-4"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND=""
RDEPEND="${DEPEND}
>=dev-python/capstone-python-3.0
app-crypt/osslsigncode
dev-python/pefile"
src_prepare(){
epatch "${FILESDIR}"/pebin.patch
rm -r osslsigncode
rm {update.sh,install.sh}
cp "${FILESDIR}"/certs/* ./certs/
eapply_user
}
src_compile() {
cd ./aPLib/example/
gcc -c -I../lib/elf -m32 -Wall -O2 -s -o appack.o appack.c -v
gcc -m32 -Wall -O2 -s -o appack appack.o ../lib/elf/aplib.a -v
cd ../..
}
src_install() {
insinto /usr/share/${PN}
doins -r "${S}"/*
dobin ./aPLib/example/appack
python_fix_shebang "${ED}"/usr/share/${PN}
fperms +x /usr/share/${PN}/backdoor.py
dosym "${EPREFIX}"/usr/share/${PN}/backdoor.py /usr/bin/${PN}
}