Skip to content

Instantly share code, notes, and snippets.

@ggiamarchi
Last active January 5, 2019 15:04
Show Gist options
  • Save ggiamarchi/31e3c687a71e7dae1f301cac30608d18 to your computer and use it in GitHub Desktop.
Save ggiamarchi/31e3c687a71e7dae1f301cac30608d18 to your computer and use it in GitHub Desktop.
Dump AMI BIOS on a system running Ubuntu 16.04
#!/bin/bash
set -ex
if [ "$(whoami)" != "root" ] ; then
echo "Error : You must be root"
exit 1
fi
apt update
apt install -y git linux-headers-$(uname -r) build-essential
filename=${1}
if [ -z "${filename}" ] ; then
filename=bios.bin
fi
pushd /tmp
rm -rf afulnx
mkdir afulnx
cd afulnx
wget -O afulnx_64 'https://drive.google.com/uc?export=download&id=0B8iRENdOLYZzdXN5RGc3Z1Y5ZGM'
chmod +x afulnx_64
git clone https://github.com/RomanHargrave/amifldrv.git
cd amifldrv
make -C /lib/modules/$(uname -r)/build/ SUBDIRS=/tmp/afulnx/amifldrv/ modules
cp amifldrv_mod.ko ../amifldrv_mod
cp amifldrv_mod.ko ../amifldrv_mod.o
cd ..
./afulnx_64 ${filename} /O
popd
mv /tmp/afulnx/$filename .
@Zibri
Copy link

Zibri commented Jan 5, 2019

no need! I patche afulnx. This works on ubuntu too: https://github.com/Zibri/afulnx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment