From 6f45836c008580816772c1cf6bf7ee425b51d91a Mon Sep 17 00:00:00 2001 From: Maxence Laude Date: Sun, 5 Nov 2023 02:44:39 +0100 Subject: [PATCH 1/2] Initial commit --- Dockerfile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 25 ++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..836dc28 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,49 @@ +FROM ubuntu:jammy-20231004 +LABEL Maxence Laude + +ARG DEBIAN_FRONTEND=noninteractive +ARG UEFIExtract_VERSION=A68 + +RUN echo 'apt::install-recommends "false";' > /etc/apt/apt.conf.d/no-install-recommends +RUN apt update && \ + apt install -y git ruby ruby-dev upx-ucl p7zip-full innoextract build-essential unzip curl file && \ + gem install bundler && \ + apt autoremove -y && \ + apt autoclean && \ + apt clean && \ + rm -rf /var/lib/apt/lists/* + +RUN groupadd -g 1000 app \ + && useradd -d /app -s /bin/bash -g app app \ + && mkdir -p /app/.ssh \ + && chown -R app:app /app + +RUN git clone https://github.com/awilliam/rom-parser && \ + cd rom-parser && \ + make && \ + chmod +x rom-parser && \ + mv rom-parser /usr/local/bin + +WORKDIR /app + +USER app + +COPY --chown=app:app . . + +# https://github.com/coderobe/VBiosFinder/issues/50 +# https://github.com/coderobe/VBiosFinder/pull/51 +RUN git remote add vkhodygo https://github.com/vkhodygo/VBiosFinder.git && \ + git fetch vkhodygo && \ + git rebase + +RUN mkdir -p /app/.gem && \ + bundle config set --local path '/app/.gem' && \ + bundle install --path=vendor/bundle + +ENV PATH=$PATH:$HOME/.gem/bin + +RUN curl -LO https://github.com/LongSoft/UEFITool/releases/download/A68/UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && unzip UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && mv uefiextract ./3rdparty/UEFIExtract + +RUN mkdir ./output + +ENTRYPOINT ["./vbiosfinder", "extract"] \ No newline at end of file diff --git a/README.md b/README.md index bd380d1..baf8ab1 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # VBiosFinder (linux) -This tool attempts to extract a VBIOS from a bios update +This tool attempts to extract a VBIOS from a bios update Laptops with NVIDIA Optimus graphics often have the dGPU VBIOS integrated in their system BIOS, this makes extracting the VBIOS a complicated process. Provided you have a BIOS Update for your laptop, this tool might be able to automagically extract all available VBIOS from it. ## Dependencies + - Ruby - bundler **(a ruby gem)** - [UEFIExtract](https://github.com/LongSoft/UEFITool) **(note: UEFIExtract can be found in the branch `new_engine`)** @@ -13,15 +14,30 @@ Laptops with NVIDIA Optimus graphics often have the dGPU VBIOS integrated in the - upx **(optional)** ## Note + Some dependencies might not offer a package for your linux distribution **(like UEFIDump and rom-parser)**. The binaries can be placed in `./3rdparty` to avoid having to install them. ## Usage + - Run `bundle install --path=vendor/bundle` to install the required ruby modules **(once)** - Run `./vbiosfinder extract /path/to/bios_update.exe` to attempt an extraction - A temporary working dir is created at `./tmp-vbiosfinder` which can be removed inbetween runs - Extracted VBIOS roms will be placed in `./output` +### Running with Docker + +- Create a temporary folder using the command `mkdir -p /tmp/extract/output`. +- Move your BIOS file into the `/tmp/extract/` directory. +- Run the Docker container using the following command: + +``` +docker run -v /tmp/extract/:/app/bios/ -v /tmp/extract/output/:/app/output/ binboum/vbiosfinder:latest /app/bios/bios_update.exe +``` + +- You can find the extract in `/tmp/extract/output/` + ## Compatibility (non-exhaustive) + - [ASUS N580GD](https://github.com/coderobe/VBiosFinder/issues/15) - Lenovo y50-70 - [Lenovo S5 2nd Gen (20JAA009HH)](https://github.com/coderobe/VBiosFinder/issues/1) @@ -35,14 +51,17 @@ Some dependencies might not offer a package for your linux distribution **(like - **note: if your device isn't listed here, feel free to try this tool and report your results!** ## Troubleshooting -**Q:** There are no files in `./output` after running the tool! + +**Q:** There are no files in `./output` after running the tool! **A:** It's very possible that VBiosFinder can't extract your type of BIOS update right now. Feel free to open an issue with a link to your bios update and the program output you get! ## TODO + - Add option to extract the bios of the running system **(can we?)** - ~~Clean up temporary working dir after finishing up~~ done - Test with more BIOS updates ## Licensing -This project, initially authored by Robin Broda, is licensed under the GNU Affero General Public License v3 + +This project, initially authored by Robin Broda, is licensed under the GNU Affero General Public License v3 A copy of the license is available in `LICENSE.txt` From b7046f157f036a21ee52f18b338a747f959d21e5 Mon Sep 17 00:00:00 2001 From: Maxence Laude Date: Sun, 5 Nov 2023 03:03:23 +0100 Subject: [PATCH 2/2] fix typo --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 836dc28..6d934c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,6 @@ RUN apt update && \ RUN groupadd -g 1000 app \ && useradd -d /app -s /bin/bash -g app app \ - && mkdir -p /app/.ssh \ && chown -R app:app /app RUN git clone https://github.com/awilliam/rom-parser && \