Skip to content

Instantly share code, notes, and snippets.

@emonti
Created January 10, 2014 09:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emonti/8349289 to your computer and use it in GitHub Desktop.
Save emonti/8349289 to your computer and use it in GitHub Desktop.
quick/dirty build a dynamic lib from xpwn - eric monti WARNING: this was for something really specific -- YMMV... drop this in your top-level directory where you checked out planetbeing/xpwn and cross your fingers ;)
#!/bin/bash
# quick/dirty build a dynamic lib from xpwn - eric monti
# WARNING: this was for something really specific -- YMMV...
# drop this in your top-level directory where you checked out planetbeing/xpwn and cross your fingers ;)
cmake -f CMakeLists.txt
make || exit 1
rm -rf ./sharedlib
mkdir -p ./sharedlib/lib
tmpdir=`mktemp -d .sharedlib_build.XXXX`
echo "[+] building in $tmpdir"
pushd $tmpdir
for staticlib in `find .. -name \*.a -type f`; do
cp $staticlib ../sharedlib/lib/
ar -x $staticlib
done
cc -o ../sharedlib/lib/libxpwn.dylib -dynamiclib *.o -lpng -lcrypto -lz -lstdc++ -lbz2 -framework CoreFoundation -framework IOKit
popd
test -f sharedlib/lib/libxpwn.dylib || exit 1
echo "[+] removing $tmpdir"
rm -rf $tmpdir
cp -r includes ./sharedlib/include
echo "[+] build finished. files in $(pwd)/sharedlib"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment